Relax assertion in BFIN linker to allow for discard GOT relocs.
authorNick Clifton <nickc@redhat.com>
Tue, 29 Mar 2016 09:24:16 +0000 (10:24 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 29 Mar 2016 09:24:16 +0000 (10:24 +0100)
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.

bfd/ChangeLog
bfd/elf32-bfin.c

index 54dc971eb404d0197c94502a12b2f5da853030c6..7cf79bb14606e043410bdf054a0adad09915afb5 100644 (file)
@@ -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
index 7cc8b6d851ec20706f0fcf49c4cf77870bbec018..b2fcf38b470e75ae0597cdd11f7b7c9cf7992de3 100644 (file)
@@ -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))