Files
reverse-engineering-anything/docs/specs/native/ppc64-elfv2/tasks.md
T
0e0c5a8fea feat(ghidra): admit ELFv2 PPC64 executables through a Power ISA 3.0 lane (#12517)
* feat(ghidra): admit ELFv2 PPC64 executables through a Power ISA 3.0 lane

An EM_PPC64 ELF has been classified in the powerpc family since #12089, but
the Ghidra lane still refused every ELF64 file. It now admits ELF64 ET_EXEC
files that declare the ELFv2 ABI, little or big endian, and imports them with
PowerPC:LE:64:A2ALT or PowerPC:BE:64:A2ALT by byte order.

Ghidra's 64-bit "default" languages decode the G2-era instruction set and
stop at the first VSX instruction in POWER8 or POWER9 code; the A2ALT
languages are Power ISA 3.0 and decode it. The ELF loader selects A2ALT
today, and the lane passes it explicitly and records it as provider-pinned.

ELFv1 (.opd function descriptors), an undeclared ABI, other e_flags bits,
ET_DYN and ET_REL are refused with their own reasons. The 32-bit lane is
unchanged.

npm run verify:ghidra:ppc64 builds a source-owned ELFv2 fixture in both byte
orders and checks it against GNU readelf and real Ghidra through MCP and the
CLI: the bound language, fixed instruction bytes including a VSX xxlor, the
global-entry thunk to each function's local entry, direct calls, snapshot
identity, and a shared object refused before Ghidra starts.

Refs #12085

* fix(ghidra): supervise PPC64 verifier compiler and CLI processes

Timeouts on bare execFile stop only the direct child, so a linker can
outlive Clang and disappear from the parent-tree cleanup check. Launch
those commands through the shared command owner, pass that runner into
the PPC64 fixture builder, and close the owner before the lineage check.
A failed close stays registered for retry and the diagnostic workspace
is retained.

* docs(ghidra): record the PPC64 ELFv2 Power ISA 3.0 lane

Add the feature specification, plan, and tasks for the lane, and index
them with the other feature records.

* fix(ghidra): finish shared PowerPC verifier command ownership

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-19 18:27:31 -05:00

22 lines
1.3 KiB
Markdown

# Tasks
- [x] Define the single-feature scope, contract, and implementation plan.
- [x] Admit ELF64 `ET_EXEC` ELFv2 in both byte orders, and refuse ELFv1, an
undeclared ABI, other `e_flags` bits, `ET_DYN`, and `ET_REL`.
- [x] Pin `PowerPC:LE:64:A2ALT` and `PowerPC:BE:64:A2ALT` as `provider-pinned`,
and record `REA_GHIDRA_LANGUAGE_ID` as `configured`.
- [x] Commit `powerpc_support_lane: "elf64-elfv2-exec-isa3"` and the header
facts on the analysis profile.
- [x] Cover admission, the configured language, refusals, and Hopper/IDA
decline in `src/ghidra/GhidraPowerPcProfile.test.ts`.
- [x] Cover the readelf boundary, probe words, a `not-in-listing` VSX word, the
doubleword, and the thunk fields in the PowerPC conformance checks.
- [x] Add `verify:ghidra:ppc64`, and run its compiler and CLI through the shared
command owner, closed before the process-lineage check.
- [x] Update the PowerPC guide and index this feature record.
- [x] Record the contributor's Ghidra 12.2 Linux x86-64 runs of the PPC32 and
PPC64 verifiers in [the pull request](https://github.com/morluto/rea/pull/12517).
Those runs preceded the verifier ownership changes.
- [ ] Rerun both verifiers on a real Ghidra installation after the ownership
changes. A macOS real-provider run is also unrecorded.