aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-14 10:18:26 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-14 10:18:26 -0700
commitc428ce9d900c4acc4a7ee74791c55676d96f0818 (patch)
treef77e647801adfd85b194c879826da7ef08fb7ae2 /bfd/elf64-x86-64.c
parent897463b12ba936df7d2070755eaac94f87fcedfb (diff)
downloadgdb-c428ce9d900c4acc4a7ee74791c55676d96f0818.zip
gdb-c428ce9d900c4acc4a7ee74791c55676d96f0818.tar.gz
gdb-c428ce9d900c4acc4a7ee74791c55676d96f0818.tar.bz2
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.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index f8a7ca3..b209604 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -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);
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
&& 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))
{
+ case R_X86_64_IRELATIVE:
+ return reloc_class_ifunc;
case R_X86_64_RELATIVE:
case R_X86_64_RELATIVE64:
return reloc_class_relative;