From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7064 invoked by alias); 16 Jan 2002 19:03:45 -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 7032 invoked from network); 16 Jan 2002 19:03:44 -0000 Received: from unknown (HELO palrel12.hp.com) (156.153.255.237) by sources.redhat.com with SMTP; 16 Jan 2002 19:03:44 -0000 Received: from hpda.cup.hp.com (hpda.cup.hp.com [15.75.208.53]) by palrel12.hp.com (Postfix) with ESMTP id 80750E00609; Wed, 16 Jan 2002 11:03:44 -0800 (PST) Received: from hpsje.cup.hp.com (hpsje.cup.hp.com [15.0.98.5]) by hpda.cup.hp.com (Postfix) with ESMTP id F1C468D79; Wed, 16 Jan 2002 11:03:43 -0800 (PST) Received: (from sje@localhost) by hpsje.cup.hp.com (8.8.6 (PHNE_17190)/8.7.3 TIS Messaging 5.0) id LAA05012; Wed, 16 Jan 2002 11:03:43 -0800 (PST) Date: Wed, 16 Jan 2002 12:45:00 -0000 From: Steve Ellcey Message-Id: <200201161903.LAA05012@hpsje.cup.hp.com> To: amodra@bigpond.net.au, binutils@sources.redhat.com Subject: Question about an elf.c change Reply-To: sje@cup.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00315.txt.bz2 I would like to have a change checked in to bfd/elf.c to fix a regression (for my HP-UX IA64 platform) that was introduced with version 1.112 of elf.c made by amodra. For my HP-UX IA64 vector I have a special version of elf_backend_section_from_bfd_section that returns SHN_IA_64_ANSI_COMMON instead of SHN_COMMON if bfd_is_com_section() is true. This used to work because in elf.c (_bfd_elf_section_from_bfd_section) we called the special version of the elf_backend_section_from_bfd_section routine before doing: if (bfd_is_com_section (asect)) return SHN_COMMON; Now, we do this test before calling the platform specific elf_backend_section_from_bfd_section function and I get SHN_COMMON instead of the SHN_IA_64_ANSI_COMMON that I want. Is the following patch (move the abs/com/undef tests later in the routine) considered acceptable in order to fix this. I am not sure what, if any, complications there may be in doing the various checks in _bfd_elf_section_from_bfd_section in any particular order. Steve Ellcey sje@cup.hp.com 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);