Skip to content

Commit

Permalink
riscv: Add remaining module relocations
Browse files Browse the repository at this point in the history
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 <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231101-module_relocations-v9-2-8dfa3483c400@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
  • Loading branch information
Charlie Jenkins authored and Palmer Dabbelt committed Nov 7, 2023
1 parent 8cbe0ac commit 8fd6c51
Show file tree
Hide file tree
Showing 2 changed files with 423 additions and 30 deletions.
5 changes: 4 additions & 1 deletion arch/riscv/include/uapi/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef union __riscv_fp_state elf_fpregset_t;
#define R_RISCV_TLS_DTPREL64 9
#define R_RISCV_TLS_TPREL32 10
#define R_RISCV_TLS_TPREL64 11
#define R_RISCV_IRELATIVE 58

/* Relocation types not used by the dynamic linker */
#define R_RISCV_BRANCH 16
Expand Down Expand Up @@ -81,7 +82,6 @@ typedef union __riscv_fp_state elf_fpregset_t;
#define R_RISCV_ALIGN 43
#define R_RISCV_RVC_BRANCH 44
#define R_RISCV_RVC_JUMP 45
#define R_RISCV_LUI 46
#define R_RISCV_GPREL_I 47
#define R_RISCV_GPREL_S 48
#define R_RISCV_TPREL_I 49
Expand All @@ -93,6 +93,9 @@ typedef union __riscv_fp_state elf_fpregset_t;
#define R_RISCV_SET16 55
#define R_RISCV_SET32 56
#define R_RISCV_32_PCREL 57
#define R_RISCV_PLT32 59
#define R_RISCV_SET_ULEB128 60
#define R_RISCV_SUB_ULEB128 61


#endif /* _UAPI_ASM_RISCV_ELF_H */
Loading

0 comments on commit 8fd6c51

Please sign in to comment.