Repository navigation
[AUTOMATED] Honor embedded PowerPC32 ELF requirements and decode ISEL by default - #1827
Conversation
[AUTOMATED] Preserve the exact decoded call site and executable-section exclusion without adding a discovered procedure.
… PowerPC PLT entry
d5f6293 to
e5828e1
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…tride Resolves the stage-corpus file count (main's 861 plus this branch's kuna-aif-slot-edges = 862) and re-synthesizes docs/baseline-stages.json from both sides. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…n export The xrefs section on exports called through their own PLT stub now says that ARM, AArch64, PowerPC32 absolute/BSS-PLT and PowerPC64 ELFv1 stubs are recognized by shape, and which shapes are not joined (Thumb interworking prefixes, --long-plt, PAC entries, PowerPC32 secure-PLT PIC stubs), so a reader knows when to query the stub address instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
With e500 selected for every SPE-note image, ordinary integer functions lose
arguments: the e500 model drops a 32-bit argument read through mulhwu
(`ud3(u32 a) { return a / 3; }` decompiles as `ud3(void)` with an
uninitialized 64-bit local), and 64-bit integer pairs lose halves. On 414
GCC -O2 PPC32 objects given an SPE note, 23 integer-only functions went from
the DWARF parameter count to too few and 12 from too many to correct.
ppcapu becomes isel|on|off, default isel. isel selects the generic PowerPC32
model plus ISEL for an ISEL, SPE or embedded floating-point requirement or the
embedded ABI flag, so every such image decodes what main decodes plus isel.
on keeps the e500 selection for SPE requirements (the previous PR default and
main's opt-in); off keeps the generic decoder.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…ot a reference to it A name query widened to an export's own PLT stub and slot also picked up every `data` row whose value merely equals the stub's or slot's address: an immediate (`li r9,0x2064`, `mov w0,#0x4b50`) or an AArch64 adrp page base that happens to equal the slot. In a position-independent image such a value is not the export's address. refs_to_class now drops `data` rows to the export-PLT members only; calls, jumps, reads and writes are kept, the x86-64 veneer path is unchanged, and a query by the stub's address still lists the row. Over 348 changed name queries on real AArch64/ARM/PPC shared objects this removes exactly the 14 such rows and nothing else. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
|
[AUTOMATED] Pushed a merge of main and one fix on top (377fe0a). The ISEL part works: an ISEL note or # ud3(u32 a) { return a / 3; }, as GCC 13 -O2 emits it for PPC32
printf '3d20aaaa6129aaab7c6348165463f87e4e800020' | xxd -r -p > ud3.bin
kuna decompile ud3.bin 0x1000 --raw-image --base 0x1000 --target PowerPC:BE:32:default:default
# unsigned int sub_1000(unsigned int a0) { return a0 / 3; }
kuna decompile ud3.bin 0x1000 --raw-image --base 0x1000 --target PowerPC:BE:32:e500:default
# unsigned int sub_1000(void) { unsigned long long v1; // r3 ... }I compiled 414 GCC -O2 PPC32 objects and added an SPE note to each. In integer-only functions, the e500 default gave too few parameters (checked against DWARF) in 24 functions that were correct before, and corrected 12.
|
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Problem
An embedded PowerPC32 ELF can declare that it uses
isel, yet default decompilation stops at that instruction. This function should return zero whena == 0andbotherwise.Fix
Follow-up to #1424.
--option ppcapu offretain precedence over automatic selection.Tests
The stage fixture checks both select outcomes and the fifth argument passed to a callee. QEMU and compiled emitted C agree on the upper-word witness: 42 on both paths for e500, and 1 or 2 for full-width PowerPC. Loader tests cover malformed note owners in both byte orders.