[llvm] [RISCV] Add support for vendor relocations on Xqci extensions (PR #135400)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 17:17:18 PDT 2025


================
@@ -1435,6 +1435,21 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm,
                         : C;
   FixedValue = usesRela(TO, FixupSection) ? 0 : Addend;
 
+  // Some RISC-V relocations need a marker relocation that appears before the
+  // relocation in question.
+  unsigned PreRelocType;
+  MCSymbol *PreRelocSymbol;
+  uint64_t PreRelocAddend;
+  if (Backend.fixupNeedsMarkerELFRelocation(Asm, *Fragment, Fixup, PreRelocType,
----------------
MaskRay wrote:

You could customize `evaluateTargetFixup`. If the fixup is not resolved, call `recordRelocation` to append the marker relocation, and then rely on the default `recordRelocation` in `evaluateFixup` to append the actual relocation.

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


More information about the llvm-commits mailing list