Skip to main content

Module patcher

Module patcher 

Source
Expand description

Patcher — the integrator. Turns a crate::Change into a subsecond_types::JumpTable (wrapped in PatchPlan) by stitching together the pieces from I4g-1 through I4g-X2:

  • captured rustc args + linker args from the fat build (wrapper, whisker-rustc-shim, whisker-linker-shim)
  • rustc --emit=obj + own linker invoke (thin_build, link_plan, runner::thin_rebuild_obj)
  • parse the resulting patch dylib (symbol_table)
  • diff against the cached original (HotpatchModuleCache + build_jump_table)

Two constructors:

  • Patcher::new takes already-loaded state. Tests use this to build the captured maps and the original-binary cache by hand, so they never need to actually run a real fat build.
  • Patcher::initialize is the production path: spawn a fat build with both shims active, load both captures, parse the original binary, then call new.

Structs§

Patcher