Add Mach-O relocatable object fixtures - #193
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 artifacts, a byte-for-byte rebuild from the committed source, and the load attempt above. Nothing here exercises the unmerged loader change itself. |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Both added objects loaded with the cle branch that consumes them, cle 787, so import cle
ld = cle.Loader(path, auto_load_libs=False)
m = ld.main_object
print(type(m).__name__, m.arch, hex(m.min_addr), hex(m.max_addr))
print([(s.name, hex(s.vaddr), hex(s.memsize)) for s in m.sections])
print([(s.name, hex(s.rebased_addr)) for s in m.symbols])Before — neither object is in the repository, so the angr/binaries masterAfter — both load as with this changeWith cle at master both are refused instead, with |
a5d111c to
5b20454
Compare
The repository has Mach-O executables, dylibs and one kext, but no MH_OBJECT, so nothing covers the relocatable-object load path. Freestanding source, so building it needs a clang that can target Apple and no SDK.
5b20454 to
3b1387b
Compare
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS cle master is red, and this branch holds one of the two fixtures it is waiting angr/cle#787 merged at 2026-09-03T17:48:10Z as Read from cle CI run 33786713158, job Merging this branch clears that one. It does not make cle master green by Head here is |
cle's tests on master now load tests/aarch64/langdetect_go.macho and tests/aarch64/relocatable_object.macho, which #193 and #224 added after this branch was cut. angr/cle#807 names this pull request in its sync: line, so CI checks this branch out instead of master and those two files were missing: 3 failed, 264 passed on the macOS job. Merging master in supplies them and leaves this branch's own five objects and build script untouched.
cle's tests on master now load tests/aarch64/langdetect_go.macho and tests/aarch64/relocatable_object.macho, which #193 and #224 added after this branch was cut. angr/cle#764 and angr/cle#804 name this pull request in their sync: lines, so CI checks this branch out instead of master; once either is rebased onto current cle master those two files would be missing and the macOS job would fail. Merging master in supplies them and leaves this branch's own three objects and build script untouched.
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
The repository carries Mach-O executables, dylibs and one kext, but no
MH_OBJECT, so nothing covers the relocatable-object load path. On master bothpaths are absent:
Root cause
Every Mach-O here was added as a whole program or library, and
MH_OBJECTisan intermediate a build normally deletes, so the filetype never arrived on its
own.
Fix
Adds
tests/aarch64/relocatable_object.macho(920 bytes) andtests/x86_64/relocatable_object.macho(792 bytes), the same freestandingsource built for both architectures. Freestanding on purpose: compiling to an
object never resolves headers, so
tests_src/macho_relocatable/build.shneedsonly a clang that can target Apple, and no SDK. Both are one unnamed segment
holding
__textand__bss, which is the shape that distinguishes an objectfrom every other Mach-O here.
Testing
Read back, each carries
__textand__bssand four symbols —_keccak_init,_keccak_absorb,_keccak_squeezeand_state— and cle atmaster refuses both with
CLECompatibilityError: Unsupported Mach-O file type: 1. With cle 787, which teaches the Mach-O backend to loadMH_OBJECT,the aarch64 object maps
[0x0:0x1e7]and the x86_64 one[0x0:0x1c7], with__bssfollowing__textin each.Validation: #193 (comment)
session: sharpen