This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: .eh_frame optimization question
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jie Zhang <jzhang918 at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 1 Jan 2007 22:47:00 +1030
- Subject: Re: .eh_frame optimization question
- References: <6f48278f0612250659l837377bhc9212bbafdb203a7@mail.gmail.com>
On Mon, Dec 25, 2006 at 10:59:43PM +0800, Jie Zhang wrote:
> I'm looking at a bug of bfin port ld. With ELF FD-PIC ABI, bfin ld
> will generate a relocation of type R_BFIN_FUNCDESC against symbol
> __gxx_personality_v0 in .eh_frame section when compiling C++ program.
> The number of such relocations are counted in size_dynamic_sections ()
> and the size of the corresponding section are calculated at that time.
> __gxx_personality_v0 is used in the CIE entry of the .eh_frame.
> However, it's possible that .eh_frame optimization discards all FDE
> entries which use the CIE entry, so the CIE entry can be eliminated,
> too. Thus when bfinfdpic_relocate_section () is going to generating
> the relocation for each section, it will find some relocations are
> lost.
>
> So my question is: Is it possible to add a backend hook, which can be
> used by port, like bfin, to tell ld not optimize away CIE entry even
> there is no FDE use it? Or is there a better way to fix it?
Other ports handle this situation by emitting an R_*_NONE reloc,
typically reloc number 0. Can you do the same?
_bfd_elf_section_offset will return -1 or -2 to indicate that a
dynamic reloc is not needed.
--
Alan Modra
IBM OzLabs - Linux Technology Centre