Module Name:    src
Committed By:   christos
Date:           Wed Feb 14 02:11:22 UTC 2018

Modified Files:
        src/external/gpl3/gcc/dist/libsanitizer/asan: asan_interceptors.cc

Log Message:
our __csa_atexit does not like NULL dso; use atexit(3) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
    src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.3	Thu Feb  1 22:41:11 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc	Tue Feb 13 21:11:22 2018
@@ -705,10 +705,17 @@ INTERCEPTOR(long long, atoll, const char
 }
 #endif  // ASAN_INTERCEPT_ATOLL_AND_STRTOLL
 
+#ifdef SANITIZER_NETBSD
+extern "C" void atexit(void (*)(void));
+static void Atexit(void) {
+  StopInitOrderChecking();
+}
+#else
 static void AtCxaAtexit(void *unused) {
   (void)unused;
   StopInitOrderChecking();
 }
+#endif
 
 #if ASAN_INTERCEPT___CXA_ATEXIT
 INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
@@ -718,7 +725,11 @@ INTERCEPTOR(int, __cxa_atexit, void (*fu
 #endif
   ENSURE_ASAN_INITED();
   int res = REAL(__cxa_atexit)(func, arg, dso_handle);
+#ifdef SANITIZER_NETBSD
+  ::atexit(Atexit);
+#else
   REAL(__cxa_atexit)(AtCxaAtexit, nullptr, nullptr);
+#endif
   return res;
 }
 #endif  // ASAN_INTERCEPT___CXA_ATEXIT

Reply via email to