]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Set plt_got.offset to (bfd_vma) -1
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 24 Feb 2016 13:42:27 +0000 (05:42 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 26 Feb 2016 13:21:53 +0000 (05:21 -0800)
Since plt_got.offset may be updated in x86 allocate_dynrelocs, set
plt_got.offset to (bfd_vma) -1 when setting needs_plt to 0.

Backport from master

* elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
to (bfd_vma) -1 when setting needs_plt to 0.
* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.

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

index e15bada205b543d82fd8e60f70df1c292c44786e..afe107677b87285c3dc49a3a01235177d1d0056b 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from master
+       2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
+       to (bfd_vma) -1 when setting needs_plt to 0.
+       * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
+
 2016-02-26  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (create_linkage_sections): Create sfpr when
index 0c79d1673c8d1f53c2f3c1da9f490006bb1259f1..5d07c773f4fa9df075ee595d7e7c2e776dc001a6 100644 (file)
@@ -2490,12 +2490,14 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
        }
       else
        {
+         eh->plt_got.offset = (bfd_vma) -1;
          h->plt.offset = (bfd_vma) -1;
          h->needs_plt = 0;
        }
     }
   else
     {
+      eh->plt_got.offset = (bfd_vma) -1;
       h->plt.offset = (bfd_vma) -1;
       h->needs_plt = 0;
     }
index 156734b7ab733b1d376cfed294aef7e74cf4055d..bddcfe1eed6305b85e419daef4a110d9aa4044aa 100644 (file)
@@ -2723,12 +2723,14 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
        }
       else
        {
+         eh->plt_got.offset = (bfd_vma) -1;
          h->plt.offset = (bfd_vma) -1;
          h->needs_plt = 0;
        }
     }
   else
     {
+      eh->plt_got.offset = (bfd_vma) -1;
       h->plt.offset = (bfd_vma) -1;
       h->needs_plt = 0;
     }