Weak references, --as-needed, and pthreads

Florian Weimer fweimer@redhat.com
Wed Jun 13 14:48:00 GMT 2018


On 06/13/2018 03:21 AM, Cary Coutant wrote:
> (7) When ld.so binds a symbol with no version information, it does not
> bind to the default version; instead it binds to the older version
> (not sure if that's by chance or it it deliberately picks the first or
> oldest version).

In general, it really must pick the base version for the symbol because 
the binary could have been produced before symbol versioning was 
introduced for this particular library.

In particular, a reference (weak or strong) to any glibc symbol really 
must have an attached symbol version, especially if a weak function 
symbol is actually used to call the function, otherwise the binary is 
invalid and might fail to work with any future glibc update.

Thanks,
Florian



More information about the Binutils mailing list