From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14150 invoked by alias); 22 Jan 2005 18:16:06 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 14129 invoked from network); 22 Jan 2005 18:16:01 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 22 Jan 2005 18:16:01 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0MIG1Yd009084 for ; Sat, 22 Jan 2005 13:16:01 -0500 Received: from localhost (mail@vpn50-41.rdu.redhat.com [172.16.50.41]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0MIG0O22097 for ; Sat, 22 Jan 2005 13:16:00 -0500 Received: from rsandifo by localhost with local (Exim 3.35 #1) id 1CsPnj-0006tC-00 for binutils@sources.redhat.com; Sat, 22 Jan 2005 18:15:59 +0000 To: binutils@sources.redhat.com Subject: Re: RFA: elf.sc patch References: <87hdo2111f.fsf@redhat.com> <20041107224825.GH21740@bubble.modra.org> <20041108011636.GA21482@nevyn.them.org> <20041108025455.GI21740@bubble.modra.org> <87r7mxa0rw.fsf@redhat.com> <87sm4td9ru.fsf_-_@redhat.com> <20050122133159.GA2793@bubble.modra.org> From: Richard Sandiford Date: Sat, 22 Jan 2005 18:16:00 -0000 In-Reply-To: <20050122133159.GA2793@bubble.modra.org> (Alan Modra's message of "Sun, 23 Jan 2005 00:01:59 +1030") Message-ID: <87651pwcrk.fsf@redhat.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-01/txt/msg00356.txt.bz2 Alan Modra writes: > On Sat, Jan 22, 2005 at 10:43:17AM +0000, Richard Sandiford wrote: >> * scripttempl/elf.sc: Insert ". = .;" before OTHER_GOT_SYMBOLS. > > I'd prefer you do this by modifying OTHER_GOT_SYMBOLS in elf32bmip.sh > and elf32bmipn32-defs.sh, perhaps with a comment. OTHER_GOT_SYMBOLS > may not always be used to only define symbols, and placing ".=.;" in the > source close to where you assign a symbol value might clue future > hackers to guard other random symbol assignments. Also, four other > scripts use OTHER_GOT_SYMBOLS, so if you change elf.sc you really ought > to change them too. Patch to emulparams/* preapproved. OK, thanks, here's what I checked in. Richard * emulparams/elf32bmip.sh (OTHER_GOT_SECTIONS): Add ". = .;". * emulparams/elf32bmipn32-defs.sh (OTHER_GOT_SECTIONS): Likewise. Index: ld/emulparams/elf32bmip.sh =================================================================== RCS file: /cvs/src/src/ld/emulparams/elf32bmip.sh,v retrieving revision 1.6 diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.6 elf32bmip.sh *** ld/emulparams/elf32bmip.sh 21 Apr 2004 20:52:28 -0000 1.6 --- ld/emulparams/elf32bmip.sh 22 Jan 2005 18:08:18 -0000 *************** INITIAL_READONLY_SECTIONS=" *** 16,22 **** --- 16,27 ---- .reginfo ${RELOCATING-0} : { *(.reginfo) } " OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' + # If the output has a GOT section, there must be exactly 0x7ff0 bytes + # between .got and _gp. The ". = ." below stops the orphan code from + # inserting other sections between the assignment to _gp and the start + # of .got. OTHER_GOT_SYMBOLS=' + . = .; _gp = ALIGN(16) + 0x7ff0; ' OTHER_SDATA_SECTIONS=" Index: ld/emulparams/elf32bmipn32-defs.sh =================================================================== RCS file: /cvs/src/src/ld/emulparams/elf32bmipn32-defs.sh,v retrieving revision 1.6 diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.6 elf32bmipn32-defs.sh *** ld/emulparams/elf32bmipn32-defs.sh 14 Feb 2004 11:45:25 -0000 1.6 --- ld/emulparams/elf32bmipn32-defs.sh 22 Jan 2005 18:08:18 -0000 *************** MAXPAGESIZE=0x100000 *** 36,42 **** --- 36,47 ---- ENTRY=__start # GOT-related settings. + # If the output has a GOT section, there must be exactly 0x7ff0 bytes + # between .got and _gp. The ". = ." below stops the orphan code from + # inserting other sections between the assignment to _gp and the start + # of .got. OTHER_GOT_SYMBOLS=' + . = .; _gp = ALIGN(16) + 0x7ff0; ' OTHER_SDATA_SECTIONS="