The Bits Between the Bits: How We Get to main()
summary
Linux executables assemble from per-file ELF sections that the compiler emits and the linker stitches together; using objdump, gdb and readelf the talk traces .init_array global-constructor pointers, shows the linker script KEEP/PROVIDE_HIDDEN pattern that creates __init_array_start/end, and explains lazy dynamic linking via the PLT/GOT trampoline and the interpreter. Small hello binaries are ~8K but statically linking swells to ~2.5MB; LD_BIND, LD_DEBUG and LD_PRELOAD force or inspect resolution, letting one intercept calls — the demos all work and reveal where ODR and startup-order bugs hide.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:05Program compilation
- 4:56ELF file structure
- 7:57Static initialization
- 13:39Global construction array
- 19:25The linker process
- 24:54Relocations
- 30:55Linker scripts
- 37:16Dynamic linking
- 42:07Lazy symbol resolution
- 48:33The dynamic interpreter
- 51:42Interposition and weak symbols
- 55:47LTO and final questions
related talks
01h 00mFrom Program to Process - What Happens After the Compiler
01h 01mHow to start a program
01h 23mC++ Linkers and the One Definition Rule
01h 26mWhat Does the Linker Actually Do for Us?
48mMy Little Object File: How Linkers Implement C++
01h 02mHow symbols work and why we need them
01h 02mHow Linux Elf Symbols Work and How They Are Used in C++ and C Programming
31mAmong ELFs and DWARFs
