Compilers · Cluster
Linkers and Loaders
Object formats, relocation, and dynamic linking.
- 01 Sections, Symbols, and Relocations in an ELF Object File Why a compiled object file is more than machine code: the section header table, the symbol table and its string table, and the relocation records a linker consumes.
- 02 Static Archives and Link Order: Why a Library Must Come After Its User How an ar archive is laid out and searched, why a single left-to-right pass over libraries resolves some references and not others, and what group and repeated search do about it.
- 03 Relocation Arithmetic: Patching Machine Code at Link Time The formulas behind absolute, PC-relative, and GOT-relative relocations, the range limits that make them fail, and why the addend must be stored separately on some architectures.
- 04 Position-Independent Code and the Global Offset Table Why shared code cannot contain absolute addresses, how the GOT turns one pointer indirection into position independence, and what the PLT adds for functions.
- 05 From execve to _start: How the Kernel Maps an ELF Executable Program headers rather than section headers drive loading, PT_LOAD segments carry permissions, PT_INTERP names the dynamic linker, and the kernel hands over a stack with argc, argv, and auxv.
- 06 SONAME, DT_NEEDED, and Symbol Versioning in Shared Libraries How a shared object records the name it wants to be found under, why DT_NEEDED names a soname rather than a file, and how version definitions keep old binaries working.
- 07 Lazy Binding and the Procedure Linkage Table How the first call to an external function lands in the dynamic linker, what the resolver writes into the GOT, and why eager binding and full RELRO remove the writable page.
- 08 Symbol Interposition and the Global Namespace The search order that decides which definition of a name wins, why a shared library cannot rely on its own globals, and how preloading and interposition actually take effect.
- 09 Thread-Local Storage Access Models The four TLS access sequences the compiler can emit, what each costs per access, and why a module loaded after startup cannot use the cheapest ones.
- 10 STT_GNU_IFUNC: Choosing an Implementation at Load Time How a symbol can name a function that returns the address to call, the constraints the resolver runs under, and why the technique trades startup determinism for dispatch without indirection.