Skip to content

Commit 8fd6c51

Browse files
charlie-rivospalmer-dabbelt
authored andcommitted
riscv: Add remaining module relocations
Add all final module relocations and add error logs explaining the ones that are not supported. Implement overflow checks for ADD/SUB/SET/ULEB128 relocations. Signed-off-by: Charlie Jenkins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 8cbe0ac commit 8fd6c51

File tree

2 files changed

+423
-30
lines changed

2 files changed

+423
-30
lines changed

arch/riscv/include/uapi/asm/elf.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef union __riscv_fp_state elf_fpregset_t;
4949
#define R_RISCV_TLS_DTPREL64 9
5050
#define R_RISCV_TLS_TPREL32 10
5151
#define R_RISCV_TLS_TPREL64 11
52+
#define R_RISCV_IRELATIVE 58
5253

5354
/* Relocation types not used by the dynamic linker */
5455
#define R_RISCV_BRANCH 16
@@ -81,7 +82,6 @@ typedef union __riscv_fp_state elf_fpregset_t;
8182
#define R_RISCV_ALIGN 43
8283
#define R_RISCV_RVC_BRANCH 44
8384
#define R_RISCV_RVC_JUMP 45
84-
#define R_RISCV_LUI 46
8585
#define R_RISCV_GPREL_I 47
8686
#define R_RISCV_GPREL_S 48
8787
#define R_RISCV_TPREL_I 49
@@ -93,6 +93,9 @@ typedef union __riscv_fp_state elf_fpregset_t;
9393
#define R_RISCV_SET16 55
9494
#define R_RISCV_SET32 56
9595
#define R_RISCV_32_PCREL 57
96+
#define R_RISCV_PLT32 59
97+
#define R_RISCV_SET_ULEB128 60
98+
#define R_RISCV_SUB_ULEB128 61
9699

97100

98101
#endif /* _UAPI_ASM_RISCV_ELF_H */

0 commit comments

Comments
 (0)