In
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
and
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems, a soname is a field of data in a
shared object file. The soname is a
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
, which is used as a "logical name" describing the functionality of the object. Typically, that name is equal to the
filename
A filename or file name is a name used to uniquely identify a computer file in a directory structure. Different file systems impose different restrictions on filename lengths.
A filename may (depending on the file system) include:
* name &ndas ...
of the library, or to a prefix thereof, e.g.
libc.so.6
.
Name
The soname is often used to provide version backwards-compatibility information. For instance, if versions 1.0 through 1.9 of the shared library
libx
provide identical interfaces, they would all have the same soname, e.g.
libx.so.1
. If the system only includes version 1.3 of that shared object, with filename
libx.so.1.3
, the soname field of the shared object tells the system that it can be used to fill the dependency for a binary which was originally compiled using version 1.2.
If the
application binary interface
In computer software, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user.
An ' ...
(ABI) of a library changes in a
backward-incompatible
Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially i ...
way, the soname would be incremented, e.g. from
libX.so.5
to
libX.so.6
.
The
GNU linker
In computing, a linker or link editor is a computer system program that takes one or more object files (generated by a compiler or an assembler) and combines them into a single executable file, library file, or another "object" file.
A simpler ...
uses the
-h''name''
or
-soname=''name''
to specify the library name field. Internally, the linker will create a
DT_SONAME
field and populate it with
''name''
.
Given any shared object file, one can use the following command to get the information from within the library file using
objdump:
$ objdump -p libx.so.1.3 , grep SONAME
SONAME libx.so.1
See also
*
Application programming interface
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how t ...
(API)
*
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
References
{{Reflist
Unix
Linux