[llvm] r208211 - [msan] Fix -fsanitize=memory -fno-integrated-as.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed May 7 07:10:51 PDT 2014


Author: eugenis
Date: Wed May  7 09:10:51 2014
New Revision: 208211

URL: http://llvm.org/viewvc/llvm-project?rev=208211&view=rev
Log:
[msan] Fix -fsanitize=memory -fno-integrated-as.


Added:
    llvm/trunk/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll
Modified:
    llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=208211&r1=208210&r2=208211&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Wed May  7 09:10:51 2014
@@ -410,7 +410,7 @@ void MemorySanitizer::initializeCallback
         ClWrapIndirectCalls, AnyFunctionPtrTy, AnyFunctionPtrTy, NULL);
   }
 
-  if (ClWrapIndirectCallsFast) {
+  if (WrapIndirectCalls && ClWrapIndirectCallsFast) {
     MsandrModuleStart = new GlobalVariable(
         M, IRB.getInt32Ty(), false, GlobalValue::ExternalLinkage,
         nullptr, "__executable_start");

Added: llvm/trunk/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll?rev=208211&view=auto
==============================================================================
--- llvm/trunk/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll (added)
+++ llvm/trunk/test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll Wed May  7 09:10:51 2014
@@ -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





More information about the llvm-commits mailing list