[llvm-branch-commits] [lld] [PAC][lld] Do not emit AUTH relocs against undef weak non-preemptible symbols (PR #194636)

Peter Smith via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 4 09:51:11 PDT 2026


================
@@ -793,9 +793,12 @@ static void addGotAuthEntry(Ctx &ctx, Symbol &sym) {
     return;
   }
 
-  // Signed GOT requires dynamic relocation.
-  ctx.in.relaDyn->addReloc(
-      {R_AARCH64_AUTH_RELATIVE, ctx.in.got.get(), off, false, sym, 0, R_ABS});
+  // Signed GOT requires dynamic relocation unless the symbol is
+  // non-preemptible and undefined weak.
+  if (!sym.isUndefWeak()) {
----------------
smithp35 wrote:

I think lld coding style would be to omit the curly braces. Apologies for the nit.
``` 
if (!sym.isUndefWeak())
  ctx.in.relaDyn->addReloc(
        {R_AARCH64_AUTH_RELATIVE, ctx.in.got.get(), off, false, sym, 0, R_ABS});

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


More information about the llvm-branch-commits mailing list