]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2005-01-23 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@gnu.org>
Wed, 16 Feb 2005 11:07:20 +0000 (11:07 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 16 Feb 2005 11:07:20 +0000 (11:07 +0000)
[BZ #737]
* 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.

sysdeps/i386/Makefile
sysdeps/unix/i386/sysdep.S

index 52faaa31091b4bdafa4bc68f601e868f975dadd9..ece94f361098a761401339ec36f59eac9b776f76 100644 (file)
@@ -61,3 +61,7 @@ CFLAGS-dlopenold.c += -mpreferred-stack-boundary=4
 CFLAGS-dlclose.c += -mpreferred-stack-boundary=4
 CFLAGS-dlerror.c += -mpreferred-stack-boundary=4
 endif
+
+ifneq (,$(filter -mno-tls-direct-seg-refs,$(CFLAGS)))
+defines += -DNO_TLS_DIRECT_SEG_REFS
+endif
index 6056cbeef2784e5831b5b1a2561eef94b0331779..83ce3eadecb8ae87446642a0e0ba1815f80075ee 100644 (file)
@@ -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)