Closed quic-seaswara closed 1 month ago
GNU ld's error message isn't very obvious here, it says "missing matching %pcrel_hi
", presumably because it's only looking in the same section? It's not actually saying anything about not matching the psABI.
Looking at LLD's behaviour:
@llvm/issue-subscribers-lld-elf
Author: None (quic-seaswara)
@llvm/issue-subscribers-backend-risc-v
Author: None (quic-seaswara)
The following test shows that lld creates a image that has a LO relocation thats connected to a HI relocation in a different section.
The RISC-V ABI mentions this :-
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc