Relocation (computing)

ID: relocation-computing

Relocation (computing) adjusts references in program components to match the addresses assigned during linking or loading. A relocation record identifies a place to patch, a target symbol and an architecture-dependent rule for computing the replacement. Moving a section changes the addresses associated with its contents, even when their relative arrangement stays fixed.[ref]
In an illustrative absolute-address rule, a symbol address and addend produce . In a relative rule defined using reference address , they may produce . If , and , the latter gives an offset of . Actual instruction encodings specify the precise reference point, scaling and allowed range, so a linker (computing) must apply the relocation type's rule rather than blindly adding one constant everywhere.

New to topics? Read the docs here!