Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer/asan our __csa_atexit do...



details:   https://anonhg.NetBSD.org/src/rev/e4f7e03986ad
branches:  trunk
changeset: 829827:e4f7e03986ad
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 14 02:11:22 2018 +0000

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

diffstat:

 external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (33 lines):

diff -r 55921c940667 -r e4f7e03986ad external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc
--- a/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc     Wed Feb 14 02:10:32 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc     Wed Feb 14 02:11:22 2018 +0000
@@ -705,10 +705,17 @@
 }
 #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 @@
 #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



Home | Main Index | Thread Index | Old Index