[LSan] Detect dynamic loader by its base address.
authorAlex Shlyapnikov <alekseys@google.com>
Thu, 5 Oct 2017 21:38:33 +0000 (21:38 +0000)
committerAlex Shlyapnikov <alekseys@google.com>
Thu, 5 Oct 2017 21:38:33 +0000 (21:38 +0000)
commit44f9376347d7fd4e1ef85dfd284e1549c42ecb81
tree67d6315989c3a55add5ecdb431f22350d0f0787a
parent676941909db5d71d363fa122e1372e449bd7aea6
[LSan] Detect dynamic loader by its base address.

Summary:
Relanding D33859, which was reverted because it has "broken LOTS of
ARM/AArch64 bots for two days".

If it breaks something again, please provide some pointers to broken
bots, not just revert it, otherwise it's very hard to reason what's
wrong with this commit.

Whenever possible (Linux + glibc 2.16+), detect dynamic loader module by
its base address, not by the module name matching. The current name
matching approach fails on some configurations.

Reviewers: eugenis

Subscribers: aemerson, kubamracek, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D38600

llvm-svn: 315024
compiler-rt/lib/lsan/lsan_common.cc
compiler-rt/lib/lsan/lsan_common_linux.cc
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/lib/sanitizer_common/sanitizer_platform.h