This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Only give FDE encoding warnings if --eh-frame-hdr was specified.


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]