~/talk

C++ Linkers and the One Definition Rule

Talkat ACCU 2024 · 2024-04-17..04-20· [compilers-and-language-design]
name:Roger Orr
links:none on file
slides:none on file

Linking is unpacked with concrete examples on Windows and Linux: compile to object, use ar/lib to make static archives, or build DLL/so and resolve via PLT/GOT at load time; object file 1.6KB linking to an 8.3KB binary (~80× source), x86-64 relative calls limited to 32-bit (2GB) offsets, syscalls during startup measured 28 vs 284 (Linux vs Windows), tools used include nm/dumpbin/readelf/objdump/strace and Godbolt, symbol hijack demonstrated via LD_PRELOAD, and exports tightened with GCC visibility attribute.

AI-written summary · about

  1. 0:00Linkers and ODR
  2. 1:13Why linkers in C++
  3. 10:02Symbol resolution in linkers
  4. 21:01Address space randomization
  5. 30:15Linking source files
  6. 37:44Static libraries benefits
  7. 39:32Shared libraries trade-offs
  8. 56:20Windows vs Linux shared libs
  9. 1:01:20One Definition Rule
  10. 1:18:13Security risks with shared libs
  11. 1:21:08Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.