[PATCH] ldso/libdl: include dl-tls.h for mips static link

Xinglong Liao xinglong.liao at gmail.com
Fri Oct 26 11:12:25 UTC 2012


without this patch, static link with libdl.a in mips will cause
undefined reference error, TLS_DTPREL_VALUE and TLS_TPREL_VALUE
used in function _dl_parse_relocation_information are defined in
dl-tls.h

Signed-off-by: Xinglong Liao <xinglong.liao at gmail.com>
---
 ldso/libdl/libdl.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 8bc3071..981a194 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -49,6 +49,10 @@ extern void _dl_add_to_slotinfo(struct link_map  *l);
  * perhaps RCU for the global structures */
 __UCLIBC_MUTEX_STATIC(_dl_mutex, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
 
+# if defined(USE_TLS) && USE_TLS && defined(__mips__) && !defined(SHARED)
+# include <dl-tls.h>
+#endif
+
 #ifdef SHARED
 # if defined(USE_TLS) && USE_TLS
 # include <dl-tls.h>
-- 
1.7.9.5



More information about the uClibc mailing list