Add an x32 relocatable object - #198
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 verification of the committed artifact plus the load attempt above. Rebuild, 2026-08-28: |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Searching every ELF object under Before — the only object with the two fields disagreeing is a core dump, which reaches a different loader path: angr/binaries at the merge baseAfter — a relocatable object with the same disagreement, which is what the arch-selection path reads: with this change |
4f749ef to
6db48c4
Compare
An ELFCLASS32 container whose e_machine is EM_X86_64. No existing fixture has a class and a machine that disagree about the word size.
6db48c4 to
fa7edcc
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
The x32 ABI is an
ELFCLASS32container whosee_machineisEM_X86_64: the class gives the pointer width and the machine gives the instruction set, and they disagree about the word size. cle'sELF.extract_archhas to decide from both, and no relocatable object here lets a test assert on that decision. Searching every ELF undertests/:The one object with the two fields disagreeing is a core dump, which reaches the ELFCore backend rather than the ordinary one.
Root cause
Nothing emits an x32 object by accident. It takes
clang -target x86_64-linux-gnux32, and no fixture here was built that way.Fix
Add
tests/x86_64/x32_relocatable.o—ET_REL,ELFCLASS32,EM_X86_64, 536 bytes. Source and a build script are intests_src/x32. Compiling to an object needs no x32 libc, so any clang that can target it will do; built here with clang 21 from nixpkgs. Nothing existing is touched.Testing
tests_src/x32/build.shundernix shell nixpkgs#clang(clang 21) rebuilds the committed object byte for byte, sha256b792c4d4873832edf6e998370206812851852b3fee42aa89e73c8a02af21a29b, so the recipe and the artifact agree. The header was read back withreadelf -hand independently with pyelftools. This repository has no suite of its own, so the fixture is exercised by the cle change toELF.extract_arch, which today loads it as<Arch X86 (LE)>— pointer width from the class, instruction set wrong.Validation: #198 (comment)
session: sharpen