[llvm-branch-commits] [lld] [NFC][ELF] Create fresh alias in handleNonPreemptibleIfunc (PR #210614)
Fangrui Song via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Aug 2 12:40:09 PDT 2026
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/210614
>From 4ee575b1ff85abffa243f254b7defa2714f0c998 Mon Sep 17 00:00:00 2001
From: Jessica Clarke <jrtc27 at jrtc27.com>
Date: Sun, 19 Jul 2026 14:14:37 +0100
Subject: [PATCH] [NFC][ELF] Create fresh alias in handleNonPreemptibleIfunc
We don't need to copy the full symbol here, we just want an internal
alias to use for the IPLT and IGOTPLT entries and IRELATIVE relocation's
addend.
---
lld/ELF/Relocations.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index fd852e3dba1ae..f2d582874c043 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -1256,7 +1256,9 @@ static bool handleNonPreemptibleIfunc(Ctx &ctx, Symbol &sym, uint16_t flags) {
if (flags & HAS_DIRECT_RELOC) {
// Change the value to the IPLT and redirect all references to it.
auto &d = cast<Defined>(sym);
- auto *irelativeSym = makeDefined(d);
+ auto *irelativeSym = makeDefined(
+ ctx, d.file, d.getName(), std::as_const(d).binding, d.stOther,
+ std::as_const(d).type, d.value, d.size, d.section);
addIpltEntry(*irelativeSym);
ctx.irelativeSyms.push_back(irelativeSym);
sym.isInIplt = true;
More information about the llvm-branch-commits
mailing list