summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-link/llvm-link.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-link/llvm-link.cpp')
-rw-r--r--llvm/tools/llvm-link/llvm-link.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index 73ac8727e71..0e720bd06ea 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/tools/llvm-link/llvm-link.cpp
@@ -276,8 +276,10 @@ static bool importFunctions(const char *argv0, LLVMContext &Context,
if (renameModuleForThinLTO(*SrcModule, *Index, &GlobalsToImport))
return true;
- if (L.linkInModule(std::move(SrcModule), Linker::Flags::None,
- &GlobalsToImport))
+ // Instruct the linker to not automatically import linkonce defintion.
+ unsigned Flags = Linker::Flags::DontForceLinkLinkonceODR;
+
+ if (L.linkInModule(std::move(SrcModule), Flags, &GlobalsToImport))
return false;
}
OpenPOWER on IntegriCloud