Date: Thu, 4 Feb 2010 05:49:59 +0000 (UTC) From: Neel Natu <neel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r203475 - head/lib/libc/mips/sys Message-ID: <201002040549.o145nxvd025866@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: neel Date: Thu Feb 4 05:49:59 2010 New Revision: 203475 URL: http://svn.freebsd.org/changeset/base/203475 Log: 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 Modified: head/lib/libc/mips/sys/ptrace.S Modified: head/lib/libc/mips/sys/ptrace.S ============================================================================== --- head/lib/libc/mips/sys/ptrace.S Thu Feb 4 05:25:59 2010 (r203474) +++ head/lib/libc/mips/sys/ptrace.S Thu Feb 4 05:49:59 2010 (r203475) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002040549.o145nxvd025866>