[llvm-branch-commits] [lld] [NFC][ELF] Create fresh alias in handleNonPreemptibleIfunc (PR #210614)
Jessica Clarke via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Jul 19 09:33:50 PDT 2026
https://github.com/jrtc27 created https://github.com/llvm/llvm-project/pull/210614
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.
---
<sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
>From 50c55bc6e1e527833b26f19835f2f7c7ab32c332 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 71daf6fb95a8f..88657709b5e8b 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -1254,7 +1254,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