Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine version of glibc (glibcxx) binary will depend on?

It's well known that glibc (and, as far as I know, glibstd++ also) uses symbol versioning mechanism. (For the details refer: How can I link to a specific glibc version.)

The question is how to determine exact versions of GLIBC and GLIBCXX will be chosen by linker for names from libc and libstdc++? For example, how to get something like this:

time -> time@GLIBC_2_5
...
gethostbyname -> gethostbyname@GLIBC_2_3

Why do we need this? It seems to me that it can be useful if you want to minimize required versions of glibc/libstdc++.

like image 446
Shcheklein Avatar asked Aug 08 '10 20:08

Shcheklein


1 Answers

One thing you can try is running objdump -T on your binary.

If you are considering linking to older versions of symbols, be aware that these older versions may depend on older, different structures or other definitions as well. To avoid this, compile and link with older, matching header files and libraries.

like image 120
jilles Avatar answered Nov 09 '22 10:11

jilles