diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-05-07 14:10:51 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-05-07 14:10:51 +0000 |
| commit | c14fc4213783e17d00f04f66aa556e9afdc3963b (patch) | |
| tree | 4a0c985ef9010194143ed2a53c3b6658b626985d /llvm | |
| parent | 88a51d983e28afff557356ef60d1cb8693e4c052 (diff) | |
| download | bcm5719-llvm-c14fc4213783e17d00f04f66aa556e9afdc3963b.tar.gz bcm5719-llvm-c14fc4213783e17d00f04f66aa556e9afdc3963b.zip | |
[msan] Fix -fsanitize=memory -fno-integrated-as.
llvm-svn: 208211
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index d8e65102b56..b8e632ead10 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -410,7 +410,7 @@ void MemorySanitizer::initializeCallbacks(Module &M) { ClWrapIndirectCalls, AnyFunctionPtrTy, AnyFunctionPtrTy, NULL); } - if (ClWrapIndirectCallsFast) { + if (WrapIndirectCalls && ClWrapIndirectCallsFast) { MsandrModuleStart = new GlobalVariable( M, IRB.getInt32Ty(), false, GlobalValue::ExternalLinkage, nullptr, "__executable_start"); diff --git a/llvm/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll b/llvm/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll new file mode 100644 index 00000000000..7d0a62a256c --- /dev/null +++ b/llvm/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll @@ -0,0 +1,21 @@ +; Test that MSan does not emit undefined symbol __executable_start when it is +; not needed (i.e. without -msan-wrap-indirect-calls). + +; RUN: opt < %s -msan -S | FileCheck %s + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: nounwind uwtable +define void @_Z1fv() #0 { +entry: + ret void +} + +attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } + +!llvm.ident = !{!0} + +!0 = metadata !{metadata !"clang version 3.5.0 (208165)"} + +; CHECK-NOT: __executable_start |

