Expand description
Synthetic license-clean Mach-O arm64 fixtures (generated, not from Apple).
Used by unit tests and to produce checked-in binaries under tests/fixtures/.
Constants§
- CALL_
DYLIB_ GOT_ VA - Preferred GOT VA of
call_dylib_exit(__DATA,__got). - CALL_
LIBSYSTEM_ GOT_ VA - Preferred GOT VA of
call_libsystem_exit(__DATA,__got). - KH_
ADD_ SYMBOL - Symbol name exported by
arm64_dylib_addand imported bycall_dylib_exit. - KH_
BOTTLE_ MARK_ SYMBOL - Symbol exported by synthetic bottle libSystem and imported by
call_libsystem_exit. - KH_
BOTTLE_ MARK_ VALUE - Return value of
_kh_bottle_mark/ guest exit code ofcall_libsystem_exit. - LIBKH_
ADD_ INSTALL_ NAME - Install name / sibling path for the synthetic add dylib.
- LIBKH_
ADD_ TEXT_ VA - Preferred TEXT VA of
arm64_dylib_add(and_kh_addn_value). - LIBKH_
CTOR_ INSTALL_ NAME - Install name for the constructor dylib fixture.
- LIBKH_
CTOR_ TEXT_ VA - Preferred TEXT base of
arm64_dylib_ctor. - LIBSYSTEM_
EXIT_ SYMBOL - Darwin
_exit(2)— C_exit→ nlist__exit. - LIBSYSTEM_
INSTALL_ NAME - Absolute install name for the synthetic bottle libSystem stub.
- LIBSYSTEM_
PRINTF_ SYMBOL - C
printf→ nlist_printf(host helper; no%conversions yet). - LIBSYSTEM_
PUTS_ SYMBOL - C
puts→ nlist_puts(host helper). - LIBSYSTEM_
TEXT_ VA - Preferred TEXT base of
arm64_libsystem_stub. - LIBSYSTEM_
WRITE_ SYMBOL - Darwin
write(2)— Cwrite→ nlist_write. - ROUNDTRIP_
PAYLOAD - Payload bytes for
memory_file_roundtrip(written next to the Mach-O). - ROUNDTRIP_
PAYLOAD_ PATH - Relative path embedded in
memory_file_roundtrip(cwd = repo /app root).
Functions§
- arm64_
dylib_ add - Synthetic
MH_DYLIB: exports_kh_addasadd w0,w0,w1; ret. - arm64_
dylib_ ctor - Synthetic
MH_DYLIBwith oneS_MOD_INIT_FUNC_POINTERSentry. - arm64_
execute_ with_ text - Builds a minimal little-endian
MH_EXECUTEarm64 Mach-O with custom text. - arm64_
libsystem_ stub - Synthetic bottle
libSystem.B.dylibwith a growing C-ABI surface: - bsdthread_
create_ join - Micro program:
bsdthread_register+bsdthread_createworker, join via flag,exit(0). - call_
dylib_ chained_ exit - Same program as
call_dylib_exit, but linking usesLC_DYLD_CHAINED_FIXUPS(DYLD_CHAINED_PTR_64bind of_kh_addinto__got) instead of classic bind opcodes. - call_
dylib_ exit - Synthetic
MH_EXECUTE: load@executable_path/libkh_add.dylib, call_kh_add(20,22),exitwith the sum (42). Also declares decorative/usr/lib/libSystem.B.dylib. - call_
libsystem_ exit - Synthetic
MH_EXECUTE: load absolute/usr/lib/libSystem.B.dylib, call_kh_bottle_mark,exitwith 77. - ctor_
main_ exit - Synthetic
MH_EXECUTEthat loadsLIBKH_CTOR_INSTALL_NAMEthenexit(0). - errno_
unknown_ then_ exit - Micro program: unknown syscall (
x16=0xBEEF) thenexit(0). - memory_
file_ roundtrip - Ultimate static fixture: open → fstat64 → file mmap → mutate → mprotect → msync → clock_gettime → sysctlbyname → munmap → close → exit(0).
- minimal_
arm64_ execute - Micro program:
write(1, "kh\\n", 3); exit(0). - mmap_
touch_ exit - Micro program: anonymous
mmap+ write byte +munmap+exit(0). - wrap_
fat_ arm64_ only - Wraps a thin arm64 Mach-O in a single-arch fat container (big-endian fat header).