This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Only give FDE encoding warnings if --eh-frame-hdr was specified.
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: <binutils at sourceware dot org>
- Cc: Alan Modra <amodra at gmail dot com>, Ian Lance Taylor <iant at google dot com>
- Date: Mon, 2 Dec 2019 21:18:51 -0700
- Subject: [PATCH] Only give FDE encoding warnings if --eh-frame-hdr was specified.
- Ironport-sdr: PGuujFohuuSaNuFDdQdTJqWK6IqICvSRhyljsLMCiG3peQ86CeH5TspDOTSdPYIAn84QQpDAfV tFivAO1e6Yls4nGKEEwvR3aWeCT/c4ojrYUJkJD8y48yc+wSSnNfHayEseVN3dBWW2QGyCjShu SeZNw/L5Mw+4chrvCrjsbiyqHwG8TLLgOV++23iiU01c2RI042Qn7yNHaNgl2be8B2BU+55d/u 3lkzWwvU92f48A4w5Crwfm8pSzqAFDh1c93DOA7TDr+igIUejRqpCXy96BP0D7kAyaSUnXJmEm URM=
- Ironport-sdr: O4pvssvYTMNG3DbiRvJI8Tkwjrk2Hh51ExKfhapfOdw7NstHLupNM0KTYO3GFd5zHD0hEl5Z6R Ee0d0eun9UVc2DU/vB6ZLtFH7s62ziZYU1C9pa+xh6pXwXv2tXh0s4KtUE0cllqNgiVEeNqBof NyYw7hbwIIW38kKjq4sj/mHc/iU/520nvn5EtjNRz89w15qLaoiKTEvpSmSGgVyWymfyGfN7qu c1WT5tOxKmoqT6pa1j3x8MdBgRIwBAM3L0Y4d6PCvhXCoeUMFihxj7gmlSkmZY5lU7xJkQSdoK 7IM=
This is an updated version of a patch I previously posted N years ago.
It was approved back then, but for some reason I neglected to commit it
at the time, and then forgot about it. :-(
https://sourceware.org/ml/binutils/2013-01/msg00333.html
The problem I'm trying to fix is that nios2 doesn't have appropriate
relocations to support --eh-frame-hdr in conjunction with -fpie or
-fPIE, and these warnings about the FDE encoding presently appear even
when --eh-frame-hdr is not enabled.
The new patch is the same fix as the old one, just updated for bit rot.
Unless I hear some objection or hit some other snag, I plan to commit it
(along with the associated GCC specs patch to disable passing
--eh-frame-hdr with PIE) in a couple days, when I've completed testing.
This time for sure! ;-)
-Sandra
commit 550485f5df467b668f1551ab6701d2e53f21734c
Author: Sandra Loosemore <sandra@codesourcery.com>
Date: Mon Dec 2 19:54:39 2019 -0800
Only give FDE encoding warnings if --eh-frame-hdr was specified.
2019-12-02 Sandra Loosemore <sandra@codesourcery.com>
Only give FDE encoding warnings if --eh-frame-hdr was specified.
bfd/
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Make
FDE encoding warning conditional.
diff --git a/ChangeLog b/ChangeLog
index 8c60466..6ded878 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ Only give FDE encoding warnings if --eh-frame-hdr was specified.
+
+ * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Make
+ FDE encoding warning conditional.
+
2019-10-17 Sergio Durigan Junior <sergiodj@redhat.com>
* src-release.sh (GDB_SUPPORT_DIRS): Add libctf.
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index c2cb77b..b622ffc 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1532,19 +1532,23 @@ _bfd_elf_discard_section_eh_frame
don't create the binary search table,
since it is affected by runtime relocations. */
hdr_info->u.dwarf.table = FALSE;
- if (num_warnings_issued < 10)
+ /* Only warn if --eh-frame-hdr was specified. */
+ if (info->eh_frame_hdr_type != 0)
{
- _bfd_error_handler
- /* xgettext:c-format */
- (_("FDE encoding in %pB(%pA) prevents .eh_frame_hdr"
- " table being created"), abfd, sec);
- num_warnings_issued ++;
- }
- else if (num_warnings_issued == 10)
- {
- _bfd_error_handler
- (_("further warnings about FDE encoding preventing .eh_frame_hdr generation dropped"));
- num_warnings_issued ++;
+ if (num_warnings_issued < 10)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("FDE encoding in %pB(%pA) prevents .eh_frame_hdr"
+ " table being created"), abfd, sec);
+ num_warnings_issued ++;
+ }
+ else if (num_warnings_issued == 10)
+ {
+ _bfd_error_handler
+ (_("further warnings about FDE encoding preventing .eh_frame_hdr generation dropped"));
+ num_warnings_issued ++;
+ }
}
}
ent->removed = 0;