From 177d1ad3ac9aab9b8ae7e7f70c2c66b6bdb876ee Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 12 Apr 2003 20:32:01 +0000 Subject: Update. 2003-04-12 Ulrich Drepper * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug which mishandles loading of global object addresses in PIC. (THREAD_SETMEM_NC): Likewise. --- nptl/Banner | 2 +- nptl/ChangeLog | 6 ++++++ nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h | 8 ++++---- nptl/sysdeps/x86_64/tls.h | 17 +++++++++++++---- 4 files changed, 24 insertions(+), 9 deletions(-) (limited to 'nptl') diff --git a/nptl/Banner b/nptl/Banner index 288d93d..28d8ef6 100644 --- a/nptl/Banner +++ b/nptl/Banner @@ -1 +1 @@ -NPTL 0.34 by Ulrich Drepper +NPTL 0.35 by Ulrich Drepper diff --git a/nptl/ChangeLog b/nptl/ChangeLog index d40118b..d6aa004 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,9 @@ +2003-04-12 Ulrich Drepper + + * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug + which mishandles loading of global object addresses in PIC. + (THREAD_SETMEM_NC): Likewise. + 2003-04-11 Ulrich Drepper * pthread.h: Define new data structure for cleanup buffer. Declare diff --git a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h index b7009d7..09a294b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -105,7 +105,7 @@ cancellation state value is saved. */ # define EH_FRAME_0(name) \ .byte 4; \ - .long L(PUSHSTATE)-name; \ + .long L(PUSHSTATE)-L(name##START); \ .byte 14; \ .uleb128 8; \ .byte 4; \ @@ -122,7 +122,7 @@ also to save the content of the %ebx register. */ # define EH_FRAME_3(name) \ .byte 4; \ - .long L(PUSHBX1)-name; \ + .long L(PUSHBX1)-L(name##START); \ .byte 14; \ .uleb128 8; \ .byte 4; \ @@ -149,7 +149,7 @@ /* With four parameters the syscall wrappers have to save %ebx and %esi. */ # define EH_FRAME_4(name) \ .byte 4; \ - .long L(PUSHSI1)-name; \ + .long L(PUSHSI1)-L(name##START); \ .byte 14; \ .uleb128 8; \ .byte 4; \ @@ -193,7 +193,7 @@ and %edi. */ # define EH_FRAME_5(name) \ .byte 4; \ - .long L(PUSHDI1)-name; \ + .long L(PUSHDI1)-L(name##START); \ .byte 14; \ .uleb128 8; \ .byte 4; \ diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h index dec1b5d..975d20f 100644 --- a/nptl/sysdeps/x86_64/tls.h +++ b/nptl/sysdeps/x86_64/tls.h @@ -204,6 +204,15 @@ typedef struct __value; }) +/* Loading addresses of objects on x86-64 needs to be treated special + when generating PIC code. */ +#ifdef __pic__ +# define IMM_MODE "nr" +#else +# define IMM_MODE "ir" +#endif + + /* Same as THREAD_SETMEM, but the member offset can be non-constant. */ # define THREAD_SETMEM(descr, member, value) \ ({ if (sizeof (descr->member) == 1) \ @@ -212,7 +221,7 @@ typedef struct "i" (offsetof (struct pthread, member))); \ else if (sizeof (descr->member) == 4) \ asm volatile ("movl %0,%%fs:%P1" : \ - : "ir" (value), \ + : IMM_MODE (value), \ "i" (offsetof (struct pthread, member))); \ else \ { \ @@ -222,7 +231,7 @@ typedef struct abort (); \ \ asm volatile ("movq %q0,%%fs:%P1" : \ - : "ir" ((unsigned long int) value), \ + : IMM_MODE ((unsigned long int) value), \ "i" (offsetof (struct pthread, member))); \ }}) @@ -236,7 +245,7 @@ typedef struct "r" (idx)); \ else if (sizeof (descr->member[0]) == 4) \ asm volatile ("movl %0,%%fs:%P1(,%q2,4)" : \ - : "ir" (value), \ + : IMM_MODE (value), \ "i" (offsetof (struct pthread, member[0])), \ "r" (idx)); \ else \ @@ -247,7 +256,7 @@ typedef struct abort (); \ \ asm volatile ("movq %q0,%%fs:%P1(,%q2,8)" : \ - : "r" ((unsigned long int) value), \ + : IMM_MODE ((unsigned long int) value), \ "i" (offsetof (struct pthread, member[0])), \ "r" (idx)); \ }}) -- cgit v1.1