PositionIndependentCode - larcenists/larceny GitHub Wiki
"PositionIndependentCode" is machine code which eschews the use of absolute addresses when branching.
Instead, all branching is relative, either to the current program counter, or to some common point of reference. For example:
- the code vector in reg0
- the code-vector in some procedure referenced by the current procedure's constant vector
- the code-vector obtained by following the lexical chain for the current procedure (see for example the MacScheme
jumpinstruction for where this arises).
- NativeCodeLarcenys use PositionIndependentCode.
- PetitLarceny does not use position independent code; instead it emits C (or NASM) source with references to labels in the text segment that must be resolved at link time, at the latest.