Timo Teräs wrote:
The attribute_hidden is added to all forward stubs, to avoid self recursion. If libc and libpthread linking order is reversed, the libc
stub would end up being used in the libpthread side struct
pthread_functions. Apparently glibc side is doing linker magic to
avoid this. I don't think it really makes sense for libc to export
pthreads symbols, so I'm using attribute_hidden there. Alternatively
we could use protected visibility on libpthread side to make sure
it's using it's own symbols.
diff --git a/libpthread/nptl/forward.c b/libpthread/nptl/forward.c
index 8f528d0..e9a2a0b 100644
--- a/libpthread/nptl/forward.c
+++ b/libpthread/nptl/forward.c
@@ -32,6 +32,7 @@ int __libc_pthread_functions_init attribute_hidden;


#define FORWARD2(name, rettype, decl, params, defaction) \
+rettype name decl attribute_hidden;                          \
rettype                                          \
name decl                                      \
{                                          \

We can't really do this part. Turns out that some wacko libraries
such as libX11 test if libc has pthread_self and do funny stuff it
it doesn't.

The really proper thing is to go libpthread symbol by symbol and
hide the non-exported ones. Glibc does this with linker version-script.
Not sure if we want to do the same, or sprinkle hidden/protected
definitions around the place.

- Timo
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to