about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/sysdep.h
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/sysv/linux/i386/sysdep.h
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/sysv/linux/i386/sysdep.h')
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index af75d4c51a..02a35dc129 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992,1993,1995-2000,2002,2003,2004
-   Free Software Foundation, Inc.
+/* Copyright (C) 1992,1993,1995,1996,1997,1998,1999,2000,2002,2003,2004,2005
+   	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
 
@@ -154,9 +154,17 @@ __i686.get_pc_thunk.reg:						      \
   movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx;			      \
   xorl %edx, %edx;							      \
   subl %eax, %edx;							      \
-  movl %edx, %gs:0(%ecx);						      \
+  SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx);				      \
   orl $-1, %eax;							      \
   jmp L(pseudo_end);
+#   ifndef NO_TLS_DIRECT_SEG_REFS
+#    define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+  movl src, %gs:0(destoff)
+#   else
+#    define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+  addl %gs:0, destoff;							      \
+  movl src, (destoff)
+#   endif
 #  else
 #   define SYSCALL_ERROR_HANDLER					      \
 0:pushl %ebx;								      \