Hi All,
while compiling uClibc++ against uClibc-nptl, I found a problem
into the linker script libc.so.
The uClibc++ needs the __tls_get_addr symbol (TLS enabled), but it cannot find
it because the dynamic linker is not present into the linker script libc.so.
In the same way, a lot of applications using TLS dynamic access model will fail
linking with uclibc-nptl

This patch solves this issues defining into Rules.mak the ASNEEDED variables
only for the NPTL case.

It could be worth to add it both into trunk and nptl branch

Regards,
Carmelo
This patch fixes the link script libc.so adding an AS_NEEDED
entry for the dynamic linker. This is required at least to 
resolve the __tls_get_addr symbol used in TLS dynamic access model.

Signed-off-by: Carmelo Amoroso <[EMAIL PROTECTED]>

--- uClibc-trunk/Rules.mak      2007-08-03 09:45:44.785193000 +0200
+++ uClibc-trunk-st/Rules.mak   2007-08-03 09:47:47.285769000 +0200
@@ -333,6 +333,14 @@ export LDPIEFLAG:=$(shell $(LD) --help 2
 endif
 endif
 
+# For NPTL we need to add the dynamic linker into the
+# libc.so linker script. Required to provide __tls_get_addr
+# symbol when usign TLS dynamic access model
+
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+ASNEEDED:=AS_NEEDED ( $(UCLIBC_LDSO) )
+endif
+
 # Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)
 ifndef ASNEEDED
 ifneq ($(UCLIBC_HAS_SSP),y)
_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to