This is the mail archive of the binutils-cvs@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]

[binutils-gdb] Relax assertion in BFIN linker to allow for discard GOT relocs.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ed3056ebdb9795446157af03d3e08fbb93c1b01d

commit ed3056ebdb9795446157af03d3e08fbb93c1b01d
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Mar 29 10:24:16 2016 +0100

    Relax assertion in BFIN linker to allow for discard GOT relocs.
    
    	PR 17334
    	* elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
    	assertion on the size of the got section to allow it to be bigger
    	than the number of relocs.

Diff:
---
 bfd/ChangeLog    | 7 +++++++
 bfd/elf32-bfin.c | 8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 54dc971..7cf79bb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2016-03-29  Nick Clifton  <nickc@redhat.com>
+
+	PR 17334
+	* elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
+	assertion on the size of the got section to allow it to be bigger
+	than the number of relocs.
+
 2016-03-29  Toni Spets  <toni.spets@iki.fi>
 
 	PR 19878
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 7cc8b6d..b2fcf38 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -4457,7 +4457,13 @@ elf32_bfinfdpic_finish_dynamic_sections (bfd *output_bfd,
   if (bfinfdpic_got_section (info))
     {
       BFD_ASSERT (bfinfdpic_gotrel_section (info)->size
-		  == (bfinfdpic_gotrel_section (info)->reloc_count
+		  /* PR 17334: It appears that the GOT section can end up
+		     being bigger than the number of relocs.  Presumably
+		     because some relocs have been deleted.  A test case has
+		     yet to be generated for verify this, but in the meantime
+		     the test below has been changed from == to >= so that
+		     applications can continue to be built.  */
+		  >= (bfinfdpic_gotrel_section (info)->reloc_count
 		      * sizeof (Elf32_External_Rel)));
 
       if (bfinfdpic_gotfixup_section (info))


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