x86: Guard against corrupted PLT

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
	* elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
	corrupted PLT.
This commit is contained in:
H.J. Lu
2017-09-22 14:15:40 -07:00
parent 59ca4c1bbd
commit 61e3bf5f83
2 changed files with 10 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/22170
* elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
corrupted PLT.
2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/22163

View File

@@ -1962,6 +1962,10 @@ _bfd_x86_elf_get_synthetic_symtab (bfd *abfd,
names += sizeof ("@plt");
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;
}