Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head Why every check was redThe branch passed archinfo#374, which would have added the keyword, is closed: the ask there was to use pypcode and What changed
Net diff is +48 -0 across EvidenceDifferential over every EM_ARM ELF in angr/binaries (68) plus the two BE8 fixtures = 70 objects, On the BE8 fixture, Locally, with Merge-base-relative lint and typecheck, reproducing the hosted jobs' comparison: The Why this stays in draft
Two more things a reviewer should weigh. The three platform legs' session: sharpen |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_793 |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Moving this to draft. It should not be reviewed or merged in its current shape, The green run is green because this pull request pins The closure was correct, and the investigation that followed it says so: Ghidra So the remaining question is not whether BE8 can be supported but which layer No action is requested. This note exists so the dead pin is not mistaken for a session: mega-corpus |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS The angr half of the block is open as angr/angr#7041. With it, Two things in the description above are stale against head |
BE8 is big-endian data with little-endian instruction words, the layout ARMv6 introduced and the one every big-endian ARM Linux distribution ships. The flag sits in `e_flags` next to the float-ABI bits the loader already reads, but it was never looked at, so a BE8 object was indistinguishable from a BE32 one and the resulting arch described its instructions as big-endian. VEX then fetched them byte-swapped and almost nothing decoded. Read EF_ARM_BE8 alongside the float-ABI bits and pass the instruction endness to archinfo, which grew the parameter for this. An object that sets the flag without either float-ABI bit now also resolves to an ARM arch rather than falling through to `arch_from_id`, which cannot express the split. Requires archinfo with `ArchARM(endness, instruction_endness=...)`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The platform jobs read the description from github.event.pull_request.body, frozen when the run was triggered, so the sync: lines added afterwards never reached them. This commit's tree is identical to its parent's.
The BE8 ELF support here needs the ArchARM instruction_endness keyword added in archinfo#374. Jobs that install dependencies from the default branch (Test (Pyodide), Test macos-15) fail without it. Revert this pin to master before merge, once archinfo#374 has merged.
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
Parked as a draft; do not review or merge in this shape. The checks above
are green only because
[tool.uv.sources]pinsarchinfoto thebe8/archbranch of archinfo 374, which has been closed. The branch still resolves, so CI
still passes against a change that is not going to land; against archinfo
master this diff raises
TypeErroron every ARM load, not only on BE8 objects,because it passes
instruction_endness=on all ARM paths. What has to happenbefore this is ready is in Fix.
Problem
ELF.extract_archreads the ARM float-ABI bits out ofe_flagsbut notEF_ARM_BE8, so a BE8 object — big-endian data with little-endianinstructions, which ARMv6 introduced — is indistinguishable from a BE32 one.
The fixture pair in binaries 202 makes the difference visible:
be8_loophase_flags=0x05800400withEF_ARM_BE8set,be32_loophas0x05000400withit clear, and their
.textsections are exact four-byte reversals of eachother. A BE8 object is loaded as fully big-endian, VEX fetches every
instruction byte-swapped, and across 48 BE8 ARM ELFs the baseline covers 4.892%
of the bytes marked as ARM code by
$amapping symbols.Root cause
e_flagsis consulted for the ABI bits and not forEF_ARM_BE8, andarch_from_idhas no way to express the split in the first place:VexArchInfocarries one endness for both instruction fetch and data access.Fix
Read the flag alongside the ABI bits and build the architecture with
little-endian instruction endness; a BE8 object carrying neither ABI bit
returns
ArchARMdirectly rather than falling through toarch_from_id. Dataaccesses are then tagged little-endian too, which is wrong, and separating the
two needs a libVEX change.
That is the design the parking note rejects. Ghidra already ships
ARM:LEBE:32:v7LEInstructionandARM:LEBE:32:v8LEInstruction, declaredendian="big" instructionEndian="little", and its ARM opinion constrains onthe BE8 flag directly, so the split can be had today through the p-code path
without an archinfo change at all. Before this becomes reviewable, the layer
question has to be settled that way, and it has to account for cle 610, a
third-party attempt at ARM BE8 in this same file that has been open far longer.
Testing
tests/test_arch_detect.pycovers both fixtures; on master the new case failswith
assert <Endness.BE> == <Endness.LE>forarch.instruction_endness. Thesuite figures and the 48-object recovery measurement in the validation record
were taken with the closed archinfo branch on the path, so they describe a
dependency that no longer exists; they are kept as the size of the problem, not
as a claim about this branch. No output comparison is posted while this is
parked.
Validation: #793 (comment)
sync: angr/binaries#202
session: sharpen