mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 05:02:40 +00:00
feat(domain): classify 64-bit PowerPC ELF (EM_PPC64) in the powerpc family (#12089)
* feat(domain): classify EM_PPC64 ELF in the powerpc family
An ELF with e_machine 21 was refused as "unsupported ELF architecture" before any provider was consulted, so every entry point answered a 64-bit PowerPC file with the generic file-format refusal.
The header reader now places EM_PPC64 in the powerpc family and keeps its class, byte order, e_type and e_flags as it does for EM_PPC. No provider lane admits these files: the Ghidra PowerPC gate already refuses ELF64 by naming PPC64, and Hopper, IDA and Kuna decline the family. Static ELF readers keep the name ppc64 for the machine.
Refs morluto/rea#12085.
* feat(domain): map the ppc64 reader name to the powerpc Evidence subject
Static readers report a 64-bit PowerPC ELF as ppc64, and the Evidence subject of those reports had no architecture because the name mapped to no family. With EM_PPC64 classified as powerpc, the subject now carries that family, as it does for ppc.
The Go verifier and the Go and Rust guides state the new mapping, and the boundary test keeps an unknown machine (s390) to show that unrecognized names still map to no family.
Refs morluto/rea#12085.
* revert(domain): keep ppc64 reader reports without a subject family
This reverts commit bbd7f7f661.
Evidence saved before the mapping carries no subject architecture for a ppc64 report. Views over those records compare the saved subject with the family the reader name maps to, so the mapping made them refuse records they accepted before. Nothing in this branch produces Evidence that needs the family, so the mapping can wait for a provider lane.
Refs morluto/rea#12085.
* fix(domain): classify EM_PPC64 only for an ELF64 header
Classifying machine 21 by number alone had two effects beyond target resolution. An ELF32 big-endian ET_EXEC header that claims EM_PPC64 became a powerpc target with class 32, which the 32-bit Ghidra lane admits because it sees only class, byte order, type and flags. And every static reader that maps a machine to a family started to put powerpc in its Evidence subject, which changes what views expect from records saved earlier.
elfArchitecture now takes the ELF class and names the family for machine 21 only when the caller commits ELF64. Header admission passes the class. Readers that pass only a machine keep the machine unclassified, so their reports, reader names and Evidence subjects are as they were.
Refs morluto/rea#12085.
This commit is contained in:
1 parent
93fb79e3b8
commit
cc971d6df5
6 files changed
+94
-9
No files matched your search
+8
-4
@@ -8,10 +8,14 @@ PowerPC variants remain separate follow-ups.
|
||||
|
||||
## Admission boundary
|
||||
|
||||
ELF `EM_PPC` (20) is retained as the provider-neutral `powerpc` family. The
|
||||
target also retains class, byte order, `e_type` and raw `e_flags`. Recognition
|
||||
does not mean every provider or PowerPC variant is supported. `EM_PPC64` (21)
|
||||
is not recognized as this family.
|
||||
ELF `EM_PPC` (20) is retained as the provider-neutral `powerpc` family, and so
|
||||
is `EM_PPC64` (21) when the header is ELF64. An ELF32 header that claims
|
||||
`EM_PPC64` stays unrecognized. The target also retains class, byte order,
|
||||
`e_type` and raw `e_flags`; for `EM_PPC64` the low two bits of `e_flags` declare
|
||||
the ELFv1 or ELFv2 ABI. Recognition does not mean every provider or PowerPC
|
||||
variant is supported: no provider lane admits `EM_PPC64` yet. Static ELF readers
|
||||
are unchanged: they report the machine as `ppc64` and their Evidence subject
|
||||
carries no family for it.
|
||||
|
||||
The Ghidra lane admits ELF32 `ET_EXEC`, big endian. ELF64, little-endian,
|
||||
relocatable and shared objects are refused with a specific unsupported
|
||||
|
||||
Reference in new issue
Block a user