summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-07-07 15:46:57 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-07-07 15:46:57 +0000
commitb02fc5682a1097e56ead83dc8a75204e2c4c0dd2 (patch)
treeb59005e3b3890a01612573746986d96792e3e3e8
parentbf11d4b1e854c91b9d7c00da7123ca8fe380216c (diff)
On hppa, function pointers may be be pointers to PLT entries. Handle those
by replicating part of $$dyncall in the code that sets up a thread's initial stack frame. Also make sure we actually reserve some space for that initial stack frame. ok miod@
-rw-r--r--lib/libpthread/arch/hppa/uthread_machdep_asm.S13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libpthread/arch/hppa/uthread_machdep_asm.S b/lib/libpthread/arch/hppa/uthread_machdep_asm.S
index 875ceb11dd9..fe476df338d 100644
--- a/lib/libpthread/arch/hppa/uthread_machdep_asm.S
+++ b/lib/libpthread/arch/hppa/uthread_machdep_asm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_machdep_asm.S,v 1.2 2003/01/16 19:16:02 mickey Exp $ */
+/* $OpenBSD: uthread_machdep_asm.S,v 1.3 2007/07/07 15:46:56 kettenis Exp $ */
/* Michael Shalayeff <mickey@openbsd.org>. Public Domain. */
#include <machine/asm.h>
@@ -17,9 +17,18 @@
ENTRY(_thread_machdep_init,FRAMESIZE)
ldo 7(arg1), arg1
dep r0, 31, 3, arg1
+ ldo HPPA_FRAME_SIZE(arg1), arg1
ldo FRAMESIZE(arg1), t1
stw t1, 0(arg0)
stw arg1, 4(arg0)
+
+ bb,>=,n arg3, 30, _thread$noplabel
+ depi 0, 31, 2, arg3
+ ldw 4(arg3), t1
+ ldw 0(arg3), arg3
+ stw t1, 0x44(arg1)
+
+_thread$noplabel
bv r0(rp)
stw arg3, 0(arg1)
EXIT(_thread_machdep_init)
@@ -50,6 +59,7 @@ ENTRY(_thread_machdep_switch,0)
stw r16, 0x38(t1)
stw r17, 0x3c(t1)
stw r18, 0x40(t1)
+ stw r19, 0x44(t1)
ldw 0(arg0), sp
ldw 4(arg0), t1
@@ -70,6 +80,7 @@ ENTRY(_thread_machdep_switch,0)
ldw 0x38(t1), r16
ldw 0x3c(t1), r17
ldw 0x40(t1), r18
+ ldw 0x44(t1), r19
bv r0(rp)
ldo -FRAMESIZE(sp), sp
EXIT(_thread_machdep_switch)