From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10072 invoked by alias); 17 Jan 2002 01:03:43 -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 10039 invoked from network); 17 Jan 2002 01:03:42 -0000 Received: from unknown (HELO mta04bw.bigpond.com) (139.134.6.87) by sources.redhat.com with SMTP; 17 Jan 2002 01:03:42 -0000 Received: from bubble.local ([144.135.24.69]) by mta04bw.bigpond.com (Netscape Messaging Server 4.15) with SMTP id GQ25XX00.CDL for ; Thu, 17 Jan 2002 11:10:45 +1000 Received: from CPE-144-136-176-14.sa.bigpond.net.au ([144.136.176.14]) by bwmam01.mailsvc.email.bigpond.com(MailRouter V3.0h 8/957024); 17 Jan 2002 11:03:40 Received: (qmail 18229 invoked by uid 179); 17 Jan 2002 01:03:40 -0000 Date: Wed, 16 Jan 2002 17:08:00 -0000 From: Alan Modra To: Steve Ellcey Cc: binutils@sources.redhat.com Subject: Re: Question about an elf.c change Message-ID: <20020117010340.GR21859@bubble.sa.bigpond.net.au> Mail-Followup-To: Steve Ellcey , binutils@sources.redhat.com References: <200201161903.LAA05012@hpsje.cup.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200201161903.LAA05012@hpsje.cup.hp.com> User-Agent: Mutt/1.3.25i X-SW-Source: 2002-01/txt/msg00332.txt.bz2 On Wed, Jan 16, 2002 at 11:03:43AM -0800, Steve Ellcey wrote: > > 2002-01-16 Steve Ellcey > > * elf.c (_bfd_elf_section_from_bfd_section): Do platform > specific section checks before generic ones. > > --- elf.c.orig Wed Jan 16 10:42:17 2002 > +++ elf.c Wed Jan 16 10:45:35 2002 > @@ -4044,13 +4044,6 @@ _bfd_elf_section_from_bfd_section (abfd, > && elf_section_data (asect)->this_idx != 0) > return elf_section_data (asect)->this_idx; > > - if (bfd_is_abs_section (asect)) > - return SHN_ABS; > - if (bfd_is_com_section (asect)) > - return SHN_COMMON; > - if (bfd_is_und_section (asect)) > - return SHN_UNDEF; > - > for (index = 1; index < maxindex; index++) > { > hdr = i_shdrp[index]; > @@ -4074,6 +4067,13 @@ _bfd_elf_section_from_bfd_section (abfd, > return retval; > } > } > + > + if (bfd_is_abs_section (asect)) > + return SHN_ABS; > + if (bfd_is_com_section (asect)) > + return SHN_COMMON; > + if (bfd_is_und_section (asect)) > + return SHN_UNDEF; > > bfd_set_error (bfd_error_nonrepresentable_section); This is OK. The reason I moved the bfd_is_*_section tests was for efficiency, in order to avoid scanning sections when possible. Hmm, now that I look at it again, I see no reason why bed->elf_backend_section_from_bfd_section is called from inside a loop. None of the backends use the hdr arg. I might make a slightly more comprehensive patch. -- Alan Modra IBM OzLabs - Linux Technology Centre