What does "6" mean in glibc.so.6?

When exploring the C++ binary, I find that libstdc++.so.6 is dyn-linked into libm.so.6 and libc.so.6:

$ ldd /lib/x86_64-linux-gnu/libstdc++.so.6 
        linux-vdso.so.1 (0x00007ffcb737b000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd3b2295000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd3b1c00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd3b2396000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd3b2275000)

My questions are:

  1. What does 6 mean in the name? I originally thought it was the version of glibc, but the version is 2.35, which is not relevant to 6.

    $ strings /lib/x86_64-linux-gnu/libc.so.6  | grep GLIBC_2.3
    GLIBC_2.3
    ...
    GLIBC_2.35
    
  2. Why is the suffix 6 so popular?

  3. Is there a schedule of when libc.so.7 will be released?

The 6 suffix is used for historical reasons, detailed in man libc on Linux. Essentially, a fork of the GNU C library was used on Linux; this released major versions 2 through 5. Version 5 used ELF and was published with a shared library soname of libc.so.5. When version 2 of the GNU C library was released on Linux, it used the shared library soname libc.so.6 to avoid confusion with earlier libraries.

Related libraries use the same suffix. Some architectures use a slightly different suffix; for example, the GNU C library on Alpha and Itanium is libc.so.6.1.

The GNU C library has a strong history of backward compatibility and uses many different mechanisms to support introducing significant changes without breaking old binaries (including versioned symbols). A new soname (libc.so.7) would only be used if a breaking change that couldn’t be mitigated was absolutely required, so it’s unlikely we’ll see one any time soon.

Answered By: Stephen Kitt

It is the ABI (Application Binary Interface) version.

It is only incremented when a breaking change is made, which is now strongly avoided for libc, hence most distributions having been on libc.so.6 for some time.

In general, it allows for multiple incompatible versions of a library to exist on a system at the same time, supporting different applications that were built for the different versions.

For example, Ubuntu 18.04 provided libcurl.so.3 (via package libcurl3) and libcurl.so.4 (via package libcurl4), both built from cURL version 7.58.0.

Answered By: OrangeDog
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.