about summary refs log tree commit diff
path: root/sysdeps/unix/i386
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-01-26 02:05:49 +0000
committerRoland McGrath <roland@gnu.org>2005-01-26 02:05:49 +0000
commit70a8119bf0429692aa5ce181c79470ab2f3e3681 (patch)
tree4989572441907b6734364639d4011566f18c49ed /sysdeps/unix/i386
parent792dcd77cdafb46c746119e250a5ba9d20598f8f (diff)
downloadglibc-70a8119bf0429692aa5ce181c79470ab2f3e3681.tar.gz
glibc-70a8119bf0429692aa5ce181c79470ab2f3e3681.tar.xz
glibc-70a8119bf0429692aa5ce181c79470ab2f3e3681.zip
2005-01-23 Roland McGrath <roland@redhat.com>
	* sysdeps/i386/Makefile (defines): If -mno-tls-direct-seg-refs appears
	in $(CFLAGS), add -DNO_TLS_DIRECT_SEG_REFS.
	* sysdeps/unix/sysv/linux/i386/sysdep.h [USE___THREAD]
	(SYSCALL_ERROR_HANDLER) [NO_TLS_DIRECT_SEG_REFS]: Load thread pointer
	from %gs:0 and add to that value, rather that direct %gs:OFFSET access.
	* sysdeps/unix/i386/sysdep.S [NO_TLS_DIRECT_SEG_REFS]: Likewise.
Diffstat (limited to 'sysdeps/unix/i386')
-rw-r--r--sysdeps/unix/i386/sysdep.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/unix/i386/sysdep.S b/sysdeps/unix/i386/sysdep.S
index 6056cbeef2..3bc872add8 100644
--- a/sysdeps/unix/i386/sysdep.S
+++ b/sysdeps/unix/i386/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000, 2002, 2004
+/* Copyright (C) 1991,1992,1993,1994,1995,1996,1997,2000,2002,2004,2005
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -47,7 +47,12 @@ notb:
 #endif
 #ifndef	PIC
 # if USE___THREAD
+#  ifndef NO_TLS_DIRECT_SEG_REFS
 	movl %eax, %gs:C_SYMBOL_NAME(errno@NTPOFF)
+#  else
+	movl %gs:0, %ecx
+	movl %eax, C_SYMBOL_NAME(errno@NTPOFF)(%ecx)
+#  endif
 # elif !defined _LIBC_REENTRANT
 	movl %eax, C_SYMBOL_NAME(errno)
 # else
@@ -66,7 +71,12 @@ notb:
 
 	/* Pop %ebx value saved before jumping here.  */
 	popl %ebx
+#  ifndef NO_TLS_DIRECT_SEG_REFS
+	addl %gs:0, %ecx
+	movl %eax, (%ecx)
+#  else
 	movl %eax, %gs:0(%ecx)
+#  endif
 # elif RTLD_PRIVATE_ERRNO
 	movl %eax, C_SYMBOL_NAME(rtld_errno@GOTOFF)(%ebx)