Add ARM BE8 and BE32 fixtures - #202
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveats: this repository has no test suite, so the record is header and section verification of the committed artifacts plus the load above. The build script was not rerun here, so byte reproducibility from Re-keyed 2026-08-28. The figures above were measured at |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Searching every ELF object under Before — this repository has no big-endian ARM ELF at all, so nothing exercises BE8 or BE32: angr/binaries at the merge baseAfter — one BE8 and one BE32 object, built from the same object file and differing only in with this change |
The first version of this branch passed instruction_endness= to ArchARMEL, ArchARMHF and ArchARM on every ARM path, and pinned archinfo to the branch that added the keyword. archinfo#374 is closed, so against archinfo master that call is a TypeError, and it fires on every ARM ELF carrying either float-ABI bit rather than only on BE8 images: 44 of the 70 ARM objects in angr/binaries raise it, which is what turned every ARM test in angr and angrop red. Ghidra already ships ARM:LEBE:32:v7LEInstruction, declared endian="big" instructionEndian="little", and its own ARM ELF opinion selects it on EF_ARM_BE8, so the split needs no archinfo change: EF_ARM_BE8 returns an ArchPcode for that language and every other ARM path is restored to master. Over the 70 ARM ELF objects in angr/binaries plus the two fixtures in angr/binaries#202, the architecture cle picks now changes for exactly one file, be8_loop, where 0x2010c decodes as cmp r0,#0x1; movlt r0,#0x0 against master's smlatteq r0, r3, r0, r5. Two consequences are worth naming. ALL_RELOCATIONS is keyed on arch.name, so the language id joins it beside the sparc entry that set the precedent; without that a BE8 shared object would lose every relocation. And angr's CFG recovery over a p-code ARM language needs archinfo#376: is_arm_arch is a prefix test on the name, so it answers True for ARM:LEBE and CFGFast then reads an ARM-only option that a p-code architecture does not carry. With that predicate fixed, CFGFast recovers _start and compute from be8_loop. pypcode is optional in cle, so an installation without it keeps master's big-endian ARM answer and logs that it did. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The repository has no big-endian ARM ELF at all. These are a matched pair built from one object file, differing only in whether the linker was given --be8, so a test can tell the two layouts apart: their .text sections are byte-for-byte reversals of each other, and e_flags differs only in EF_ARM_BE8. Freestanding, 1000 bytes each; the source, the build line and the digests are in tests_src/armeb. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The first version of this branch passed instruction_endness= to ArchARMEL, ArchARMHF and ArchARM on every ARM path, and pinned archinfo to the branch that added the keyword. archinfo#374 is closed, so against archinfo master that call is a TypeError, and it fires on every ARM ELF carrying either float-ABI bit rather than only on BE8 images: 44 of the 70 ARM objects in angr/binaries raise it, which is what turned every ARM test in angr and angrop red. Ghidra already ships ARM:LEBE:32:v7LEInstruction, declared endian="big" instructionEndian="little", and its own ARM ELF opinion selects it on EF_ARM_BE8, so the split needs no archinfo change: EF_ARM_BE8 returns an ArchPcode for that language and every other ARM path is restored to master. Over the 70 ARM ELF objects in angr/binaries plus the two fixtures in angr/binaries#202, the architecture cle picks now changes for exactly one file, be8_loop, where 0x2010c decodes as cmp r0,#0x1; movlt r0,#0x0 against master's smlatteq r0, r3, r0, r5. Two consequences are worth naming. ALL_RELOCATIONS is keyed on arch.name, so the language id joins it beside the sparc entry that set the precedent; without that a BE8 shared object would lose every relocation. And angr's CFG recovery over a p-code ARM language needs archinfo#376: is_arm_arch is a prefix test on the name, so it answers True for ARM:LEBE and CFGFast then reads an ARM-only option that a p-code architecture does not carry. With that predicate fixed, CFGFast recovers _start and compute from be8_loop. pypcode is optional in cle, so an installation without it keeps master's big-endian ARM answer and logs that it did. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
angr/binarieshas no big-endian ARM ELF at all, so nothing exercises either big-endian ARM layout. Searching every ELF undertests/:BE8 — big-endian data with little-endian instructions, introduced in ARMv6 and marked by
EF_ARM_BE8ine_flags— is the half that cannot be inferred from the header a loader already reads, since a BE8 and a BE32 image differ in that flag and in nothing else about class, machine or data encoding. Without a pair that differs only there, a consumer cannot be shown to read the flag rather than guess.Root cause
Neither layout falls out of a normal cross build for this repository: it takes a big-endian ARM target, and BE8 additionally takes a linker flag.
Fix
Add
tests/armeb/be8_loopandtests/armeb/be32_loop, 1000 bytes each. They come from one compiled object linked twice with the same toolchain, differing only by--be8:Their
.textsections are 64 bytes each and are exact four-byte reversals of one another, so the pair isolates the flag and nothing else. Source and the build recipe are intests_src/armeb.Testing
Both headers were read back out of the committed files with pyelftools and cross-checked against
readelf -handreadelf -x .text; the reversal was checked word by word. The sha256s are in the validation record. This repository has no suite of its own; the consumer is the archinfo and cle work that readsEF_ARM_BE8, which today loads both as<Arch ARMHF (BE)>with identical map ranges.Validation: #202 (comment)
session: sharpen