]> sourceware.org Git - glibc.git/commitdiff
* sysdeps/unix/sysv/linux/x86_64/sysdep.h
authorRoland McGrath <roland@gnu.org>
Mon, 30 Sep 2002 07:26:12 +0000 (07:26 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 30 Sep 2002 07:26:12 +0000 (07:26 +0000)
[USE_TLS && HAVE___THREAD] (SYSCALL_ERROR_HANDLER): Use TLS access.

ChangeLog
sysdeps/unix/sysv/linux/x86_64/sysdep.h

index d4e56e1235539cf022f45c8669cd364a71b31fff..d9e7432974fc2e8b51cf7eb1327e23d1bbbd3d57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2002-09-30  Roland McGrath  <roland@redhat.com>
 
+       * sysdeps/unix/sysv/linux/x86_64/sysdep.h
+       [USE_TLS && HAVE___THREAD] (SYSCALL_ERROR_HANDLER): Use TLS access.
+
        * rt/tst-aio7.c (do_test): Don't read from stdin, which could be the
        terminal when the test is running in a background job.  Instead, make
        a pipe and read from its read half while never writing anything to it.
index 53dbe8143f3dd2a032cdae45eb4a0a43d8602db7..5588b4606ef9bd33e93fd427c7d9eb34638e7464 100644 (file)
 
 #ifndef PIC
 #define SYSCALL_ERROR_HANDLER  /* Nothing here; code in sysdep.S is used.  */
-#else
-/* Store (- %rax) into errno through the GOT.  Note that errno occupies 4 bytes.  */
-#ifdef _LIBC_REENTRANT
-#define SYSCALL_ERROR_HANDLER                  \
+#elif USE_TLS && HAVE___THREAD
+# define SYSCALL_ERROR_HANDLER                 \
+  movq errno@GOTTPOFF(%rip), %rcx;             \
+  xorq %rdx, %rdx;                             \
+  subq %rax, %rdx;                             \
+  movl %eax, %fs:0(%rcx)
+#elif defined _LIBC_REENTRANT
+/* Store (- %rax) into errno through the GOT.
+   Note that errno occupies only 4 bytes.  */
+# define SYSCALL_ERROR_HANDLER                 \
 0:                                             \
   xorq %rdx, %rdx;                             \
   subq %rax, %rdx;                             \
 
 /* A quick note: it is assumed that the call to `__errno_location' does
    not modify the stack!  */
-#else
-#define SYSCALL_ERROR_HANDLER                  \
+#else /* Not _LIBC_REENTRANT.  */
+# define SYSCALL_ERROR_HANDLER                 \
 0:movq errno@GOTPCREL(%RIP), %rcx;             \
   xorq %rdx, %rdx;                             \
   subq %rax, %rdx;                             \
   movl %edx, (%rcx);                           \
   orq $-1, %rax;                               \
   jmp L(pseudo_end);
-#endif /* _LIBC_REENTRANT */
 #endif /* PIC */
 
 /* Linux/x86-64 takes system call arguments in registers:
This page took 0.050858 seconds and 5 git commands to generate.