From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15912 invoked by alias); 13 May 2011 09:13:57 -0000 Received: (qmail 15903 invoked by uid 22791); 13 May 2011 09:13:56 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 May 2011 09:13:43 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 41419CB0251 for ; Fri, 13 May 2011 11:13:41 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vOpQkQ80c0iH for ; Fri, 13 May 2011 11:13:38 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 3BD84CB01FC for ; Fri, 13 May 2011 11:13:38 +0200 (CEST) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [Patch/xcoff]: xcofflink.c: handle new dwarf sections and symbols Date: Fri, 13 May 2011 09:13:00 -0000 Message-Id: To: binutils Development Mime-Version: 1.0 (Apple Message framework v1084) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00189.txt.bz2 Hi, with this patch, gnu-ld for xcoff properly deals with new dwarf sections an= d symbols. Ok for trunk ? Tristan. bfd/ 2011-05-13 Tristan Gingold * xcofflink.c (xcoff_link_add_symbols): Handle C_DWARF symbols. (xcoff_sweep): Always keep dwarf sections. (xcoff_link_input_bfd): Handle dwarf symbols and sections. diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 47e094e..4308b18 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -1365,11 +1365,12 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_= info *info) If C_FILE or first time, handle special =20 Advance esym, sym_hash, csect_hash ptrs. */ - if (sym.n_sclass =3D=3D C_FILE) + if (sym.n_sclass =3D=3D C_FILE || sym.n_sclass =3D=3D C_DWARF) csect =3D NULL; if (csect !=3D NULL) *csect_cache =3D csect; - else if (first_csect =3D=3D NULL || sym.n_sclass =3D=3D C_FILE) + else if (first_csect =3D=3D NULL + || sym.n_sclass =3D=3D C_FILE || sym.n_sclass =3D=3D C_= DWARF) *csect_cache =3D coff_section_from_bfd_index (abfd, sym.n_scnum); else *csect_cache =3D NULL; @@ -2073,6 +2074,10 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_i= nfo *info) /* Make sure that we have seen all the relocs. */ for (o =3D abfd->sections; o !=3D first_csect; o =3D o->next) { + /* Debugging sections have no csects. */ + if (bfd_get_section_flags (abfd, o) & SEC_DEBUGGING) + continue; + /* Reset the section size and the line number count, since the data is now attached to the csects. Don't reset the size of the .debug section, since we need to read it below in @@ -3009,6 +3014,7 @@ xcoff_sweep (struct bfd_link_info *info) || o =3D=3D xcoff_hash_table (info)->loader_section || o =3D=3D xcoff_hash_table (info)->linkage_section || o =3D=3D xcoff_hash_table (info)->descriptor_section + || (bfd_get_section_flags (sub, o) & SEC_DEBUGGING) || strcmp (o->name, ".debug") =3D=3D 0) o->flags |=3D SEC_MARK; else @@ -4930,21 +4936,25 @@ xcoff_link_input_bfd (struct xcoff_final_link_info = *flinfo, this case, but I don't think it's worth it. */ is =3D flinfo->internal_syms + r_symndx; =20 - name =3D (_bfd_coff_internal_syment_name - (input_bfd, is, buf)); + if (is->n_sclass !=3D C_DWARF) + { + name =3D (_bfd_coff_internal_syment_name + (input_bfd, is, buf)); =20 - if (name =3D=3D NULL) - return FALSE; + if (name =3D=3D NULL) + return FALSE; =20 - if (! ((*flinfo->info->callbacks->unattached_reloc) - (flinfo->info, name, input_bfd, o, - irel->r_vaddr))) - return FALSE; + if (!(*flinfo->info->callbacks->unattached_r= eloc) + (flinfo->info, name, input_bfd, o, + irel->r_vaddr)) + return FALSE; + } } } } =20 - if (xcoff_need_ldrel_p (flinfo->info, irel, h)) + if ((o->flags & SEC_DEBUGGING) =3D=3D 0 + && xcoff_need_ldrel_p (flinfo->info, irel, h)) { asection *sec; =20