aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNelson Chu <nelson@rivosinc.com>2023-11-06 13:28:51 +0800
committerNelson Chu <nelson@rivosinc.com>2023-11-06 17:21:42 +0800
commit0c4b8ed69c5713e567b6c1d866f6d8cdb9de11f7 (patch)
treeb91bc71c219063a5873b1a5c6a2190d8f0e11638 /include
parenta3f007ea284e971e5472b8ec4f90be3711a2aa4c (diff)
downloadbinutils-0c4b8ed69c5713e567b6c1d866f6d8cdb9de11f7.zip
binutils-0c4b8ed69c5713e567b6c1d866f6d8cdb9de11f7.tar.gz
binutils-0c4b8ed69c5713e567b6c1d866f6d8cdb9de11f7.tar.bz2
RISC-V: Moved out linker internal relocations after R_RISCV_max.
Just the lightest modifications about this, without any further checks and considering --emit-relocs. We will need to improve it in the future, but first do this to avoid conflicts between linker internal relocations and the new definition of psabi. For example, TLSDESC relocs. Passed riscv-gnu-toolchain regressions, so should be safe enough to commit. Co-authored-by: Tsukasa OI <research_trasio@irq.a4lg.com> bfd/ * reloc.c: Removed linker internal relocations. * bfd-in2.h: Regenerated. * libbfd.h: Regenerated. * elfnn-riscv.c: Defined R_RISCV_DELETE in include/elf/riscv.h. * elfxx-riscv.c (howto_table, howto_table_internal): Moved linker internal relocations from howto_table into howto_table_internal. (riscv_reloc_map): Removed linker internal relocations mapping. (riscv_elf_rtype_to_howto): Return howto of linker internal relocations from howto_table_internal. include/ * elf/riscv.h: Defined linker internal relocations after R_RISCV_max.
Diffstat (limited to 'include')
-rw-r--r--include/elf/riscv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/elf/riscv.h b/include/elf/riscv.h
index 0aa8b33..56d419c 100644
--- a/include/elf/riscv.h
+++ b/include/elf/riscv.h
@@ -92,6 +92,14 @@ START_RELOC_NUMBERS (elf_riscv_reloc_type)
RELOC_NUMBER (R_RISCV_SUB_ULEB128, 61)
END_RELOC_NUMBERS (R_RISCV_max)
+/* Internal relocations used exclusively by the relaxation pass. */
+#define R_RISCV_DELETE (R_RISCV_max)
+#define R_RISCV_RVC_LUI (R_RISCV_max + 1)
+#define R_RISCV_GPREL_I (R_RISCV_max + 2)
+#define R_RISCV_GPREL_S (R_RISCV_max + 3)
+#define R_RISCV_TPREL_I (R_RISCV_max + 4)
+#define R_RISCV_TPREL_S (R_RISCV_max + 5)
+
/* Processor specific flags for the ELF header e_flags field. */
/* File may contain compressed instructions. */