[lld] [lld] Add infrastructure for handling RISCV vendor-specific relocations. (PR #159987)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 21 19:21:15 PDT 2025


resistor wrote:

> * 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 don't think we need to remap it to an enum at this stage, because the target is going to provide a `RelExpr` that can encode whatever it needs to. I don't think adding an explicit vendor field adds expressiveness on top of the pair of `RelType` + `RelExpr`.

https://github.com/llvm/llvm-project/pull/159987


More information about the llvm-commits mailing list