about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-12 18:26:13 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-12 18:26:13 +0000
commit22f2067436bbe72233ff0c017d8a40ce65afa1d4 (patch)
tree27635b85ea50a2e6fd032728c5f463f5589d2833
parentaa80bf8661f10949cd507272157d5ebabe8c8d6d (diff)
downloadglibc-22f2067436bbe72233ff0c017d8a40ce65afa1d4.tar.gz
glibc-22f2067436bbe72233ff0c017d8a40ce65afa1d4.tar.xz
glibc-22f2067436bbe72233ff0c017d8a40ce65afa1d4.zip
Update.
2002-12-12  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
	access to __libc_locking_needed for PIC.
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S21
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h1
3 files changed, 27 insertions, 0 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 5b2f6c69d7..377731d80c 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-12  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
+	access to __libc_locking_needed for PIC.
+
 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
 
 	* sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
index 9a124ab0c2..107590974c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
@@ -48,7 +48,13 @@ __lll_lock_wait:
 
 	orl	$-1, %eax	/* Load -1.  */
 #ifndef UP
+# ifdef PIC
+	call	__i686.get_pc_thunk.bx
+	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
+	cmpl	$0, __libc_locking_needed@GOTOFF(%ebx)
+# else
 	cmpl	$0, __libc_locking_needed
+# endif
 	je,pt	0f
 	lock
 0:
@@ -77,7 +83,13 @@ lll_unlock_wake_cb:
 
 	movl	20(%esp), %ebx
 #ifndef UP
+# ifdef PIC
+	call	__i686.get_pc_thunk.bx
+	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
+	cmpl	$0, __libc_locking_needed@GOTOFF(%ebx)
+# else
 	cmpl	$0, __libc_locking_needed
+# endif
 	je,pt	0f
 	lock
 0:
@@ -182,3 +194,12 @@ __lll_timedwait_tid:
 6:	movl	$ETIMEDOUT, %eax
 	jmp	3b
 	.size	__lll_timedwait_tid,.-__lll_timedwait_tid
+
+
+	.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+	.globl __i686.get_pc_thunk.bx
+	.hidden __i686.get_pc_thunk.bx
+	.type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+	movl	(%esp), %ebx
+	ret
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 395121edbb..7bf146e8be 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -94,6 +94,7 @@
 __i686.get_pc_thunk.reg:						      \
   movl (%esp), %e##reg;							      \
   ret;									      \
+  .size __i686.get_pc_thunk.reg, . - __i686.get_pc_thunk.reg;		      \
   .previous;								      \
   call __i686.get_pc_thunk.reg
 # endif