From 15ca14c0b9f750caca034de96f0e980b7fa8b5c9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 21 Apr 2016 14:56:33 +0000 Subject: Fix recursive -only-needed. We were assuming that only linkonce_odr GVs were lazy linked. llvm-svn: 266995 --- llvm/lib/Linker/LinkModules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Linker/LinkModules.cpp') diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 8ed885649ca..5b713fe29fb 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -423,7 +423,7 @@ void ModuleLinker::addLazyFor(GlobalValue &GV, IRMover::ValueAdder Add) { return; // Add these to the internalize list - if (!GV.hasLinkOnceLinkage()) + if (!GV.hasLinkOnceLinkage() && !shouldLinkOnlyNeeded()) return; if (shouldInternalizeLinkedSymbols()) -- cgit v1.2.3