llvm.org GIT mirror llvm / 4205e17
[asan] Add a hidden option for Mach-O global metadata liveness tracking git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274578 91177308-0d34-0410-b5e6-96231b3b80d8 Ryan Govostes 4 years ago
2 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
244244 " variables"),
245245 cl::Hidden, cl::init(false));
246246
247 static cl::opt
248 ClUseMachOGlobalsSection("asan-globals-live-support",
249 cl::desc("Use linker features to support dead "
250 "code stripping of globals "
251 "(Mach-O only)"),
252 cl::Hidden, cl::init(false));
253
247254 // Debug flags.
248255 static cl::opt ClDebug("asan-debug", cl::desc("debug"), cl::Hidden,
249256 cl::init(0));
13371344 // binary in order to allow the linker to properly dead strip. This is only
13381345 // supported on recent versions of ld64.
13391346 bool AddressSanitizerModule::ShouldUseMachOGlobalsSection() const {
1347 if (!ClUseMachOGlobalsSection)
1348 return false;
1349
13401350 if (!TargetTriple.isOSBinFormatMachO())
13411351 return false;
13421352
11 ; allowing dead stripping to be performed, and that the appropriate runtime
22 ; routines are invoked.
33
4 ; RUN: opt < %s -asan -asan-module -S | FileCheck %s
4 ; RUN: opt < %s -asan -asan-module -asan-globals-live-support -S | FileCheck %s
55
66 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
77 target triple = "x86_64-apple-macosx10.11.0"