If I run this in Docker's ubuntu:latest
:
root@4304dfbfa661:/# ls lib/x86_64-linux-gnu/libc* -l
-rwxr-xr-x 1 root root 1868984 Jan 15 02:51 lib/x86_64-linux-gnu/libc-2.23.so
lrwxrwxrwx 1 root root 12 Jan 15 02:51 lib/x86_64-linux-gnu/libc.so.6 -> libc-2.23.so
It seems that libc
is numbered as both 6 and 2-23. Why are there two version numbers?
NB libc
is (idiosyncratically) executable and running it gives
root@4304dfbfa661:/# ./lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.23-0ubuntu10) stable release version 2.23, by Roland McGrath et al.
So it's the libc.so.6
that's surprising. Does libc
[or to be precise, glibc
] have sonames that are unrelated to the version numbers?
Edit: to clarify, I understand the symlink. What confuses me is the existence of two numbering schemes. If you look at e.g. libstdc++, you find
lrwxrwxrwx 1 root root 19 Sep 11 2017 ./usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.19
-rwxr-xr-x 1 root root 995840 Aug 1 2017 ./usr/lib64/libstdc++.so.6.0.19
Having foo.so.6
as a symlink to foo.so.6.0.19
makes sense. Having foo.so.6
as a symlink to foo-2.23.so
is confusing...