summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorskrll <skrll@NetBSD.org>2006-01-04 12:43:43 +0000
committerskrll <skrll@NetBSD.org>2006-01-04 12:43:43 +0000
commit73b7bdcee7d0875bd4f920cc9763743780aa4d36 (patch)
tree156c94f7691a38ff8f15500717768398c8e6563e /lib/libpthread
parent42f41cb7073885399cb46231ce30de440a66606c (diff)
A couple of fixes to make libpthread really shared, i.e. not have text re-
locations: - Don't declare pthread__switch_away global - Do the PIC dance for pthread__switch_return_point and pthread__locked_switch. Ideally these (and other) symbols would be hidden. Thanks to uwe@, dyoung@ and elad@ for help. XXX sh3 is still to be done. XXX vax does strange things.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/arch/i386/pthread_switch.S3
-rw-r--r--lib/libpthread/arch/sparc/pthread_switch.S4
-rw-r--r--lib/libpthread/arch/sparc64/pthread_switch.S4
-rw-r--r--lib/libpthread/arch/x86_64/pthread_switch.S11
4 files changed, 14 insertions, 8 deletions
diff --git a/lib/libpthread/arch/i386/pthread_switch.S b/lib/libpthread/arch/i386/pthread_switch.S
index 0edf27450b7..9aa674f4383 100644
--- a/lib/libpthread/arch/i386/pthread_switch.S
+++ b/lib/libpthread/arch/i386/pthread_switch.S
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_switch.S,v 1.8 2004/04/23 02:58:27 simonb Exp $ */
+/* $NetBSD: pthread_switch.S,v 1.9 2006/01/04 12:43:43 skrll Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -168,7 +168,6 @@ NENTRY(pthread__switch_return_point)
* Helper switch code used by pthread__locked_switch() and
* pthread__upcall_switch() when they discover spinlock preemption.
*/
-.globl pthread__switch_away
pthread__switch_away:
STACK_SWITCH
diff --git a/lib/libpthread/arch/sparc/pthread_switch.S b/lib/libpthread/arch/sparc/pthread_switch.S
index bad64e280a0..8ce4c8dd175 100644
--- a/lib/libpthread/arch/sparc/pthread_switch.S
+++ b/lib/libpthread/arch/sparc/pthread_switch.S
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_switch.S,v 1.7 2003/09/07 14:47:54 cl Exp $ */
+/* $NetBSD: pthread_switch.S,v 1.8 2006/01/04 12:43:43 skrll Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -122,7 +122,7 @@ ENTRY_NOPROFILE(pthread__switch_return_point)
* %i2 flag to clear lock
*/
-ENTRY(pthread__switch_away)
+pthread__switch_away:
STACK_SWITCH(%i1, %l2)
diff --git a/lib/libpthread/arch/sparc64/pthread_switch.S b/lib/libpthread/arch/sparc64/pthread_switch.S
index 616d406c783..ac40ef8f90d 100644
--- a/lib/libpthread/arch/sparc64/pthread_switch.S
+++ b/lib/libpthread/arch/sparc64/pthread_switch.S
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_switch.S,v 1.8 2003/09/07 14:47:55 cl Exp $ */
+/* $NetBSD: pthread_switch.S,v 1.9 2006/01/04 12:43:43 skrll Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@ ENTRY_NOPROFILE(pthread__switch_return_point)
* %i2 flag to clear lock
*/
-ENTRY(pthread__switch_away)
+pthread__switch_away:
STACK_SWITCH(%i1,%l2)
diff --git a/lib/libpthread/arch/x86_64/pthread_switch.S b/lib/libpthread/arch/x86_64/pthread_switch.S
index 6e9c0864f53..da96a786c6e 100644
--- a/lib/libpthread/arch/x86_64/pthread_switch.S
+++ b/lib/libpthread/arch/x86_64/pthread_switch.S
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_switch.S,v 1.10 2004/04/23 02:58:27 simonb Exp $ */
+/* $NetBSD: pthread_switch.S,v 1.11 2006/01/04 12:43:43 skrll Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -136,7 +136,11 @@ ENTRY(pthread__switch)
* Edit the context so that it continues as if returning from
* the _setcontext_u below.
*/
+#ifdef PIC
+ movq PIC_GOT(pthread__switch_return_point), %r15
+#else
leaq pthread__switch_return_point(%rip), %r15
+#endif
movq %r15, UC_RIP(%r14)
movq %r14, PT_UC(%r12)
@@ -157,7 +161,6 @@ NENTRY(pthread__switch_return_point)
* Helper switch code used by pthread__locked_switch() and
* pthread__upcall_switch() when they discover spinlock preemption.
*/
-.globl pthread__switch_away
pthread__switch_away:
STACK_SWITCH
@@ -204,7 +207,11 @@ ENTRY(pthread__locked_switch)
* Edit the context so that it continues as if returning from
* the _setcontext_u below.
*/
+#ifdef PIC
+ movq PIC_GOT(locked_return_point), %r15
+#else
leaq locked_return_point(%rip), %r15
+#endif
movq %r15, UC_RIP(%r14)
movq %r14, PT_UC(%r12)