[lld] [lld] Add infrastructure for handling RISCV vendor-specific relocations. (PR #159987)
Sam Elliott via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 21 14:27:47 PDT 2025
lenary wrote:
Some ideas, probably incoherent:
- One thought is to type-erase the signature of getRelExpr(…), maybe? Something like `void * arch_specific`, which we know on RISC-V is a vendor string but on other arches could be any pointer type.
- For RISC-V I'm actually not sure we want to keep this as a string. I think we might prefer to map the vendor strings into an enum? We might also want to store the vendor enum value with the relocation data? I'm not sure. An enum might be small and general enough to store in the `Relocation` type (it looks like there might be space?). We could still type-erase the enum to a `unsigned` or similar, for the other targets.
I agree with Jessica that I don't think a RISC-V specific string on the public interface is great, especially as it's basically seeping into only one part of the interface for relocations, rather than being something more universal.
https://github.com/llvm/llvm-project/pull/159987
More information about the llvm-commits
mailing list