.eh_frame optimization question
Alan Modra
amodra@bigpond.net.au
Mon Jan 1 12:17:00 GMT 2007
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
More information about the Binutils
mailing list