From b09f5054454d99002a69aa57b7c19094aadde9ad Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Wed, 25 Dec 2013 16:46:27 +0000 Subject: [PATCH] [ASan] Fix the test for __asan_gen_ globals and actually fix http://llvm.org/bugs/show_bug.cgi?id=17976 by setting the correct linkage (as stated in the bug). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198018 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 72825f5f6f4..511c63b5eb9 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -562,13 +562,13 @@ static GlobalVariable *createPrivateGlobalForString( Module &M, StringRef Str, bool AllowMerging) { Constant *StrConst = ConstantDataArray::getString(M.getContext(), Str); // For module-local strings that can be merged with another one we set the - // internal linkage and the unnamed_addr attribute. + // private linkage and the unnamed_addr attribute. // Non-mergeable strings are made linker_private to remove them from the // symbol table. "private" linkage doesn't work for Darwin, where the // "L"-prefixed globals end up in __TEXT,__const section // (see http://llvm.org/bugs/show_bug.cgi?id=17976 for more info). GlobalValue::LinkageTypes linkage = - AllowMerging ? GlobalValue::InternalLinkage + AllowMerging ? GlobalValue::PrivateLinkage : GlobalValue::LinkerPrivateLinkage; GlobalVariable *GV = new GlobalVariable(M, StrConst->getType(), true, -- 2.34.1