summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Matveev <earthdok@google.com>2013-11-25 17:40:17 +0000
committerSergey Matveev <earthdok@google.com>2013-11-25 17:40:17 +0000
commit28e41fed078ce7a457a1ab8de1b07407266695fb (patch)
treef4b32bae4349bc74a29042d56c85aea2fbca2a32
parentcf2469dc14ad84374d59f286a41cc1c9b190c0e4 (diff)
downloadcompiler-rt-28e41fed078ce7a457a1ab8de1b07407266695fb.tar.gz
Merging r195652:
------------------------------------------------------------------------ r195652 | smatveev | 2013-11-25 19:54:31 +0400 (Mon, 25 Nov 2013) | 3 lines [lsan] Unbreak lsan_testlib.cc. Also, add missing logging output. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_34@195668 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/lsan/lsan_common.cc2
-rw-r--r--lib/lsan/lsan_preinit.cc6
-rw-r--r--lib/lsan/tests/lsan_testlib.cc4
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/lsan/lsan_common.cc b/lib/lsan/lsan_common.cc
index 18354e9e8..152588411 100644
--- a/lib/lsan/lsan_common.cc
+++ b/lib/lsan/lsan_common.cc
@@ -275,6 +275,8 @@ static void ClassifyAllChunks(SuspendedThreadsList const &suspended_threads) {
// The check here is relatively expensive, so we do this in a separate flood
// fill. That way we can skip the check for chunks that are reachable
// otherwise.
+ if (flags()->log_pointers)
+ Report("Processing platform-specific allocations.\n");
ProcessPlatformSpecificAllocations(&frontier);
FloodFillTag(&frontier, kReachable);
diff --git a/lib/lsan/lsan_preinit.cc b/lib/lsan/lsan_preinit.cc
index a631f9a3e..e6639516d 100644
--- a/lib/lsan/lsan_preinit.cc
+++ b/lib/lsan/lsan_preinit.cc
@@ -14,7 +14,11 @@
#include "lsan.h"
-#if !defined(PIC)
+#ifndef LSAN_USE_PREINIT_ARRAY
+#define LSAN_USE_PREINIT_ARRAY 1
+#endif
+
+#if LSAN_USE_PREINIT_ARRAY && !defined(PIC)
// We force __lsan_init to be called before anyone else by placing it into
// .preinit_array section.
__attribute__((section(".preinit_array"), used))
diff --git a/lib/lsan/tests/lsan_testlib.cc b/lib/lsan/tests/lsan_testlib.cc
index 363cc14f1..8db6cf1e2 100644
--- a/lib/lsan/tests/lsan_testlib.cc
+++ b/lib/lsan/tests/lsan_testlib.cc
@@ -14,12 +14,12 @@
/* Usage:
clang++ ../sanitizer_common/sanitizer_*.cc ../interception/interception_*.cc \
lsan*.cc tests/lsan_testlib.cc -I. -I.. -g -ldl -lpthread -fPIC -shared -O2 \
- -o lsan.so
+ -DLSAN_USE_PREINIT_ARRAY=0 -o lsan.so
LD_PRELOAD=./lsan.so /your/app
*/
#include "lsan.h"
__attribute__((constructor))
void constructor() {
- __lsan::Init();
+ __lsan_init();
}