about summary refs log tree commit diff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 0f284d0a80..a6c1803b34 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <string.h>
+#include <tls.h>
 #include <unistd.h>
 #include <sys/mman.h>
 #include <sys/param.h>
@@ -354,8 +355,12 @@ const char INTUSE(_itoa_lower_digits)[16] attribute_hidden
   = "0123456789abcdef";
 
 
+
 #undef errno
 /* The 'errno' in ld.so is not exported.  */
+#if USE_TLS && HAVE___THREAD
+extern __thread int errno attribute_hidden;
+#else
 extern int errno attribute_hidden;
 
 int *
@@ -363,3 +368,4 @@ __errno_location (void)
 {
   return &errno;
 }
+#endif