mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-09 08:56:13 +08:00
Check R_*_IRELATIVE in x86 reloc_type_class
elf_{i386|x86_64}_reloc_type_class should return reloc_class_ifunc for R_386_IRELATIVE/R_X86_64_IRELATIVE relocations. There is no need to check symbol type for STN_UNDEF symbol index. * elf32-i386.c (elf_i386_reloc_type_class): Check R_386_IRELATIVE. Don't check symbol type for STN_UNDEF symbol index. * elf64-x86-64.c (elf_x86_64_reloc_type_class): Check R_X86_64_IRELATIVE. Don't check symbol type for STN_UNDEF symbol index.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2016-06-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* elf32-i386.c (elf_i386_reloc_type_class): Check R_386_IRELATIVE.
|
||||||
|
Don't check symbol type for STN_UNDEF symbol index.
|
||||||
|
* elf64-x86-64.c (elf_x86_64_reloc_type_class): Check
|
||||||
|
R_X86_64_IRELATIVE. Don't check symbol type for STN_UNDEF symbol
|
||||||
|
index.
|
||||||
|
|
||||||
2016-06-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
2016-06-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||||
|
|
||||||
* elf32-arm.c (using_thumb_only): Force review of arch check logic for
|
* elf32-arm.c (using_thumb_only): Force review of arch check logic for
|
||||||
|
@ -5562,6 +5562,8 @@ elf_i386_reloc_type_class (const struct bfd_link_info *info,
|
|||||||
/* Check relocation against STT_GNU_IFUNC symbol if there are
|
/* Check relocation against STT_GNU_IFUNC symbol if there are
|
||||||
dynamic symbols. */
|
dynamic symbols. */
|
||||||
unsigned long r_symndx = ELF32_R_SYM (rela->r_info);
|
unsigned long r_symndx = ELF32_R_SYM (rela->r_info);
|
||||||
|
if (r_symndx != STN_UNDEF)
|
||||||
|
{
|
||||||
Elf_Internal_Sym sym;
|
Elf_Internal_Sym sym;
|
||||||
if (!bed->s->swap_symbol_in (abfd,
|
if (!bed->s->swap_symbol_in (abfd,
|
||||||
(htab->dynsym->contents
|
(htab->dynsym->contents
|
||||||
@ -5572,9 +5574,12 @@ elf_i386_reloc_type_class (const struct bfd_link_info *info,
|
|||||||
if (ELF32_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
|
if (ELF32_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
|
||||||
return reloc_class_ifunc;
|
return reloc_class_ifunc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (ELF32_R_TYPE (rela->r_info))
|
switch (ELF32_R_TYPE (rela->r_info))
|
||||||
{
|
{
|
||||||
|
case R_386_IRELATIVE:
|
||||||
|
return reloc_class_ifunc;
|
||||||
case R_386_RELATIVE:
|
case R_386_RELATIVE:
|
||||||
return reloc_class_relative;
|
return reloc_class_relative;
|
||||||
case R_386_JUMP_SLOT:
|
case R_386_JUMP_SLOT:
|
||||||
|
@ -6001,9 +6001,6 @@ elf_x86_64_reloc_type_class (const struct bfd_link_info *info,
|
|||||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||||
struct elf_x86_64_link_hash_table *htab = elf_x86_64_hash_table (info);
|
struct elf_x86_64_link_hash_table *htab = elf_x86_64_hash_table (info);
|
||||||
|
|
||||||
if ((int) ELF32_R_TYPE (rela->r_info) == R_X86_64_IRELATIVE)
|
|
||||||
return reloc_class_ifunc;
|
|
||||||
|
|
||||||
if (htab->elf.dynsym != NULL
|
if (htab->elf.dynsym != NULL
|
||||||
&& htab->elf.dynsym->contents != NULL)
|
&& htab->elf.dynsym->contents != NULL)
|
||||||
{
|
{
|
||||||
@ -6026,6 +6023,8 @@ elf_x86_64_reloc_type_class (const struct bfd_link_info *info,
|
|||||||
|
|
||||||
switch ((int) ELF32_R_TYPE (rela->r_info))
|
switch ((int) ELF32_R_TYPE (rela->r_info))
|
||||||
{
|
{
|
||||||
|
case R_X86_64_IRELATIVE:
|
||||||
|
return reloc_class_ifunc;
|
||||||
case R_X86_64_RELATIVE:
|
case R_X86_64_RELATIVE:
|
||||||
case R_X86_64_RELATIVE64:
|
case R_X86_64_RELATIVE64:
|
||||||
return reloc_class_relative;
|
return reloc_class_relative;
|
||||||
|
Reference in New Issue
Block a user