diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2018-06-25 17:27:13 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2018-06-25 17:27:13 +0000 |
commit | c0234d2aed8ad4c30cd1d507dde386e3c4bc49f7 (patch) | |
tree | 23c3aa4d4c30f3b7e3ea26e73138d9df76a42bb3 /lib | |
parent | c0e4b39df7c984f5a3ae04c6925a7914e245759b (diff) |
[HWASan] Initalize shadow earler.
Summary:
Initialize shadow memory before calling more libc functions to allow
for HWASan-instrumented libc.
Reviewers: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D48551
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hwasan/hwasan.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/hwasan/hwasan.cc b/lib/hwasan/hwasan.cc index 05818e1ca..7dab8249e 100644 --- a/lib/hwasan/hwasan.cc +++ b/lib/hwasan/hwasan.cc @@ -177,10 +177,6 @@ void __hwasan_init() { __sanitizer_set_report_path(common_flags()->log_path); - InitializeInterceptors(); - InstallDeadlySignalHandlers(HwasanOnDeadlySignal); - InstallAtExitHandler(); // Needs __cxa_atexit interceptor. - DisableCoreDumperIfNecessary(); if (!InitShadow()) { Printf("FATAL: HWAddressSanitizer cannot mmap the shadow memory.\n"); @@ -194,6 +190,10 @@ void __hwasan_init() { Die(); } + InitializeInterceptors(); + InstallDeadlySignalHandlers(HwasanOnDeadlySignal); + InstallAtExitHandler(); // Needs __cxa_atexit interceptor. + Symbolizer::GetOrInit()->AddHooks(EnterSymbolizer, ExitSymbolizer); InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir); |