aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-riscv.c
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2022-08-10 22:01:41 -0700
committerFangrui Song <i@maskray.me>2022-08-10 22:01:41 -0700
commit453595283c323e106a60b229999756b45ae6b2d8 (patch)
tree35f83b4727845c99d921c14c7a724340e63b31fe /bfd/elfnn-riscv.c
parent4d74aab7aa562fe79d4669cdad0c32610531cbc0 (diff)
downloadgdb-453595283c323e106a60b229999756b45ae6b2d8.zip
gdb-453595283c323e106a60b229999756b45ae6b2d8.tar.gz
gdb-453595283c323e106a60b229999756b45ae6b2d8.tar.bz2
RISC-V: Remove R_RISCV_GNU_VTINHERIT/R_RISCV_GNU_VTENTRY
They were legacy relocation types copied from other ports. The related -fvtable-gc was removed from GCC in 2003. The associated assembler directives (.vtable_inherit and .vtable_entry) have never been supported by the RISC-V port. Remove related ld code. Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/323
Diffstat (limited to 'bfd/elfnn-riscv.c')
-rw-r--r--bfd/elfnn-riscv.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 8f9f0d8..86cb207 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -932,16 +932,6 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
- case R_RISCV_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return false;
- break;
-
- case R_RISCV_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return false;
- break;
-
default:
break;
}
@@ -950,24 +940,6 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
return true;
}
-static asection *
-riscv_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
-{
- if (h != NULL)
- switch (ELFNN_R_TYPE (rel->r_info))
- {
- case R_RISCV_GNU_VTINHERIT:
- case R_RISCV_GNU_VTENTRY:
- return NULL;
- }
-
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
-}
-
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -2027,8 +1999,7 @@ riscv_elf_relocate_section (bfd *output_bfd,
char *msg_buf = NULL;
bool resolved_to_zero;
- if (howto == NULL
- || r_type == R_RISCV_GNU_VTINHERIT || r_type == R_RISCV_GNU_VTENTRY)
+ if (howto == NULL)
continue;
/* This is a final link. */
@@ -5260,7 +5231,6 @@ riscv_elf_merge_symbol_attribute (struct elf_link_hash_entry *h,
#define elf_backend_relocate_section riscv_elf_relocate_section
#define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections
-#define elf_backend_gc_mark_hook riscv_elf_gc_mark_hook
#define elf_backend_plt_sym_val riscv_elf_plt_sym_val
#define elf_backend_grok_prstatus riscv_elf_grok_prstatus
#define elf_backend_grok_psinfo riscv_elf_grok_psinfo