Skip to content

Linux ELF shared library guide covering loading failures, RPATH/RUNPATH, soname versioning, dlopen plugins, and symbol visibility.

CCM score
60 of 100
skills.sh installs
737
GitHub stars
303
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers library creation, soname versioning, RPATH vs RUNPATH, search order, dlopen/dlsym plugins, and LD_PRELOAD interposition
  • Includes build commands, readelf, ldd, LD_DEBUG=libs, and nm -D checks, plus a table of common loader errors and fixes
  • Recommends RUNPATH with --enable-new-dtags and $ORIGIN for relocatable installs, and -fvisibility=hidden for default symbol hiding
  • Designed for developers debugging "cannot open shared object file" errors or building plugin systems on Linux

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill dynamic-linking -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Debugging, CLI & Terminal
First seen
Jun 3, 2026

Questions

What does the dynamic-linking skill help with?

The dynamic-linking skill guides an agent through Linux ELF shared libraries, including library loading failures, RPATH versus RUNPATH, soname versioning, dlopen and dlsym plugin patterns, LD_PRELOAD interposition, and symbol visibility control. It activates on errors such as "cannot open shared object file" and on queries about LD_LIBRARY_PATH.

How do I install the dynamic-linking skill?

Run npx -y skills add mohitmishra786/low-level-dev-skills --skill dynamic-linking -y in your project. Once installed, the agent can walk you through diagnosing shared library loading problems and configuring library search paths.

Where does dynamic-linking stand in the Debugging category?

dynamic-linking is listed in the Debugging category on Claude Marketplaces, alongside diagnosing-bugs, safe-debug, systematic-debugging and sentry-cli. It focuses on a narrower area than those general debugging skills, covering how shared libraries are found and loaded at runtime on Linux.

Does dynamic-linking help with LD_PRELOAD and symbol visibility?

Yes, the skill covers LD_PRELOAD interposition, where a library loaded first overrides functions such as malloc, and controlling which symbols a shared library exports. It also explains soname versioning and when to bump the major, minor or patch version.

More from mohitmishra786/low-level-dev-skills

All 54

Similar to Dynamic Linking

More Debugging