From Program to Process - What Happens After the Compiler
summary
Starts from a tiny program int main{return 1} and shows, with Compiler Explorer, hexdump, objdump -d -M intel -r and readelf -r, how that single call becomes a relocation entry (call opcode 0xE8 at offset 0x1d resolved to -0x21), how the linker fixes addresses, and how dynamic linking uses GOT/PLT lazy binding and PIC/PIE to defer and share symbols. Covers ELF sections (.text, .data, .bss, .rodata), System V AMD64 calling convention, and demonstrates the final executable exiting with code 1.
AI-written summary · about
chapters (14)
- 0:00Intro
- 0:36What happens after the compiler
- 11:17Relocations
- 14:56Linking
- 18:03Static Linking
- 18:38Separate Files
- 20:35Linking Objects
- 21:41Data
- 27:25Globals
- 31:20Relative Distance
- 38:26Object Files
- 44:21Shared Objects
- 45:51Global Offset Table
- 50:11Functions
related talks
01h 04mThe Bits Between the Bits: How We Get to main()
01h 01mHow to start a program
59mDemystifying Process Address Space: Heap, Stack, and Beyond
01h 23mC++ Linkers and the One Definition Rule
48mMy Little Object File: How Linkers Implement C++
59m“C++ in Elvenland”
01h 02mHow Linux Elf Symbols Work and How They Are Used in C++ and C Programming
01h 26mWhat Does the Linker Actually Do for Us?
