Red Hat Bugzilla – Bug 97528
unresolved symbol pthread_once
Last modified: 2016-11-24 10:03:34 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020830
Description of problem:
The weak aliases for the pthread functions
are missing in /lib/tls/libc-2.3.2.so.
Note, that they are available in /lib/libc-2.3.2.so.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. nm /lib/tls/libc-2.3.2.so | grep pthread_once
Actual Results: Noting shows here
Expected Results: w __pthread_once
I found this while fixing nss_ldap's recursiv gethostbyname bug. For that I need
thread local storage and used the posix standard thread library which is
available even if gcc's tls extention is not. When booting vanilla 2.4.21
without the redhat paches to the kernel everything works fine. But if I use the
redhat shipped Kernel tls libraries are used and libnss_ldap does not load due
to unresolved symbols from the pthread library.
They are not available in /lib/libc-2.3.2.so either (that w __pthread_once
is weak undefined symbol to __pthread_once) and never has been.
If you need those symbols, you need to link with -lpthread.
If you need to use it conditionally, you need to make them weak externs in
your library (e.g. through #pragma weak pthread_once etc.) and first test
if those symbols are actually available.