[llvm-branch-commits] [lld] [NFC][ELF] Create fresh alias in handleNonPreemptibleIfunc (PR #210614)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Jul 19 09:34:34 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld-elf
Author: Jessica Clarke (jrtc27)
<details>
<summary>Changes</summary>
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>
---
Full diff: https://github.com/llvm/llvm-project/pull/210614.diff
1 Files Affected:
- (modified) lld/ELF/Relocations.cpp (+3-1)
``````````diff
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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/210614
More information about the llvm-branch-commits
mailing list