diff options
author | Zong Li <zong@andestech.com> | 2018-06-25 10:49:39 +0200 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2018-07-04 22:54:08 +0200 |
commit | c480d8911fda96a0f37634bd4dc4e2c8a87c38da (patch) | |
tree | 0396bb93f7a592b5bd5c436d777be4d714a7f573 /arch/riscv/include/uapi | |
parent | RISC-V: Select GENERIC_UCMPDI2 on RV32I (diff) | |
download | linux-c480d8911fda96a0f37634bd4dc4e2c8a87c38da.tar.xz linux-c480d8911fda96a0f37634bd4dc4e2c8a87c38da.zip |
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 <zong@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/include/uapi')
-rw-r--r-- | arch/riscv/include/uapi/asm/elf.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/riscv/include/uapi/asm/elf.h b/arch/riscv/include/uapi/asm/elf.h index 5cae4c30cd8e..1e0dfc36aab9 100644 --- a/arch/riscv/include/uapi/asm/elf.h +++ b/arch/riscv/include/uapi/asm/elf.h @@ -21,8 +21,13 @@ typedef struct user_regs_struct elf_gregset_t; typedef union __riscv_fp_state elf_fpregset_t; -#define ELF_RISCV_R_SYM(r_info) ((r_info) >> 32) -#define ELF_RISCV_R_TYPE(r_info) ((r_info) & 0xffffffff) +#if __riscv_xlen == 64 +#define ELF_RISCV_R_SYM(r_info) ELF64_R_SYM(r_info) +#define ELF_RISCV_R_TYPE(r_info) ELF64_R_TYPE(r_info) +#else +#define ELF_RISCV_R_SYM(r_info) ELF32_R_SYM(r_info) +#define ELF_RISCV_R_TYPE(r_info) ELF32_R_TYPE(r_info) +#endif /* * RISC-V relocation types |