mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
Fix elf_x86_64_reloc_type_class
This commit is contained in:
@ -6001,12 +6001,17 @@ 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)
|
||||||
{
|
{
|
||||||
/* 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 = htab->r_sym (rela->r_info);
|
unsigned long r_symndx = htab->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->elf.dynsym->contents
|
(htab->elf.dynsym->contents
|
||||||
@ -6017,6 +6022,7 @@ elf_x86_64_reloc_type_class (const struct bfd_link_info *info,
|
|||||||
if (ELF_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
|
if (ELF_ST_TYPE (sym.st_info) == STT_GNU_IFUNC)
|
||||||
return reloc_class_ifunc;
|
return reloc_class_ifunc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch ((int) ELF32_R_TYPE (rela->r_info))
|
switch ((int) ELF32_R_TYPE (rela->r_info))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user