From patchwork Fri Feb 15 00:09:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 220559 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BAAA72C0080 for ; Fri, 15 Feb 2013 11:10:14 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1361491815; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=QMi4jKX +BXM1pacMXbQWLERrLeo=; b=hhv0494JdPb5Qnz2v9dJQ3DjmD8Bok38edeJ0/3 LV9U3Ws/rY6EfQAvC8yAiAB8OzxJMjwoiXyak2xDEar3bjen7ToKb7PN5UX7m/Pp VZ7CgjTtZcstKiZw77ZjjptFRaOokCWgr6u1jg06LZZkid7+VJmJ9QrNHkblmxxq A2pY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=awdA4PUqlZ44zJlGd2ZP2iqjxBt6KZ4TkyrCcXQe5dSyD29LJ6w3K35DV3iOIB oQeTWPIH2AwaQX4+T/X9Ys+67SEHL2owbLHUE27WUMIlDt0jDGO8A0mrKbhfZgmg 8v06J90rnjlXksFLQzwx9AmnRa8MVtgw3poPHpq0a60OA=; Received: (qmail 10131 invoked by alias); 15 Feb 2013 00:10:08 -0000 Received: (qmail 10084 invoked by uid 22791); 15 Feb 2013 00:10:04 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, TW_DW X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Feb 2013 00:09:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 583932E866; Thu, 14 Feb 2013 19:09:54 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id o8LQ6Sc-4sVh; Thu, 14 Feb 2013 19:09:54 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id AA2A82E14D; Thu, 14 Feb 2013 19:09:53 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B8951C2561; Thu, 14 Feb 2013 16:09:51 -0800 (PST) Date: Thu, 14 Feb 2013 16:09:51 -0800 From: Joel Brobecker To: David Edelsohn Cc: Tristan Gingold , Steven Bosscher , GCC Patches , Jeff Law , John David Anglin , rupp@gnat.com, "Joseph S. Myers" , Jakub Jelinek Subject: Re: [PATCH] Temporarily revert Steven's PCH changes for 4.8 (PR pch/54117) Message-ID: <20130215000951.GB4534@adacore.com> References: <20130213155423.GW4385@tucnak.redhat.com> <9F5FF0BC-E032-42CD-8241-5317E2C4DEAE@adacore.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org > >> AFAICT, for gcc+gas it should already work with binutils that include > >> the AdaCore patch for DWARF support. But this has apparently not been > >> tested with AIX ld, and there are AdaCore local patches pending. > >> http://sourceware.org/ml/binutils/2011-04/msg00250.html > >> http://www.sourceware.org/ml/gdb/2013-01/msg00030.html > > What is the status of merging Adacore's patches for DWARF support on AIX? Sorry, David. I have been meaning to work on that ever since we talked about it... I spent some time today isolating the patches. I am currently testing the patches we wrote for support on AIX 5.3. I then see a few more patches to extend support to AIX 7.1 - section alignment constraints, and stuff related to TLS. Just for anyone who is curious, this is what I am testing. It is missing the pieces for the other tools such as objdump, for instance. But I think those can be submitted separately. It might not apply to HEAD just yet, because I'm going at it step by step. For those who use git, I applied it on top of: commit 889f73fdb5bec852e083f47703f31592ef3ee77b Author: Alan Modra Date: Thu Oct 18 23:00:04 2012 +0000 daily update From dc928a0dbd0e762577c51204b043d6b6f066940d Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 14 Feb 2013 23:53:25 +0100 Subject: [PATCH] AIX: add DWARF support * bfd/coff-rs6000.c (xcoff_dwsect_names): Add .dwframe, .dwloc, .dwmacif and .dwmacro. * bfd/libxcoff.h (XCOFF_DWSECT_NBR_NAMES): Set to 12. * xcofflink.c (xcoff_mark): Mark all debugging symbols. (bfd_xcoff_size_dynamic_sections): Mark all debugging sections. (xcoff_link_input_bfd): Gah??? * gas/config/tc-ppc.c (ppc_named_section): Add handling of DWARF sections. --- bfd/coff-rs6000.c | 6 ++++- bfd/libxcoff.h | 2 +- bfd/xcofflink.c | 65 +++++++++++++++++++++++++++++--------------------- gas/config/tc-ppc.c | 29 ++++++++++++++++++++++- 4 files changed, 72 insertions(+), 30 deletions(-) diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 0945aca..9388ce3 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -3916,7 +3916,11 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { { SSUBTYP_DWARNGE, ".dwarnge", TRUE }, { SSUBTYP_DWABREV, ".dwabrev", FALSE }, { SSUBTYP_DWSTR, ".dwstr", TRUE }, - { SSUBTYP_DWRNGES, ".dwrnges", TRUE } + { SSUBTYP_DWRNGES, ".dwrnges", TRUE }, + { 0x47000000, ".dwframe", TRUE }, + { 0x47010000, ".dwloc", TRUE }, + { 0x47020000, ".dwmacif", FALSE }, + { 0x47030000, ".dwmacro", FALSE } }; static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = diff --git a/bfd/libxcoff.h b/bfd/libxcoff.h index 53a5e72..7583d5c 100644 --- a/bfd/libxcoff.h +++ b/bfd/libxcoff.h @@ -251,7 +251,7 @@ struct xcoff_dwsect_name { /* Number of entries in the array. The number is known and public so that user can 'extend' this array by index. */ -#define XCOFF_DWSECT_NBR_NAMES 8 +#define XCOFF_DWSECT_NBR_NAMES 12 /* The dwarf sections array. */ extern const struct xcoff_dwsect_name diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 4adfb17..ad31643 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -2902,8 +2902,7 @@ xcoff_mark (struct bfd_link_info *info, asection *sec) sec->flags |= SEC_MARK; if (sec->owner->xvec == info->output_bfd->xvec - && coff_section_data (sec->owner, sec) != NULL - && xcoff_section_data (sec->owner, sec) != NULL) + && coff_section_data (sec->owner, sec) != NULL) { struct xcoff_link_hash_entry **syms; struct internal_reloc *rel, *relend; @@ -2911,18 +2910,21 @@ xcoff_mark (struct bfd_link_info *info, asection *sec) unsigned long i, first, last; /* Mark all the symbols in this section. */ - syms = obj_xcoff_sym_hashes (sec->owner); - csects = xcoff_data (sec->owner)->csects; - first = xcoff_section_data (sec->owner, sec)->first_symndx; - last = xcoff_section_data (sec->owner, sec)->last_symndx; - for (i = first; i <= last; i++) - if (csects[i] == sec - && syms[i] != NULL - && (syms[i]->flags & XCOFF_MARK) == 0) - { - if (!xcoff_mark_symbol (info, syms[i])) - return FALSE; - } + if (xcoff_section_data (sec->owner, sec) != NULL) + { + syms = obj_xcoff_sym_hashes (sec->owner); + csects = xcoff_data (sec->owner)->csects; + first = xcoff_section_data (sec->owner, sec)->first_symndx; + last = xcoff_section_data (sec->owner, sec)->last_symndx; + for (i = first; i <= last; i++) + if (csects[i] == sec + && syms[i] != NULL + && (syms[i]->flags & XCOFF_MARK) == 0) + { + if (!xcoff_mark_symbol (info, syms[i])) + return FALSE; + } + } /* Look through the section relocs. */ if ((sec->flags & SEC_RELOC) != 0 @@ -2965,7 +2967,8 @@ xcoff_mark (struct bfd_link_info *info, asection *sec) /* See if this reloc needs to be copied into the .loader section. */ - if (xcoff_need_ldrel_p (info, rel, h)) + if ((sec->flags & SEC_DEBUGGING) == 0 + && xcoff_need_ldrel_p (info, rel, h)) { ++xcoff_hash_table (info)->ldrel_count; if (h != NULL) @@ -3760,6 +3763,17 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd, if (ldinfo.failed) goto error_return; } + /* Mark all debugging sections. */ + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + for (o = sub->sections; o != NULL; o = o->next) + if ((o->flags & SEC_DEBUGGING) != 0 + && (o->flags & SEC_MARK) == 0 + && ! xcoff_mark (info, o)) + goto error_return; + } xcoff_sweep (info); xcoff_hash_table (info)->gc = TRUE; } @@ -4920,7 +4934,7 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo, if (indx != -1) irel->r_symndx = indx; - else + else if ((o->flags & SEC_DEBUGGING) == 0) { struct internal_syment *is; @@ -4933,19 +4947,16 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo, this case, but I don't think it's worth it. */ is = flinfo->internal_syms + r_symndx; - if (is->n_sclass != C_DWARF) - { - name = (_bfd_coff_internal_syment_name - (input_bfd, is, buf)); + name = (_bfd_coff_internal_syment_name + (input_bfd, is, buf)); - if (name == NULL) - return FALSE; + if (name == NULL) + return FALSE; - if (!(*flinfo->info->callbacks->unattached_reloc) - (flinfo->info, name, input_bfd, o, - irel->r_vaddr)) - return FALSE; - } + if (!(*flinfo->info->callbacks->unattached_reloc) + (flinfo->info, name, input_bfd, o, + irel->r_vaddr)) + return FALSE; } } } diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 2820c31..8579c2d 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -3951,7 +3951,34 @@ ppc_named_section (int ignore ATTRIBUTE_UNUSED) real_name = ".data[RW]"; else { - as_bad (_("the XCOFF file format does not support arbitrary sections")); + /* Entries in this array correspond to the ones in + xcoff_dwsect_names. */ + static const char * const dwarf_sections[XCOFF_DWSECT_NBR_NAMES] = { + ".debug_info", + ".debug_line", + ".debug_pubnames", + ".debug_pubtypes", + ".debug_aranges", + ".debug_abbrev", + ".debug_str", + ".debug_ranges", + ".debug_frame", + ".debug_loc", + ".debug_macinfo", + ".debug_macro", }; + int i; + + /* Try dwarf sections. */ + for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++) + if (strcmp (user_name, dwarf_sections[i]) == 0) + { + *input_line_pointer = c; + demand_empty_rest_of_line (); + ppc_change_debug_section (i, 0); + return; + } + + as_bad (_("The XCOFF file format does not support arbitrary sections")); *input_line_pointer = c; ignore_rest_of_line (); return; -- 1.6.5.rc2