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.
This commit is contained in:
H.J. Lu
2015-11-10 04:26:55 -08:00
parent 2d5da47320
commit 18954b29a1
3 changed files with 16 additions and 2 deletions

View 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> 2015-11-10 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_relocate_section): Properly move * elf32-i386.c (elf_i386_relocate_section): Properly move

View File

@ -3647,7 +3647,11 @@ elf_i386_relocate_section (bfd *output_bfd,
r_type = ELF32_R_TYPE (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == R_386_GNU_VTINHERIT if (r_type == R_386_GNU_VTINHERIT
|| r_type == R_386_GNU_VTENTRY) || r_type == R_386_GNU_VTENTRY)
{
if (wrel != rel)
*wrel = *rel;
continue; continue;
}
if ((indx = r_type) >= R_386_standard if ((indx = r_type) >= R_386_standard
&& ((indx = r_type - R_386_ext_offset) - R_386_standard && ((indx = r_type - R_386_ext_offset) - R_386_standard

View File

@ -3904,7 +3904,11 @@ elf_x86_64_relocate_section (bfd *output_bfd,
r_type = ELF32_R_TYPE (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == (int) R_X86_64_GNU_VTINHERIT if (r_type == (int) R_X86_64_GNU_VTINHERIT
|| r_type == (int) R_X86_64_GNU_VTENTRY) || r_type == (int) R_X86_64_GNU_VTENTRY)
{
if (wrel != rel)
*wrel = *rel;
continue; continue;
}
if (r_type >= (int) R_X86_64_standard) if (r_type >= (int) R_X86_64_standard)
{ {