aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-07-16 11:15:56 -0700
committerH.J. Lu <hjl.tools@gmail.com>2014-07-16 11:15:56 -0700
commitcca5b8b64b3286bb96cd7a2c18232d1acea85cd9 (patch)
tree6c1c671315f38ed1dd7590a1a341133d1a30195c /bfd/elf32-i386.c
parent144bed8d4d8a1bdc0067f55f2ee71c07e5594677 (diff)
downloadgdb-cca5b8b64b3286bb96cd7a2c18232d1acea85cd9.zip
gdb-cca5b8b64b3286bb96cd7a2c18232d1acea85cd9.tar.gz
gdb-cca5b8b64b3286bb96cd7a2c18232d1acea85cd9.tar.bz2
Match PLT entry only for ELFOSABI_GNU input
* elf32-i386.c (elf_i386_plt_sym_val): Match PLT entry only for ELFOSABI_GNU input. * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index aa01a7a..7c4b4bb 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -4994,6 +4994,10 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel)
abfd = plt->owner;
bed = get_elf_i386_backend_data (abfd);
plt_offset = bed->plt->plt_entry_size;
+
+ if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU)
+ return plt->vma + (i + 1) * plt_offset;
+
while (plt_offset < plt->size)
{
bfd_vma reloc_offset;