This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gc sections and .eh_frame
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jonathan Larmour <jifl at ecoscentric dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 7 Jun 2005 19:59:33 +0200
- Subject: Re: gc sections and .eh_frame
- References: <42A5DE0C.9050108@eCosCentric.com>
> 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 <ebotcazou@act-europe.fr>
* 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