
Dynamic Linking
You know those "cannot open shared object file" errors that send you down a rabbit hole of LD_LIBRARY_PATH exports and Google searches? This cuts through that. It covers the full spectrum: compiling shared libraries with proper soname versioning, RPATH versus RUNPATH (and why RUNPATH is better for runtime flexibility), dlopen/dlsym plugin patterns, and LD_PRELOAD interposition for function hooking. The symbol visibility section alone will save you from export bloat. What I appreciate is the search order diagram and the $ORIGIN trick for relocatable installs. If you've ever shipped software that worked on your machine but failed on deployment because of linking issues, you need this reference.
- skills.sh installs
- 650
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill dynamic-linking --agent claude-codeInstalls into .claude/skills of the current project.
Files
Dynamic Linking
Purpose
Guide agents through Linux dynamic linking: shared library creation, RPATH/RUNPATH configuration, soname versioning, dlopen/dlsym plugin patterns, LD_PRELOAD interposition, and symbol visibility control.
Triggers
- "Cannot open shared object file: No such file or directory"
- "How do I set RPATH so my binary finds its shared library?"
- "How do I use dlopen/dlsym for a plugin system?"
- "What's the difference between RPATH and RUNPATH?"
- "How do I use LD_PRELOAD to intercept a function?"
- "How do I version my shared library with soname?"
Workflow
1. Creating a shared library
# Compile with -fPIC (position-independent code)
gcc -fPIC -c src/mylib.c -o mylib.o
# Link shared library with soname
gcc -shared -Wl,-soname,libmylib.so.1 \
mylib.o -o libmylib.so.1.2.3
# Create symlinks (standard convention)
ln -s libmylib.so.1.2.3 libmylib.so.1 # soname link (used by ldconfig)
ln -s libmylib.so.1 libmylib.so # link link (used at compile time)
# Register with ldconfig (system-wide)
sudo cp libmylib.so.1.2.3 /usr/local/lib/
sudo ldconfig
2. Soname versioning convention
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Category
- Debugging
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Rust Security624
- Rust Ffi613
- Rust Unsafe611
- Pgo610
- Interpreters609
- Cargo Workflows608
- Rust Sanitizers Miri604
- Meson603
- Cpp Modules597
- Rust Debugging597
- Hardware Counters590
- Debug Optimized Builds579
- Cpp Templates574
- Rustc Basics567
- Rust Cross565
- Wasm Emscripten559
- Zig Debugging555
- Zig Build System552
- Zig Cross536
- Wasm Wasmtime532
- Zig Cinterop524
- Cmake1.8K
- Static Analysis1.2K
- Gdb1K