[llvm] [RISCV] Vendor Relocations for Xqci extension (PR #135400)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 08:47:13 PDT 2025


================
@@ -660,6 +699,14 @@ bool RISCVAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
   if (IsResolved &&
       (getFixupKindInfo(Fixup.getKind()).Flags & MCFixupKindInfo::FKF_IsPCRel))
     IsResolved = isPCRelFixupResolved(Target.getAddSym(), F);
+
+  // Some Fixups require a vendor relocation, record it (directly) before we add
+  // the relocation.
+  if (!IsResolved || shouldForceRelocation(Fixup, Target)) {
----------------
MaskRay wrote:

If we are going to call `shouldForceRelocation`, just avoid the generic `MCAsmBackend::addReloc` and call the underlying `recordRelocation` directly.

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


More information about the llvm-commits mailing list