summaryrefslogtreecommitdiff
path: root/lib/lsan/lsan_common_linux.cc
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:32 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:32 +0000
commit7edd24de96f22ad70fd3ca16a3c51723383cd58b (patch)
tree1bd9c96401fc2098358ab3ab9f14255e2eabd1ac /lib/lsan/lsan_common_linux.cc
parent25091d6bd042c6bf2709eaab2bd1a88f3f2d9fda (diff)
Diffstat (limited to 'lib/lsan/lsan_common_linux.cc')
-rw-r--r--lib/lsan/lsan_common_linux.cc23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/lsan/lsan_common_linux.cc b/lib/lsan/lsan_common_linux.cc
index 2e4095b495fe6..c903be42d1e7e 100644
--- a/lib/lsan/lsan_common_linux.cc
+++ b/lib/lsan/lsan_common_linux.cc
@@ -23,10 +23,6 @@
#include "sanitizer_common/sanitizer_linux.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
-#if SANITIZER_USE_GETAUXVAL
-#include <sys/auxv.h>
-#endif // SANITIZER_USE_GETAUXVAL
-
namespace __lsan {
static const char kLinkerName[] = "ld";
@@ -34,12 +30,8 @@ static const char kLinkerName[] = "ld";
static char linker_placeholder[sizeof(LoadedModule)] ALIGNED(64);
static LoadedModule *linker = nullptr;
-static bool IsLinker(const LoadedModule& module) {
-#if SANITIZER_USE_GETAUXVAL
- return module.base_address() == getauxval(AT_BASE);
-#else
- return LibraryNameIs(module.full_name(), kLinkerName);
-#endif // SANITIZER_USE_GETAUXVAL
+static bool IsLinker(const char* full_name) {
+ return LibraryNameIs(full_name, kLinkerName);
}
__attribute__((tls_model("initial-exec")))
@@ -57,25 +49,22 @@ void InitializePlatformSpecificModules() {
ListOfModules modules;
modules.init();
for (LoadedModule &module : modules) {
- if (!IsLinker(module))
- continue;
+ if (!IsLinker(module.full_name())) continue;
if (linker == nullptr) {
linker = reinterpret_cast<LoadedModule *>(linker_placeholder);
*linker = module;
module = LoadedModule();
} else {
VReport(1, "LeakSanitizer: Multiple modules match \"%s\". "
- "TLS and other allocations originating from linker might be "
- "falsely reported as leaks.\n", kLinkerName);
+ "TLS will not be handled correctly.\n", kLinkerName);
linker->clear();
linker = nullptr;
return;
}
}
if (linker == nullptr) {
- VReport(1, "LeakSanitizer: Dynamic linker not found. TLS and other "
- "allocations originating from linker might be falsely reported "
- "as leaks.\n");
+ VReport(1, "LeakSanitizer: Dynamic linker not found. "
+ "TLS will not be handled correctly.\n");
}
}