]> granicus.if.org Git - llvm/commitdiff
[asan] Change the visibility of ___asan_globals_registered to hidden
authorKuba Mracek <mracek@apple.com>
Fri, 6 Jan 2017 22:02:58 +0000 (22:02 +0000)
committerKuba Mracek <mracek@apple.com>
Fri, 6 Jan 2017 22:02:58 +0000 (22:02 +0000)
This flag is used to track global registration in Mach-O and it doesn't need to be exported and visible.

Differential Revision: https://reviews.llvm.org/D28250

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291289 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 1d552839877666f493a4801820d08874466cfc73..54bdc9e0772b57fa19f3b0b8e16bf71506a9c5ad 100644 (file)
@@ -1818,6 +1818,7 @@ bool AddressSanitizerModule::InstrumentGlobals(IRBuilder<> &IRB, Module &M) {
     RegisteredFlag = new GlobalVariable(
         M, IntptrTy, false, GlobalVariable::CommonLinkage,
         ConstantInt::get(IntptrTy, 0), kAsanGlobalsRegisteredFlagName);
+    RegisteredFlag->setVisibility(GlobalVariable::HiddenVisibility);
 
     // Update llvm.compiler.used, adding the new liveness globals. This is
     // needed so that during LTO these variables stay alive. The alternative