]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf32-i386.c
Skip extra relocations in .rel.plt/.rela.plt
[thirdparty/binutils-gdb.git] / bfd / elf32-i386.c
index c6ff7463a359ebf7299c485239d56a3fcbb689ef..23d50e1193dee6cd5416684545164d4b3e87aff8 100644 (file)
@@ -5260,6 +5260,11 @@ bad_return:
        abort ();
       plt_sym_val[reloc_index] = plt->vma + plt_offset;
       plt_offset += bed->plt->plt_entry_size;
+
+      /* PR binutils/18437: Skip extra relocations in the .rel.plt
+        section.  */
+      if (plt_offset >= plt->size)
+       break;
     }
 
   free (plt_contents);