]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Match PLT entry only for ELFOSABI_GNU input
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 16 Jul 2014 18:15:56 +0000 (11:15 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 28 Jul 2014 17:52:51 +0000 (10:52 -0700)
* 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.

bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c

index a64b0ea34f68c2343316636b1411e9dad9e54828..96bbcf7f3730e4c99195b7e43b556c6f13e83a3d 100644 (file)
@@ -1,3 +1,10 @@
+2014-07-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * 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.
+
 2014-07-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/17154
index 8547a528df7e99c07db391ba33ed8a2805a45f44..cbee90d488b1b8d47f5b5f910314bba3297bea8f 100644 (file)
@@ -4993,6 +4993,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;
index 278e13587baa53f9c048b6fb8a2edfd59c6e5c08..2caffb338fe41ce3e0a82ea25fd76353a5882638 100644 (file)
@@ -5310,6 +5310,10 @@ elf_x86_64_plt_sym_val (bfd_vma i, const asection *plt,
   abfd = plt->owner;
   bed = get_elf_x86_64_backend_data (abfd);
   plt_offset = bed->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_index;
@@ -5339,6 +5343,10 @@ elf_x86_64_plt_sym_val_offset_plt_bnd (bfd_vma i, const asection *plt)
   const struct elf_x86_64_backend_data *bed = &elf_x86_64_bnd_arch_bed;
   bfd *abfd = plt->owner;
   bfd_vma plt_offset = bed->plt_entry_size;
+
+  if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU)
+    return i * sizeof (elf_x86_64_legacy_plt2_entry);
+
   while (plt_offset < plt->size)
     {
       bfd_vma reloc_index;