This patch supports R_RISCV_SET* and R_RISCV_32_PCREL relocations in JITLink.
You can write tests just fine in assembly. Use .reloc if needed. You don't need .eh_frame for that.
These are all missing a /
These all operate on an 8/16/32-bit value (SET6 operates on the low 6 bits of an 8-bit value). These do not relocate instructions, they relocate data. Again, please look at LLD before implementing things rather than guessing.
This is not an R_RISCV_SET* relocation, yet the commit message says that's that is added
*that's all that is added
Sorry for my stupid mistakes.
I'm planning to upload a new diff, however, I'm still confused about the .reloc.
It appears that it only adds a R_RISCV_SET* relocation in the binary.
I'm checking lld/test/ELF/riscv-reloc-add.s and D63183, and got no idea on how to set the value.
Particularly, D63183 says,
Note llvm-mc cannot currently produce R_RISCV_SET* so they are not tested.
And the test case now still does not add R_RISCV_SET* test.
Would you be so kind to give some hints on how to test it?
That comment likely predates .reloc support for RISC-V. You use .reloc like:
.reloc 1f, R_RISCV_SET6, foo 1: .byte 0
i.e. it takes the location to relocate, the relocation name and the value to use