aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-05-20 07:55:45 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-05-20 07:55:45 -0700
commitfca6ae69c41882f5adfba05da7d932b7c8bc2153 (patch)
tree953c079ecf7ac5ab3b26f3546876a3c857959f09 /bfd/elf64-x86-64.c
parentce336788820b5d04700cdb9ead2ade880f5e2caa (diff)
downloadgdb-fca6ae69c41882f5adfba05da7d932b7c8bc2153.zip
gdb-fca6ae69c41882f5adfba05da7d932b7c8bc2153.tar.gz
gdb-fca6ae69c41882f5adfba05da7d932b7c8bc2153.tar.bz2
Skip extra relocations in .rel.plt/.rela.plt
Extra relocations may be added to the .rel.plt/.rela.plt section, which are unrelated to PLT. We should skip them when retrieving PLT entry symbol values. PR binutils/18437 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations in .rel.plt/.rela.plt. * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 01df230..4428f97 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -5649,6 +5649,11 @@ bad_return:
else
plt_sym_val[reloc_index] = plt->vma + plt_offset;
plt_offset += bed->plt_entry_size;
+
+ /* PR binutils/18437: Skip extra relocations in the .rela.plt
+ section. */
+ if (plt_offset >= plt->size)
+ break;
}
free (plt_contents);