Add two i386 ELFs for CLE's linked-image ELF handling - #219
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head Both fixtures rebuild byte-identically. Running each Nothing in the build reads a clock, a path or a VCS: What each carries, read out of the section headers with
Consumed by angr/cle#802 and angr/cle#801. On current cle the first loads with 0 sections and 0 symbols, and the second comes back with 5 of its 128 The complete angr workspace gate was run on each consuming branch with this head checked out as the This repository has no executable suite of its own. Rebased 2026-08-29. Re-keyed onto binaries master |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS What the two fixtures show, loaded with Before — cle masterAfter — the section table survives, and the loaded image is the file's: with the consuming branches |
756427a to
cf3cfde
Compare
hash_without_dynstr keeps .hash and .dynsym while its linker script discards .dynstr, so the linker writes sh_link = 0 into both and no ELF reader can build them. linked_with_emit_relocs has an ordinary section table but is linked at 0x1000 rather than at 0 and keeps the link-time .rel.text and .rel.data that --emit-relocs left behind. Both shapes are ordinary u-boot output and neither was represented here. Freestanding, so no libc and no start files: clang and GNU ld build both from tests_src/elf, and each build.sh is deterministic.
cf3cfde to
9f5433b
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
cle has no test input for a linked image that keeps
.hashand.dynsymafterits linker script discarded
.dynstr. Every u-boot build has that shape: thelinker leaves
sh_link = 0behind, pyelftools refuses to build the twosections, and cle answers by throwing the whole section header table away,
.symtaband its 11631 symbols with it.Root cause
None of the 826 ELF files here has a section whose
sh_linkpoints at the wrongsection type, and none keeps its link-time
.relsections in an image that isalready linked. Both are ordinary for embedded firmware and absent from this
corpus.
Fix
Two i386 ELFs, both freestanding -- no libc, no start files -- built by clang
and GNU ld from sources in
tests_src/elf/, and both deterministic: two buildsgive the same sha256.
tests/i386/hash_without_dynstr, 5360 bytes, keeps.hashand.dynsymwhileits linker script discards
.dynstr, so the linker writessh_link = 0intoboth and no ELF reader can build them.
tests/i386/linked_with_emit_relocs, 5204 bytes, has an ordinary section tablebut is linked at
0x1000rather than at 0 and keeps its link-time.rel.textand
.rel.datathrough--emit-relocs, the way u-boot's build does.Testing
cle's new
tests/test_elf_resiliency.pyandtests/test_linked_image_relocations.pyload them. On current cle the firstimage loads with no sections and no symbols, and the second comes back with 5
bytes of
.textrewritten and its function-pointer table reading0x2020, 0x2040for functions at0x1020and0x1040.Consumed by angr/cle#802, and by the relocation fix it should land behind, cle PR 801. Validation: #219 (comment)
session: sharpen