aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorSergey Dmitriev <serguei.n.dmitriev@intel.com>2021-01-22 19:33:27 -0800
committerSergey Dmitriev <serguei.n.dmitriev@intel.com>2021-01-23 00:10:42 -0800
commit267a57a64572cffbb74599878bdcc9f3b678ffa3 (patch)
treee0a8a56ec0b7aef82099286ecab554da3e2e7c6d /llvm/lib/Linker/LinkModules.cpp
parent596d534ac3524052df210be8d3c01a33b2260a42 (diff)
downloadllvm-267a57a64572cffbb74599878bdcc9f3b678ffa3.zip
llvm-267a57a64572cffbb74599878bdcc9f3b678ffa3.tar.gz
llvm-267a57a64572cffbb74599878bdcc9f3b678ffa3.tar.bz2
[llvm-link] Fix for an assertion when linking global with appending linkage
This patch fixes llvm-link assertion when linking external variable declaration with a definition with appending linkage. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D95126
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 35d6290..98793c5 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -248,7 +248,7 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFromSrc,
}
// We always have to add Src if it has appending linkage.
- if (Src.hasAppendingLinkage()) {
+ if (Src.hasAppendingLinkage() || Dest.hasAppendingLinkage()) {
LinkFromSrc = true;
return false;
}