![]() ![]() Though you may want to read the entire blog series. This assumes you are compiling using -mcmodel=medany which allows code outside the low 2GB of address space. However, it would be easier to just use the lla macro. If the code and symbol are within 2GB of each other, but not in the lowest 2GB of address space, then you can use auipc and %pcrel_hi along with %pcrel_lo. ![]() ![]() Perhaps you are putting the symbol or code somewhere else in the address space? %hi requires that both the symbol and the code referencing it are in the low 2GB of the address space. The R_RISCV_HI20 error means that the symbol in too far away from the code for the %hi relocation to reach. Otherwise I have to make an educated guess. In general, I need an example that can be used to reproduce the error to see what is really going on. To use this converter, take the following steps. rodata.sbox which suggests the real code is substantially different than your example code. This free online converter lets you convert code from Assembly to C in a click of a button. Move that definition outside main to get a symbol. Your code sample doesn’t compile, and is defining sbox inside main, which means it will end up on the stack, so there is no symbol for the assembly code to refer to. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |