Updated in 2024-02.
(In celebration of my 2800th llvm-project commit) Happy Halloween!
This article describes relative relocations and how the RELR format can greatly decrease file sizes.
An ELF linker performs the following steps to process an absolute
relocation type whose width equals the word size (e.g.
R_AARCH64_ABS64
, R_X86_64_64
).
1 | if (undefined_weak || (!preemptible && (no_pie || is_shn_abs))) |
Note: in FDPIC
ABIs, there is no single base address. Relative relocations can
still be used, but the runtime operation is not simply
*loc += base
.