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] Handle x86 VTINHERIT/VTENTRY relocs when deleting relocations


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

commit 18954b29a1b49c9ffbfef925fdac4a23194ef82d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Nov 10 04:26:55 2015 -0800

    Handle x86 VTINHERIT/VTENTRY relocs when deleting relocations
    
    	* elf32-i386.c (elf_i386_relocate_section): Handle VTINHERIT
    	and VTENTRY relocations when deleting relocations.
    	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.

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

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8dbe72b..b746413 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
 2015-11-10  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* elf32-i386.c (elf_i386_relocate_section): Handle VTINHERIT
+	and VTENTRY relocations when deleting relocations.
+	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
+
+2015-11-10  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* elf32-i386.c (elf_i386_relocate_section): Properly move
 	kept relocations when deleting relocations.
 	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index ee45ed1..1df7244 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3647,7 +3647,11 @@ elf_i386_relocate_section (bfd *output_bfd,
       r_type = ELF32_R_TYPE (rel->r_info);
       if (r_type == R_386_GNU_VTINHERIT
 	  || r_type == R_386_GNU_VTENTRY)
-	continue;
+	{
+	  if (wrel != rel)
+	    *wrel = *rel;
+	  continue;
+	}
 
       if ((indx = r_type) >= R_386_standard
 	  && ((indx = r_type - R_386_ext_offset) - R_386_standard
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index dfa1276..8e00362 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3904,7 +3904,11 @@ elf_x86_64_relocate_section (bfd *output_bfd,
       r_type = ELF32_R_TYPE (rel->r_info);
       if (r_type == (int) R_X86_64_GNU_VTINHERIT
 	  || r_type == (int) R_X86_64_GNU_VTENTRY)
-	continue;
+	{
+	  if (wrel != rel)
+	    *wrel = *rel;
+	  continue;
+	}
 
       if (r_type >= (int) R_X86_64_standard)
 	{


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