Skip to content

Commit c480d89

Browse files
Zong Lipalmer-dabbelt
authored andcommitted
RISC-V: Add definiion of extract symbol's index and type for 32-bit
Use generic marco to get the index and type of symbol. Signed-off-by: Zong Li <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 8f79125 commit c480d89

File tree

1 file changed

+7
-2
lines changed
  • arch/riscv/include/uapi/asm

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ typedef struct user_regs_struct elf_gregset_t;
2121

2222
typedef union __riscv_fp_state elf_fpregset_t;
2323

24-
#define ELF_RISCV_R_SYM(r_info) ((r_info) >> 32)
25-
#define ELF_RISCV_R_TYPE(r_info) ((r_info) & 0xffffffff)
24+
#if __riscv_xlen == 64
25+
#define ELF_RISCV_R_SYM(r_info) ELF64_R_SYM(r_info)
26+
#define ELF_RISCV_R_TYPE(r_info) ELF64_R_TYPE(r_info)
27+
#else
28+
#define ELF_RISCV_R_SYM(r_info) ELF32_R_SYM(r_info)
29+
#define ELF_RISCV_R_TYPE(r_info) ELF32_R_TYPE(r_info)
30+
#endif
2631

2732
/*
2833
* RISC-V relocation types

0 commit comments

Comments
 (0)