diff --git a/llvm/lib/Transforms/Utils/SplitModule.cpp b/llvm/lib/Transforms/Utils/SplitModule.cpp old mode 100755 new mode 100644 diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp index 232051130cb2..55c0f48aeada 100644 --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/tools/llvm-lto/llvm-lto.cpp @@ -98,6 +98,10 @@ static cl::opt SetMergedModule( static cl::opt Parallelism("j", cl::Prefix, cl::init(1), cl::desc("Number of backend threads")); +static cl::opt RestoreGlobalsLinkage( + "restore-linkage", cl::init(false), + cl::desc("Restore original linkage of globals prior to CodeGen")); + namespace { struct ModuleInfo { std::vector CanBeHidden; @@ -278,6 +282,7 @@ int main(int argc, char **argv) { CodeGen.setDebugInfo(LTO_DEBUG_MODEL_DWARF); CodeGen.setTargetOptions(Options); + CodeGen.setShouldRestoreGlobalsLinkage(RestoreGlobalsLinkage); llvm::StringSet DSOSymbolsSet; for (unsigned i = 0; i < DSOSymbols.size(); ++i)