summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-link/llvm-link.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-21 01:59:39 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-21 01:59:39 +0000
commitbda3c97c16916c6a0b94b01f59acbc98b845e7b6 (patch)
tree339b70f7a990ae6e5fcab669525a1c2f2bedce91 /llvm/tools/llvm-link/llvm-link.cpp
parentc196531ef304725afdf1de11bbb544639ef56b80 (diff)
downloadbcm5719-llvm-bda3c97c16916c6a0b94b01f59acbc98b845e7b6.tar.gz
bcm5719-llvm-bda3c97c16916c6a0b94b01f59acbc98b845e7b6.zip
ThinLTO/ModuleLinker: add a flag to not always pull-in linkonce when performing importing
Summary: The function importer already decided what symbols need to be pulled in. Also these magically added ones will not be in the export list for the source module, which can confuse the internalizer for instance. Reviewers: tejohnson, rafael Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19096 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266948
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