Expand description
Build a subsecond::JumpTable from old vs new symbol tables.
This is the diffing brain of Tier 1: given the original binary’s
symbols and the freshly-linked patch dylib’s symbols, walk the
ones that exist in both and produce the address-to-address map
that subsecond::apply_patch will use to rewrite call sites.
What we don’t try to do here:
- Resolve undefined symbols. Those have address 0 in either side; including them would lie to the runtime.
- Touch data symbols. Hot-patching globals would race the program, which is harder than function hot-patching and not on the I4g critical path.
- Touch zero-sized symbols. These are typically PLT stubs and compiler-introduced markers; no actual code to swap.
- Special-case weak symbols. They get a warning so the dev loop can surface ambiguity, but the entry is still emitted — subsecond will pick whichever the dynamic linker chose.
Structs§
- Diff
Report - Names of symbols that exist in
oldand were dropped innew. Reported alongside the JumpTable so the dev loop can warn the user that calls into one of those would crash after a patch. - Patch
Plan - Result of
build_jump_table: thesubsecondpayload + a human-readable diff summary.
Functions§
- build_
jump_ table - Compose a
JumpTablefromold(the live binary’s symbol table, parsed once and cached) andnew(the freshly-built patch dylib’s symbol table).new_libis the on-device path the runtime willdlopen;aslr_referenceandnew_baseare what subsecond uses to correct for ASLR slide.