From owner-freebsd-mips@FreeBSD.ORG Mon May 30 16:33:04 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1C21065675; Mon, 30 May 2011 16:33:04 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id 16D3B8FC12; Mon, 30 May 2011 16:33:03 +0000 (UTC) Received: by pxi6 with SMTP id 6so2295932pxi.17 for ; Mon, 30 May 2011 09:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=yxqgvscOJYx+b83AL3My6Rx16nltsx5kNBkWX9NDxSk=; b=e3JRW16ZZdC9j7Mxe1bOZgSMUAwuWdwut3T+ZO34PitrL53qL5BBXvmq2Y9gBXGQT1 W20vvo+LBryJWJYvmPiugQiGp3soaJt3GWn8pjwpM0F+edA6FNcLX0Oi54xJe5qk/sDy nziym4n1pMj5DaCyS9sqGTlJFhbQDwzrvTEEE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MbhjzXj66yVbmlfq+6d0iHnNyVwRj0v7lyL7jQeaedxeuLlEDbWpntrYDolgH3Qc5D cuVJ5D6VH9B9XplwDBFddPeca1zEDdyhdn6UPeRvvShXKYVbhMke+Eqh17mzH76i0AaU M3TMuqzd2uVLWThx1Jq0qWW7FQYx+7oH45uAc= MIME-Version: 1.0 Received: by 10.142.3.39 with SMTP id 39mr788851wfc.138.1306773183500; Mon, 30 May 2011 09:33:03 -0700 (PDT) Received: by 10.142.231.16 with HTTP; Mon, 30 May 2011 09:33:03 -0700 (PDT) In-Reply-To: <4DD41715.2050203@freebsd.org> References: <4DD31231.5010000@freebsd.org> <4DD41715.2050203@freebsd.org> Date: Mon, 30 May 2011 22:03:03 +0530 Message-ID: From: "Jayachandran C." To: Oleksandr Tymoshenko Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-mips@freebsd.org" Subject: Re: Trouble with dynamic executables X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2011 16:33:04 -0000 On Thu, May 19, 2011 at 12:29 AM, Oleksandr Tymoshenko wrote: > On 18/05/2011 5:59 AM, Andrew Duane wrote: >> >> Thanks! I will try this patch out as soon as I get a chance. I had to >> repurpose my boot disk, but I can get it back today. >> > Not really. It can be =A0multiline. Though it's the only place > where this variable is used and I'm not completely sure > it's really required there. As a workaround it worked for me, > but proper fix will require more svn history digging. I did some digging on this, and your patch looks like the right way to go. Here's what I got: INITIAL_READONLY_SECTIONS had only the .reginfo or .MIPS.options entry. n32 was updated to use .reginfo in elf32bmipn32-defs.sh, and then elf64bmip-defs.sh added to override to use .MIPS.options for n64. (see http://sourceware.org/ml/binutils/2006-10/msg00111.html) But when a further update happened, INITIAL_READONLY_SECTIONS was expanded to include the '.interp' section in elf32bmipn32-defs.sh. But it looks like elf64bmip-defs.sh was not updated in the same way. ( see http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/emulparams/elf32bmipn= 32-defs.sh.diff?r1=3D1.11&r2=3D1.12&cvsroot=3Dsrc&f=3Dh http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/emulparams/elf64bmip-defs.s= h.diff?r1=3D1.2&r2=3D1.3&cvsroot=3Dsrc&f=3Dh ) The only change I'd make is to add ${RELOCATING-0} part that is missing from your patch which seems to be the new style. My take on the same patch would be: Index: contrib/binutils/ld/emulparams/elf64bmip-defs.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- contrib/binutils/ld/emulparams/elf64bmip-defs.sh (revision 222445) +++ contrib/binutils/ld/emulparams/elf64bmip-defs.sh (working copy) @@ -1,3 +1,12 @@ . ${srcdir}/emulparams/elf32bmipn32-defs.sh COMMONPAGESIZE=3D"CONSTANT (COMMONPAGESIZE)" -INITIAL_READONLY_SECTIONS=3D".MIPS.options : { *(.MIPS.options) }" + +# elf32bmipn32-defs.sh use .reginfo now, n64 ABI should use .MIPS.options +# Override INITIAL_READONLY_SECTIONS to have .MIPS.options instead +# of .reginfo +INITIAL_READONLY_SECTIONS=3D +if test -z "${CREATE_SHLIB}"; then + INITIAL_READONLY_SECTIONS=3D".interp ${RELOCATING-0} : { *(.interp= ) }" +fi +INITIAL_READONLY_SECTIONS=3D"${INITIAL_READONLY_SECTIONS} + .MIPS.options ${RELOCATING-0} : { *(.MIPS.options) }" --=20 Let me know if you plan to check in your changes (you can add a reviewed by me if you like), otherwise I can check in the changes above. JC.