Tag · Compiler toolchains

9 articles to explore.

[The World of Linkers—Theory 16] From a Working Linker to One You Can Trust
A linker must do more than produce a runnable file. Follow the engineering behind parallel passes, deterministic output, useful diagnostics, layered tests, and incremental linking—and see how each optimization changes what must be proved.
Read article
[The World of Linkers—Theory 15] Beyond ELF: The Rules Change with the File Format
Compare Mach-O and PE/COFF through their headers, directory records and contents. Byte layouts and coordinate conversions explain imports, pointer chains, unwind metadata, duplicate selection and TLS, while separating file structure, link-time interfaces and runtime contracts.
Read article
[The World of Linkers—Theory 12] What Changes When the Optimizer Can See Across Files?
Watch a cross-file call disappear, inspect the contract between symbol resolution and LTO, measure ThinLTO caching, then explore identical code folding and function layout without confusing smaller output with correct or faster output.
Read article
[The World of Linkers—Theory 06] Before main Gets a Turn
Follow an ELF file through kernel mappings, zero-filled memory, demand paging, the initial stack, and C runtime startup. Then watch static PIE relocate itself and malformed images reveal the loader's validation boundaries.
Read article
[The World of Linkers—Theory 05] A Place for Every Section—and an Exit for Dead Code
Build the bridge from input sections to loadable segments. Compare GNU ld and LLD layouts, calculate file offsets and virtual addresses, trace section garbage collection, and test what happens when a linker script gets page permissions wrong.
Read article
[The World of Linkers—Theory 04] Relocation: Four Bytes Between Caller and Callee
Follow a runnable Linux program from an unresolved call to four final instruction bytes. Distinguish section offsets, file offsets, P, and next RIP before deriving S+A-P; then explore negative displacements, absolute pointers, addends, overflow, and instruction relaxation.
Read article
[The World of Linkers—Theory 03] One Name, Several Definitions: Who Wins?
Start with a runnable two-file program, then change only the link inputs to expose missing definitions, duplicate definitions, weak symbols, common storage, archive extraction, and the limits of ordinary type checking.
Read article
[The World of Linkers—Theory 01] The Long Road from Names to Addresses
A linker began as a way to move reusable code. Follow the problems that led to object files, shared libraries, unwind tables, security metadata, and modern parallel linkers—then link a small program by hand.
Read article
[The World of Linkers—Theory 00] From a Function Call to a Running Program
Follow a call across two source files to discover what the compiler, linker, and loader each know. Inspect a real Linux executable, diagnose failures at four stages, and establish the native environment used throughout the series.
Read article