From owner-svn-src-head@FreeBSD.ORG Mon Mar 12 20:24:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EADF310656A6; Mon, 12 Mar 2012 20:24:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C09398FC1C; Mon, 12 Mar 2012 20:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CKOxp4084572; Mon, 12 Mar 2012 20:24:59 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CKOxU0084570; Mon, 12 Mar 2012 20:24:59 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203122024.q2CKOxU0084570@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 12 Mar 2012 20:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232884 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 20:25:00 -0000 Author: gonzo Date: Mon Mar 12 20:24:59 2012 New Revision: 232884 URL: http://svn.freebsd.org/changeset/base/232884 Log: - Although we pass first 4 arguments in registers, function callinf ABI requires space to be reserved for them in stack. _rtld() prologue saves a1 and a2 in this space. - Whitespace cleanup while I'm at it Modified: head/libexec/rtld-elf/mips/rtld_start.S Modified: head/libexec/rtld-elf/mips/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/mips/rtld_start.S Mon Mar 12 19:29:35 2012 (r232883) +++ head/libexec/rtld-elf/mips/rtld_start.S Mon Mar 12 20:24:59 2012 (r232884) @@ -58,28 +58,30 @@ LEAF(rtld_start) PTR_LA a1, 1f bal 1f - PTR_LA t0, _C_LABEL(_rtld_relocate_nonplt_self) + PTR_LA t0, _C_LABEL(_rtld_relocate_nonplt_self) 1: PTR_SUBU a1, ra, a1 /* relocbase */ PTR_LA a0, _DYNAMIC PTR_ADDU t9, a1, t0 jalr t9 /* _rtld_relocate_nonplt_self(dynp, relocabase) */ - PTR_ADDU a0, a1, a0 /* &_DYNAMIC */ + PTR_ADDU a0, a1, a0 /* &_DYNAMIC */ move a0, s0 /* sp */ PTR_ADDU a1, sp, 2*PTR_SIZE /* &our atexit function */ PTR_ADDU a2, sp, 3*PTR_SIZE /* obj_main entry */ + subu sp, 4*SZREG /* ABI requires to reserve memory for 4 regs */ PTR_LA t9, _C_LABEL(_rtld) jalr t9 /* v0 = _rtld(sp, cleanup, objp) */ - nop + nop + addu sp, 4*SZREG PTR_L a1, 2*PTR_SIZE(sp) /* our atexit function */ PTR_L a2, 3*PTR_SIZE(sp) /* obj_main entry */ PTR_ADDU sp, 4*PTR_SIZE /* readjust stack */ move a0, s0 /* stack pointer */ move t9, v0 + subu sp, 4*SZREG /* ABI requires to reserve memory for 4 regs */ jr t9 /* _start(sp, cleanup, obj); */ - move a3, s3 /* restore ps_strings */ - + move a3, s3 /* restore ps_strings */ END(rtld_start) #define XCALLFRAME_SIZ (12*SZREG) @@ -140,7 +142,7 @@ _rtld_bind_start: PTR_LA t9, _C_LABEL(_mips_rtld_bind) jalr t9 - nop + nop move sp, s0 REG_L ra, XCALLFRAME_RA(sp) @@ -159,5 +161,5 @@ _rtld_bind_start: PTR_ADDU sp, XCALLFRAME_SIZ move t9, v0 jr t9 - nop + nop END(_rtld_bind_start)