[compiler-rt] r195643 - [lsan] Add a missing file.
Sergey Matveev
earthdok at google.com
Mon Nov 25 06:30:37 PST 2013
Author: smatveev
Date: Mon Nov 25 08:30:37 2013
New Revision: 195643
URL: http://llvm.org/viewvc/llvm-project?rev=195643&view=rev
Log:
[lsan] Add a missing file.
Added:
compiler-rt/trunk/lib/lsan/lsan_preinit.cc
Added: compiler-rt/trunk/lib/lsan/lsan_preinit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_preinit.cc?rev=195643&view=auto
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_preinit.cc (added)
+++ compiler-rt/trunk/lib/lsan/lsan_preinit.cc Mon Nov 25 08:30:37 2013
@@ -0,0 +1,22 @@
+//===-- lsan_preinit.cc ---------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of LeakSanitizer.
+//
+// Call __lsan_init at the very early stage of process startup.
+//===----------------------------------------------------------------------===//
+
+#include "lsan.h"
+
+#if !defined(PIC)
+ // We force __lsan_init to be called before anyone else by placing it into
+ // .preinit_array section.
+ __attribute__((section(".preinit_array"), used))
+ void (*__local_lsan_preinit)(void) = __lsan_init;
+#endif
More information about the llvm-commits
mailing list