Question regarding __clock_gettime symbol visibility across glibc build

Joseph Myers joseph@codesourcery.com
Mon Mar 23 21:57:52 GMT 2020


On Sat, 21 Mar 2020, Lukasz Majewski wrote:

> > /work/lukma/glibc/glibc-many-build/src/glibc/malloc/memusage.c:181:
> > undefined reference to `__clock_gettime64'

I.e. __clock_gettime64 is not exported at any symbol version in the 
dynamic symbol table of libc.so.

Any symbol defined in libc.so and used in another glibc shared library or 
executable needs to be exported at some symbol version in some Versions 
file.  In the case of symbols for 64-bit time, it should be exported at 
version GLIBC_PRIVATE until we're ready to support _TIME_BITS=64 in the 
headers, at which point all such symbols should be exported at the version 
of the next glibc release and be removed from GLIBC_PRIVATE if there.

> > nm
> > ./work/glibc/glibc-many-build/build/glibcs/arm-linux-gnueabi/glibc/libc.so
> > | grep clock_gettime

nm uses the static symbol table by default.  You need nm -D, objdump -T 
(shows symbol versions as well) or readelf --dyn-syms to look at the 
dynamic symbol table.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-help mailing list