[patch] allow suppression of fde encoding warning

Sandra Loosemore sandra@codesourcery.com
Sat Jan 19 20:16:00 GMT 2013


While working on a new toolchain port (Altera Nios II), I was seeing 
diagnostics like

ld: fde encoding in /tmp/cceh1oVS.o(.eh_frame) prevents .eh_frame_hdr 
table being created.

on some test cases compiled with -fpie.

My understanding of this warning is as follows.

As an optimization, GNU ld tries to precompute lookup tables for some 
exception handling information ("fde" == "Frame Description Entry") at 
link time.  This warning is saying that it can't do so when generating a 
position-independent executable because the eh data contains absolute 
relocations.  Since these tables are only an optimization, it's not a 
fatal error; the relocations will be fully resolved at runtime and the 
eh library is supposed to DTRT in the absence of the linker-generated 
tables.

Google turned up a few references to this problem on other targets that 
indicated that the "right" solution is for GCC to emit section-relative 
references in the FDE data.  But, not all architectures support such a 
thing in the ABI (and, in particular, the Nios II ABI doesn't have an 
appropriate relocation for this purpose).  So, it seems like we should 
be able to turn the warning off on architectures where the optimization 
cannot possibly work.

I've come up with the attached patch to add infrastructure to do this. 
OK to commit?

(Another possible solution is just getting rid of the warning entirely. 
  It seems like an implementation detail unlikely to be of interest to 
99.9% of ordinary users.)

-Sandra

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fde.log
Type: text/x-log
Size: 398 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20130119/e9dfa777/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fde.patch
Type: text/x-patch
Size: 2657 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20130119/e9dfa777/attachment-0001.bin>


More information about the Binutils mailing list