From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4623 invoked by alias); 7 Jun 2005 18:00:17 -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 4597 invoked by uid 22791); 7 Jun 2005 18:00:12 -0000 Received: from dublin.act-europe.fr (HELO dublin.act-europe.fr) (212.157.227.154) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 07 Jun 2005 18:00:12 +0000 Received: from localhost (province.act-europe.fr [10.10.0.214]) by filtered-dublin.act-europe.fr (Postfix) with ESMTP id 368C8229ED0; Tue, 7 Jun 2005 20:00:07 +0200 (MET DST) Received: from dublin.act-europe.fr ([10.10.0.154]) by localhost (province.act-europe.fr [10.10.0.214]) (amavisd-new, port 10024) with ESMTP id 07490-01; Tue, 7 Jun 2005 20:00:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by dublin.act-europe.fr (Postfix) with ESMTP id B4B15229ECF; Tue, 7 Jun 2005 20:00:06 +0200 (MET DST) From: Eric Botcazou To: Jonathan Larmour Subject: Re: gc sections and .eh_frame Date: Tue, 07 Jun 2005 18:00:00 -0000 User-Agent: KMail/1.7.1 Cc: binutils@sources.redhat.com References: <42A5DE0C.9050108@eCosCentric.com> In-Reply-To: <42A5DE0C.9050108@eCosCentric.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200506071959.33267.ebotcazou@adacore.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2005-06/txt/msg00129.txt.bz2 > I believe I have tracked this down to a change enclosed in full at the end > of this mail, made by Eric Botcazou on 2004-04-21. I've looked at the > mailing list archives, and not found any posting or discussion of the > patch, or its rationale. Is that right? http://sourceware.org/ml/binutils/2004-03/msg00424.html > Anyway, the most relevant bit in elflink.c:bfd_elf_gc_sections() is: > > for (o = sub->sections; o != NULL; o = o->next) > { > if (o->flags & SEC_KEEP) > - if (!elf_gc_mark (info, o, gc_mark_hook)) > - return FALSE; > + { > + /* _bfd_elf_discard_section_eh_frame knows how to discard > + orphaned FDEs so don't mark sections referenced by the > + EH frame section. */ > + if (strcmp (o->name, ".eh_frame") == 0) > + o->gc_mark = 1; > + else if (!elf_gc_mark (info, o, gc_mark_hook)) > + return FALSE; > + } > } > } > > This change doesn't make sense to me. _bfd_elf_discard_section_eh_frame > does not set gc_mark on any section. So as a result, I would assume none > of the reloc dependencies of .eh_frame would ever get marked and that's > how those sections get GC'd. Am I missing something? Presumably: 2004-04-21 Eric Botcazou * scripttempl/elf.sc (.text): Add KEEP for .text.*personality*. (.data): Add KEEP for .gnu.linkonce.d.*personality*. (.gcc_except_table): Add KEEP for self and accept .gcc_except_table.*. -- Eric Botcazou