This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Set plt_got.offset to (bfd_vma) -1


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=13f422778ff5307dad1f66d25a1d211bb8f76a8b

commit 13f422778ff5307dad1f66d25a1d211bb8f76a8b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Feb 24 05:42:27 2016 -0800

    Set plt_got.offset to (bfd_vma) -1
    
    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.
    
    	* 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.

Diff:
---
 bfd/ChangeLog      | 6 ++++++
 bfd/elf32-i386.c   | 2 ++
 bfd/elf64-x86-64.c | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0ed70b4..e48f76b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+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-23  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* elflink.c (bfd_elf_record_link_assignment): Check for shared
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index a8951d8..f6c9c65 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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;
     }
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 8ea478d..7debc1e 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -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;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]