pub fn link(program: &Program) -> Result<LinkedProgram, LinkError>Expand description
Link a content-addressed Program into a flat LinkedProgram.
The linker:
- Topologically sorts function blobs by dependencies.
- Pass 1 (sequential): Computes cumulative base offsets for each blob
and builds the
hash_to_idreverse index. - Pass 2 (parallel for >50 functions): Each blob independently remaps its instructions/constants/strings into pre-allocated output arrays at non-overlapping offsets.
- Builds a
LinkedFunctiontable and merged debug info.