This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] allow suppression of fde encoding warning
On 01/20/2013 08:51 PM, Ian Lance Taylor wrote:
I think the correct solution is to avoid using the --eh-frame-hdr
option on architectures where it can not work. I think the linker is
correctly warning you that although you explicitly specified
--eh-frame-hdr, you aren't going to get an exception frame header.
If it does not reliably work with your ABI, then I think that GCC
should not pass it by default.
OK, I made that change to GCC, and I'm still getting the warning even
without --eh-frame-hdr being passed to the linker. How about the
attached patch, which checks whether exception frame headers were
requested before issuing the diagnostic?
-Sandra
2013-01-21 Sandra Loosemore <sandra@codesourcery.com>
bfd/
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't
warn unless we actually requested eh_frame_hdr tables.
Index: bfd/elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.90
diff -u -p -r1.90 elf-eh-frame.c
--- bfd/elf-eh-frame.c 25 May 2012 01:12:19 -0000 1.90
+++ bfd/elf-eh-frame.c 22 Jan 2013 03:22:02 -0000
@@ -1185,9 +1185,10 @@ _bfd_elf_discard_section_eh_frame
don't create the binary search table,
since it is affected by runtime relocations. */
hdr_info->table = FALSE;
- (*info->callbacks->einfo)
- (_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr"
- " table being created.\n"), abfd, sec);
+ if (info->eh_frame_hdr)
+ (*info->callbacks->einfo)
+ (_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr"
+ " table being created.\n"), abfd, sec);
}
ent->removed = 0;
hdr_info->fde_count++;