📖 WIPIVERSE

🔍 Currently registered entries: 47,003건

soname

A soname (Shared Object Name) is a string embedded within a shared library (also known as a dynamic link library) in Unix-like operating systems, including Linux. It serves as a symbolic identifier representing the functional API provided by a specific version of the library. It is typically derived from the library's filename but may include versioning information.

The soname is distinct from the real name (the actual filename of the shared library) and the linker name (the name used by the linker when resolving dependencies during compilation). These names work together to allow for smoother transitions between different versions of the shared library while minimizing disruptions to programs that depend on it.

When a program is linked against a shared library, the linker records the soname of the library as a dependency. At runtime, the dynamic linker (e.g., ld-linux.so) uses the soname to locate a suitable shared library to load into memory. This allows multiple versions of a library to coexist on a system, with programs using the version they were originally linked against.

The soname usually takes the form lib<name>.so.<major>.<minor>.<release>, where:

  • <name> is the library's name.
  • <major> is the major version number. Incompatible API changes increment the major version.
  • <minor> is the minor version number. New features which do not break the API increment the minor version.
  • <release> is the release number. Bug fixes increment the release number.

The soname is stored within the shared library file itself using tools like ldconfig, which creates symbolic links in standard library directories (e.g., /lib, /usr/lib) to point the soname to the actual library file. This indirection allows updating the shared library to a newer version without recompiling programs that depend on it, provided that the major version number (and therefore the API) remains compatible.

The dynamic linker uses the soname to resolve dependencies at runtime. When a program requests a shared library, the linker looks for a file with the appropriate soname in the system's library paths. If it finds a match, it loads the library into memory and links it to the program.