Most shared libraries will have an embedded SONAME
. This SONAME
is used to indicate binary compatibility. For example, libxml2.so.2.7.8 has an embedded SONAME
of libxml2.so.2:
readelf -Wa libxml2.so.2.7.8 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libxml2.so.2]
If libxml2.so.2.7.9 came out, it would likely still be binary compatible with v2.7.8, and would still have an SONAME
of libxml2.so.2 and your application would work just fine. Only when a change was introduced that broke binary compatibility would the SONAME
get incremented, breaking your application.
If you want to create a package that will automatically work on all distributions, one approach is to deliver your own version of libxml2, then modify the LD_LIBRARY_PATH
such that your version automatically gets loaded.