I have a symbol _symbol
and need to load its absolute address. But if I write
lui t1, %hi(_symbol)
addi t1, t1, %lo(_symbol)
the linker complaints just like this
relocation R_RISCV_HI20 out of range: -2251799813160077 is not in [-524288, 524287]
My question is: how can I load the address of a symbol by ABSOLUTE addressing in RISC-V asm (without GOT, since there is no dynamic linker)?
A similar question is here: How can I load the absolute address of a symbol larger than 0x7FFFFFFF in RiscV64 assembly But the solution given above does not work for me, because the load address and the destination address are also very far (> 2^32) from each other.