[llvm] RISCV: Remove shouldForceRelocation and unneeded relocations (PR #140692)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 13:38:47 PDT 2025


================
@@ -450,8 +450,10 @@ void MCELFStreamer::emitInstToData(const MCInst &Inst,
   auto Fixups = MutableArrayRef(DF->getFixups()).slice(FixupStartIndex);
   for (auto &Fixup : Fixups) {
     Fixup.setOffset(Fixup.getOffset() + CodeOffset);
-    if (Fixup.needsRelax())
+    if (Fixup.isLinkerRelaxable()) {
       DF->setLinkerRelaxable();
----------------
lenary wrote:

Nit: Doesn't a DF have a single parent section? Maybe `DF->setLinkerRelaxable()` should also set it on its parent, rather than having to remember both calls here.

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


More information about the llvm-commits mailing list