Expand description
ELF / Mach-O symbol-table parser.
The single piece of logic parse_symbol_table hides: open a
binary file, hand it to the object crate, and project the rich
object::SymbolTable API down to the small SymbolTable view
Whisker’s hot-reload pipeline actually needs (name → address +
kind/size/visibility flags).
Why a projection rather than re-using object::Symbol directly:
the object types are bound by lifetimes to the file they came
out of. Storing them across an async boundary would force the
file bytes to live for the whole dev-loop run. Copying the small
pieces we need (name + 4 numbers per symbol) into owned data is
cheaper than that lifetime gymnastics.
Structs§
- Symbol
Info - What we keep about each symbol — enough to drive subsecond’s JumpTable construction (I4g-2) and no more.
- Symbol
Table - Owned name → info map.
BTreeMapwould give deterministic iteration order but we want O(1) lookup by symbol name in the JumpTable construction step, so HashMap it is.
Functions§
- parse_
symbol_ table - Open
pathand project its symbol table. - parse_
symbol_ table_ from_ bytes - Same as
parse_symbol_tablebut takes the bytes directly. Used by tests so we don’t need a fixture file on disk.