about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-lookup.c1
-rw-r--r--elf/do-lookup.h11
2 files changed, 9 insertions, 3 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 8de301eaa8..521f032b2b 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -26,6 +26,7 @@
 #include "dl-hash.h"
 #include <dl-machine.h>
 #include <bits/libc-lock.h>
+#include <tls.h>
 
 #include <assert.h>
 
diff --git a/elf/do-lookup.h b/elf/do-lookup.h
index c316159fe1..cebc2ce300 100644
--- a/elf/do-lookup.h
+++ b/elf/do-lookup.h
@@ -83,9 +83,14 @@ FCT (const char *undef_name, unsigned long int hash, const ElfW(Sym) *ref,
 	      (type_class & (sym->st_shndx == SHN_UNDEF)))
 	    continue;
 
-	  if (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC)
-	    /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC entries
-	       since these are no code/data definitions.  */
+	  if (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC
+#ifdef USE_TLS
+	      && ELFW(ST_TYPE) (sym->st_info) != STT_TLS
+#endif
+	      )
+	    /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC
+	       entries (and STT_TLS if TLS is supported) since these
+	       are no code/data definitions.  */
 	    continue;
 
 	  if (sym != ref && strcmp (strtab + sym->st_name, undef_name))