IT lexicon › Programming › SONAME

SONAME

Programming På svenska → Updated: 2026-11-06

The name an ELF shared library carries inside itself, which programs linked against it remember instead of the file name.

A library built with -Wl,-soname,libfoo.so.1 gets its DT_SONAME field set. When a program links against libfoo.so, the linker records the SONAME as a DT_NEEDED dependency — not the file it actually read. On disk that gives a chain of symlinks: libfoo.so for the developer, libfoo.so.1 for the dynamic linker and libfoo.so.1.2.3 as the real file. ldconfig keeps the middle one in order.

The convention is that the number in the SONAME only goes up when the ABI breaks. Old and new versions can then sit side by side and every program finds its own. glibc has been libc.so.6 since 1997 and handles everything since with symbol versioning. Windows had no equivalent, and the result earned its own name: DLL hell.

← Back to the lexicon