This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gc sections and .eh_frame
On Mon, Jun 27, 2005 at 01:55:49PM +0200, Eric Botcazou wrote:
> > None of the proposed solutions is right. If you take a look at a
> > typical .eh_frame, you'll see relocs pointing at text sections and
> > .gcc_except_table (or .rodata for broken ppc compilers). Changing
> > garbage collection to process .rela.eh_frame thus runs into the problem
> > of distinguishing the two types of reloc: You need to ignore the
> > former, and mark sections for the latter.
>
> That's exactly what I proposed in my last message, but I suggested passing a
Sorry, I was just going by memory.
> parameter to _bfd_elf_gc_mark to make it "forget" code sections. It seems
> autodetecting .eh_frame is more straightforward.
>
> > Try the following totally untested patch.
> >
> > * elflink.c (_bfd_elf_gc_mark): Handle .eh_frame relocs specially..
> > (bfd_elf_gc_sections): ..rather than totally ignoring .eh_frame.
> > Don't recheck sections we have already marked.
>
> I think it doesn't work (alone) either, because you unconditionally mark
> all .gcc_except_table* sections, which themselves point to the functions.
That doesn't make any difference, because .gcc_except_table* is marked
via KEEP() in the linker script. So I don't think you need anything
more than the patch I posted.
--
Alan Modra
IBM OzLabs - Linux Technology Centre