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

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 16:32:02 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,
----------------
lenary wrote:

I have made the change, and commented about the duplicated code, which I don't like having to copy-paste. There is also complex logic working out when `IsResolved` might not be enough of a signal that a relocation is required, especially as RISC-V forces relocations during relaxation (which is also hard to test).



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


More information about the llvm-commits mailing list