[lld] [ELF] Don't relax PLT32 for branches from small into large code on x86-64 (PR #216409)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 03:06:35 PDT 2026


================
@@ -757,8 +757,14 @@ static void addPltEntry(Ctx &ctx, PltSection &plt, GotPltSection &gotPlt,
     return;
   }
   gotPlt.addEntry(sym);
-  rel.addReloc(
-      {type, &gotPlt, sym.getGotPltOffset(ctx), isPreemptible, sym, 0, expr});
+  uint64_t off = sym.getGotPltOffset(ctx);
+  // Non-PIC needs no runtime fixup; the slot is a link-time constant.
+  if (!isPreemptible && type == ctx.target->relativeRel &&
+      (!ctx.arg.isPic || isAbsolute(sym))) {
+    gotPlt.addReloc({R_ABS, ctx.target->symbolicRel, off, 0, &sym});
+    return;
+  }
----------------
jrtc27 wrote:

What on earth is this?

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


More information about the llvm-commits mailing list