From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30791 invoked by alias); 3 May 2005 01:27:23 -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 30571 invoked from network); 3 May 2005 01:27:18 -0000 Received: from unknown (HELO gizmo04ps.bigpond.com) (144.140.71.14) by sourceware.org with SMTP; 3 May 2005 01:27:18 -0000 Received: (qmail 25022 invoked from network); 3 May 2005 01:27:16 -0000 Received: from unknown (HELO psmam12.bigpond.com) (144.135.25.103) by gizmo04ps.bigpond.com with SMTP; 3 May 2005 01:27:16 -0000 Received: from cpe-144-136-221-26.sa.bigpond.net.au ([144.136.221.26]) by psmam12.bigpond.com(MAM REL_3_4_2a 234/28218983) with SMTP id 28218983; Tue, 03 May 2005 11:27:16 +1000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id 994F91A6C05; Tue, 3 May 2005 10:57:16 +0930 Date: Tue, 03 May 2005 01:27:00 -0000 From: Alan Modra To: "H. J. Lu" Cc: Michael Matz , binutils@sources.redhat.com Subject: Re: PATCH: Fix alpha relocation overflow (Re: PATCH: Add _bfd_elf_provide_symbol) Message-ID: <20050503012716.GN9133@bubble.grove.modra.org> Mail-Followup-To: "H. J. Lu" , Michael Matz , binutils@sources.redhat.com References: <20050323021109.GA19226@nevyn.them.org> <20050323041924.GA11208@lucon.org> <20050425145458.GA32362@lucon.org> <20050425172736.GA2235@lucon.org> <20050425174359.GA2592@lucon.org> <20050426134659.GB20029@lucon.org> <20050427181840.GA12815@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050427181840.GA12815@lucon.org> User-Agent: Mutt/1.4i X-SW-Source: 2005-05/txt/msg00047.txt.bz2 On Wed, Apr 27, 2005 at 11:18:40AM -0700, H. J. Lu wrote: > --- ld/emultempl/elf32.em.provide 2005-04-11 09:10:51.000000000 -0700 > +++ ld/emultempl/elf32.em 2005-04-27 11:15:15.000000000 -0700 > @@ -1457,8 +1457,21 @@ gld${EMULATION_NAME}_provide_bound_symbo > } > else > { > + /* We have to choose those values very carefully. Some targets, > + like alpha, may have relocation overflow with 0. We use the > + first SEC_ALLOC section which isn't SEC_READONLY or the last > + SEC_ALLOC section. */ > start_val = 0; > - end_val = 0; > + for (s = output_bfd->sections; s != NULL; s = s->next) > + { > + if ((s->flags & SEC_ALLOC) != 0) > + { > + start_val = s->vma; > + if ((s->flags & SEC_READONLY) == 0) > + break; > + } > + } > + end_val = start_val; I think this is a rather horrible hack. Can't you do this some way that avoids the potentially slow section list traversal? How about defining __init_fini_array in the linker script, and using its value instead? (Default to zero if __init_fini_array isn't defined.) -- Alan Modra IBM OzLabs - Linux Technology Centre