Handle x86 VTINHERIT/VTENTRY relocs when deleting relocations
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Nov 2015 12:26:55 +0000 (04:26 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Nov 2015 12:27:51 +0000 (04:27 -0800)
* 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.

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

index 8dbe72b9374cb9329448d6c0b09003c296e72ddd..b74641343bc410574fe557f3afdd96eb3e065744 100644 (file)
@@ -1,3 +1,9 @@
+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
index ee45ed161a5ef1bf8090a92946ee635122e9abde..1df7244f621880bf5e5fb01fcd5221efb0156359 100644 (file)
@@ -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
index dfa12769ef7c31f54cf914ff421c6167f392a92d..8e0036279934ecec4bd6f02ca546aaef1e15e68f 100644 (file)
@@ -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)
        {