How symbols work and why we need them
summary
Shows how ELF on Linux implements C/C++ linkage with three symbol tables (symtab, dynsym and debug), how relocations let the linker fix calls, and why the compiler emits separate sections per weak/inline entity so the linker can discard duplicates; demonstrates building an executable that returns 42, using objdump, nm, readelf and strip and GCC, and shows strip removing symbols causes an undefined reference; notes the surprising ~20 section headers in a tiny object file and explains weak and unique symbols and -fvisibility=hidden.
AI-written summary · about
chapters (8)
- 0:00Symbols and purpose
- 3:56Global variables example
- 13:03Object file sections
- 20:49Linkage in C/C++
- 39:13Dynamic linking
- 51:13Symbol tables in libraries
- 55:06Program elements need symbols
- 1:00:02Summary of symbols
related talks
01mTalk Preview: How Symbols Work and Why We Need Them
01h 02mHow Linux Elf Symbols Work and How They Are Used in C++ and C Programming
59m“C++ in Elvenland”
01h 26mWhat Does the Linker Actually Do for Us?
48mMy Little Object File: How Linkers Implement C++
31mAmong ELFs and DWARFs
01h 04mThe Bits Between the Bits: How We Get to main()
01h 00mFrom Program to Process - What Happens After the Compiler
