There should be only one entry in PLT for a given symbol. Set howto to
NULL after processing a PLT entry to guard against corrupted PLT so that
the duplicated PLT entries are skipped.
PR binutils/22170
* elf32-i386.c (elf_i386_get_synthetic_symtab): Guard against
corrupted PLT.
* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
(cherry picked from commit
61e3bf5f83f7e505b6bc51ef65426e5b31e6e360)
+2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/22170
+ * elf32-i386.c (elf_i386_get_synthetic_symtab): Guard against
+ corrupted PLT.
+ * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
+
2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/22163
size += sizeof ("+0x") - 1 + 8;
n++;
s++;
+ /* There should be only one entry in PLT for a given
+ symbol. Set howto to NULL after processing a PLT
+ entry to guard against corrupted PLT. */
+ p->howto = NULL;
}
offset += plt_entry_size;
}
size += sizeof ("+0x") - 1 + 8 + 8 * ABI_64_P (abfd);
n++;
s++;
+ /* There should be only one entry in PLT for a given
+ symbol. Set howto to NULL after processing a PLT
+ entry to guard against corrupted PLT. */
+ p->howto = NULL;
}
offset += plt_entry_size;
}