-
Notifications
You must be signed in to change notification settings - Fork 32
PositionIndependentCode
Felix S. Klock II edited this page Jul 28, 2013
·
2 revisions
"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
jump
instruction 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.