Dynamic Linking On GNU Linux
summary
Explains how GNU/Linux dynamic linking is actually performed by the dynamic loader (ld.so) at exec time and via runtime calls, showing tools and flags used to inspect and control it: readelf/ldd/objdump for inspection, LD_LIBRARY_PATH, rpath, LD_PRELOAD and ELF DT_RUNPATH for search order and overrides, and dlopen/dlsym with RTLD_NOW/LAZY and LOCAL/GLOBAL for runtime loading. Demonstrates overriding an allocator with LD_PRELOAD and loading plugins with dlopen, and notes that position‑independent code and symbol resolution semantics determine whether updates or overrides work as expected.
AI-written summary · about
chapters (26)
- 0:00Introduction to dynamic linking
- 1:57Executable formats in Linux
- 3:03Compilation and linking basics
- 6:03Dynamic linking process
- 9:08Static vs dynamic linking
- 11:18Building dynamic libraries
- 12:29Dynamic linker options
- 14:21Dynamic linker's role
- 15:49Kernel and dynamic linking
- 18:04Difference between executables and shared objects
- 19:10Library search paths
- 20:14Shared object dependencies
- 21:22Common use cases for dynamic linking
- 22:30Configuring library paths
- 23:59Inspecting dynamic libraries
- 24:50Cross-platform linking challenges
- 27:05Loading shared libraries
- 28:13Function lookup in shared objects
- 30:28Context-dependent linking
- 31:56Function pointers in shared objects
- 33:25Dynamic memory and linking
- 34:34Library resolution order
- 35:39Advanced linker parameters
- 36:51Error handling in dynamic linking
- 37:55Production code and dynamic linking
- 39:00Plugin systems with dynamic libraries
