diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2024-10-01 15:47:05 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2024-10-01 15:47:05 +0200 |
commit | 4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch) | |
tree | ebf009bf1376a5a223a915bc27cbbd791a1316bc /arch/riscv64/reloc.h |
Initial version
Diffstat (limited to 'arch/riscv64/reloc.h')
-rw-r--r-- | arch/riscv64/reloc.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/riscv64/reloc.h b/arch/riscv64/reloc.h new file mode 100644 index 0000000..7c7c061 --- /dev/null +++ b/arch/riscv64/reloc.h @@ -0,0 +1,23 @@ +#if defined __riscv_float_abi_soft +#define RISCV_FP_SUFFIX "-sf" +#elif defined __riscv_float_abi_single +#define RISCV_FP_SUFFIX "-sp" +#elif defined __riscv_float_abi_double +#define RISCV_FP_SUFFIX "" +#endif + +#define LDSO_ARCH "riscv64" RISCV_FP_SUFFIX + +#define TPOFF_K 0 + +#define REL_SYMBOLIC R_RISCV_64 +#define REL_PLT R_RISCV_JUMP_SLOT +#define REL_RELATIVE R_RISCV_RELATIVE +#define REL_COPY R_RISCV_COPY +#define REL_DTPMOD R_RISCV_TLS_DTPMOD64 +#define REL_DTPOFF R_RISCV_TLS_DTPREL64 +#define REL_TPOFF R_RISCV_TLS_TPREL64 +#define REL_TLSDESC R_RISCV_TLSDESC + +#define CRTJMP(pc,sp) __asm__ __volatile__( \ + "mv sp, %1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" ) |