summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2010-02-04 05:49:59 +0000
committerneel <neel@FreeBSD.org>2010-02-04 05:49:59 +0000
commit3e324aa4815e11695da086b862302f3aea9ea7c1 (patch)
treeb17b5a55b653f1bae7118bc3f4e0911ddf789c22 /lib
parent61210c7a07793536b2b947b74140da7ff00affda (diff)
downloadFreeBSD-src-3e324aa4815e11695da086b862302f3aea9ea7c1.zip
FreeBSD-src-3e324aa4815e11695da086b862302f3aea9ea7c1.tar.gz
Reinstate the ptrace patch to restore the 'gp' register after calling
a function. I made a mistake in assuming that the .cprestore directive will cause the assembler to automatically restore 'gp' after the 'jalr'. The .cprestore directive does its magic only after 'jal' and 'bal' instructions - not the 'jalr'. Pointed out by: c.jayachandran@gmail.com
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/mips/sys/ptrace.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/mips/sys/ptrace.S b/lib/libc/mips/sys/ptrace.S
index 9be54a5..09b82c5 100644
--- a/lib/libc/mips/sys/ptrace.S
+++ b/lib/libc/mips/sys/ptrace.S
@@ -56,6 +56,9 @@ LEAF(ptrace)
#endif
la t9, _C_LABEL(__error) # locate address of errno
jalr t9
+#ifdef __ABICALLS__
+ lw gp, 16(sp)
+#endif
sw zero, 0(v0)
lw ra, 32(sp)
addu sp, sp, 40
OpenPOWER on IntegriCloud