Date: Wed, 3 Feb 2010 12:59:44 +0000 (UTC) From: Randall Stewart <rrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r203428 - head/lib/libc/mips/sys Message-ID: <201002031259.o13CxiK0000458@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rrs Date: Wed Feb 3 12:59:44 2010 New Revision: 203428 URL: http://svn.freebsd.org/changeset/base/203428 Log: This fixes a bug found and fixed by JC. Basically no save was being done of the ra and gp pointers before we call the __error function. Obtained from: JC (c.jayachandran@gmail.com) Modified: head/lib/libc/mips/sys/ptrace.S Modified: head/lib/libc/mips/sys/ptrace.S ============================================================================== --- head/lib/libc/mips/sys/ptrace.S Wed Feb 3 12:35:42 2010 (r203427) +++ head/lib/libc/mips/sys/ptrace.S Wed Feb 3 12:59:44 2010 (r203428) @@ -42,14 +42,26 @@ __FBSDID("$FreeBSD$"); #endif /* LIBC_SCCS and not lint */ LEAF(ptrace) + .frame sp,40,ra + .mask 0x80000000, -8 #ifdef __ABICALLS__ .set noreorder .cpload t9 .set reorder #endif + subu sp, sp, 40 + sw ra, 32(sp) +#ifdef __ABICALLS__ + .cprestore 16 +#endif la t9, _C_LABEL(__error) # locate address of errno - jalr t9 + jalr t9 +#ifdef __ABICALLS__ + lw gp, 16(sp) +#endif sw zero, 0(v0) + lw ra, 32(sp) + addu sp, sp, 40 li v0, SYS_ptrace syscall bne a3, zero, 1f
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002031259.o13CxiK0000458>