diff --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp --- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp +++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp @@ -223,6 +223,13 @@ #undef SIG_BLOCK #undef SIG_SETMASK +# if SANITIZER_LINUX && !SANITIZER_ANDROID +INTERCEPTOR(void *, dlopen, const char *filename, int flag) { + CheckNoDeepBind(filename, flag); + return REAL(dlopen)(filename, flag); +} +# endif + # endif // HWASAN_WITH_INTERCEPTORS namespace __hwasan { @@ -245,12 +252,15 @@ CHECK_EQ(inited, 0); #if HWASAN_WITH_INTERCEPTORS -#if defined(__linux__) +# if SANITIZER_LINUX INTERCEPT_FUNCTION(__libc_longjmp); INTERCEPT_FUNCTION(longjmp); INTERCEPT_FUNCTION(siglongjmp); INTERCEPT_FUNCTION(vfork); -#endif // __linux__ +# if !SANITIZER_ANDROID + INTERCEPT_FUNCTION(dlopen); +# endif +# endif INTERCEPT_FUNCTION(pthread_create); INTERCEPT_FUNCTION(pthread_join); # endif