Linker & Loader: The build process after-party
summary
Explains what the linker actually does on Linux/ELF: lays out code and data, resolves symbols, and applies relocations (PC‑relative fixups like the observed “-4” for a call). Demonstrates compiling separate .o files, inspecting them with objdump -d -r and nm, shows name‑mangling for overloaded C++ symbols, archives into lib.a, and runs the real linker via g++ -Wl,--wrap=goose_sound* to swap a symbol at link time — works for one case but highlights caveats with in‑library calls, objects, and virtual methods.
AI-written summary · about
chapters (17)
- 0:00Introduction to linking
- 1:45The role of the linker
- 2:48Linker responsibilities
- 4:26Code demonstration
- 7:20Object file analysis
- 8:42Symbol mangling
- 12:21Relocation types
- 14:05Post-linking analysis
- 16:11Library archiving
- 17:30Compiler front-end
- 19:10Symbol tables and tips
- 21:26C++ linking complexities
- 23:25Link time optimization
- 25:15Shared libraries
- 26:56Symbol wrapping
- 29:42Hijacking caveats
- 33:07Q&A and conclusion
