llvm.org GIT mirror llvm / 7cf2a04
fall back to explicit list of allowed linkages when instrumenting globals in asan; add a test check that asan does not touch linkonce_odr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144933 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 7 years ago
2 changed file(s) with 11 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
447447
448448 if (!Ty->isSized()) continue;
449449 if (!G->hasInitializer()) continue;
450 if (GlobalVariable::mayBeOverridden(G->getLinkage()) ||
451 G->getLinkage() == GlobalVariable::AppendingLinkage)
450 // Touch only those globals that will not be defined in other modules.
451 // Don't handle ODR type linkages since other modules may be built w/o asan.
452 if (G->getLinkage() != GlobalVariable::GlobalVariable::ExternalLinkage &&
453 G->getLinkage() != GlobalVariable::GlobalVariable::PrivateLinkage &&
454 G->getLinkage() != GlobalVariable::GlobalVariable::InternalLinkage)
452455 continue;
453456 // For now, just ignore this Alloca if the alignment is large.
454457 if (G->getAlignment() > RedzoneSize) continue;
0 ; RUN: opt < %s -asan -S | FileCheck %s
1 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
2 target triple = "x86_64-unknown-linux-gnu"
3 ; no action should be taken for these globals
4 @v1 = linkonce_odr constant i8 1
5 ; CHECK-NOT: __asan_register_globals