Skip to content

Commit

Permalink
[msan] Fix -fsanitize=memory -fno-integrated-as.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208211 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
eugenis committed May 7, 2014
1 parent 04a359f commit 8a387a7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
21 changes: 21 additions & 0 deletions test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8a387a7

Please sign in to comment.