[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
@@ -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);
