about summary refs log tree commit diff
path: root/sysdeps/unix/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/x86_64')
-rw-r--r--sysdeps/unix/x86_64/sysdep.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/unix/x86_64/sysdep.S b/sysdeps/unix/x86_64/sysdep.S
index a54c151013..b0580a39ae 100644
--- a/sysdeps/unix/x86_64/sysdep.S
+++ b/sysdeps/unix/x86_64/sysdep.S
@@ -42,8 +42,12 @@ syscall_error:
 notb:
 #endif
 #if USE_TLS && HAVE___THREAD
-	movq C_SYMBOL_NAME(errno)@GOTTPOFF(%rip), %rcx
+# ifdef PIC
+	movq C_SYMBOL_NAME(errno@GOTTPOFF)(%rip), %rcx
 	movl %eax, %fs:0(%rcx)
+# else
+	movl %eax, %fs:C_SYMBOL_NAME(errno@TPOFF)
+# endif
 #elif !defined PIC
 # ifndef _LIBC_REENTRANT
 	movl %eax, C_SYMBOL_NAME(errno)