aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-22 14:15:40 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-22 14:18:20 -0700
commit61e3bf5f83f7e505b6bc51ef65426e5b31e6e360 (patch)
treeccc5443394efd461048b99ea7febeeae32a54fa3 /bfd/elfxx-x86.c
parent59ca4c1bbd48a47073eed2c4b933045674cafe41 (diff)
downloadgdb-61e3bf5f83f7e505b6bc51ef65426e5b31e6e360.zip
gdb-61e3bf5f83f7e505b6bc51ef65426e5b31e6e360.tar.gz
gdb-61e3bf5f83f7e505b6bc51ef65426e5b31e6e360.tar.bz2
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.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r--bfd/elfxx-x86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 11883de..dcc393b 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -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;
}