Updated in 2022-10.
(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. The knwon FDPIC ABIs do not use relative relocations. This article doed not discuss FDPIC.