summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorRyan Govostes <rzg@apple.com>2016-07-05 21:53:08 +0000
committerRyan Govostes <rzg@apple.com>2016-07-05 21:53:08 +0000
commite51401bdab3405f1d4aac4b1c4060a5b235be44a (patch)
tree3dfff14680187e987de6cb3df86cb29411d24ee9 /llvm/lib/Transforms
parent0cd68276a15015e98d470d753a3fc84c59663799 (diff)
downloadbcm5719-llvm-e51401bdab3405f1d4aac4b1c4060a5b235be44a.tar.gz
bcm5719-llvm-e51401bdab3405f1d4aac4b1c4060a5b235be44a.zip
[asan] Add a hidden option for Mach-O global metadata liveness tracking
llvm-svn: 274578
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 451f497b968..43d1b377f85 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -245,6 +245,13 @@ static cl::opt<bool>
" variables"),
cl::Hidden, cl::init(false));
+static cl::opt<bool>
+ ClUseMachOGlobalsSection("asan-globals-live-support",
+ cl::desc("Use linker features to support dead "
+ "code stripping of globals "
+ "(Mach-O only)"),
+ cl::Hidden, cl::init(false));
+
// Debug flags.
static cl::opt<int> ClDebug("asan-debug", cl::desc("debug"), cl::Hidden,
cl::init(0));
@@ -1338,6 +1345,9 @@ bool AddressSanitizerModule::ShouldInstrumentGlobal(GlobalVariable *G) {
// binary in order to allow the linker to properly dead strip. This is only
// supported on recent versions of ld64.
bool AddressSanitizerModule::ShouldUseMachOGlobalsSection() const {
+ if (!ClUseMachOGlobalsSection)
+ return false;
+
if (!TargetTriple.isOSBinFormatMachO())
return false;
OpenPOWER on IntegriCloud