[PATCH] D40657: [sanitizer] Introduce a vDSO aware time function, and use it in the allocator

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 11:41:51 PST 2017


alekseyshl added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:466
+// is not null (it can be mangled so we can't use it directly). Bionic's
+// clock_gettime actually falls back to the syscall in the same situation.
+extern "C" SANITIZER_WEAK_ATTRIBUTE
----------------
It feels fragile to depend on the implementation, but I don't really see what else can we do. Have a test to check that it works from preinit_array on Android?


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:470
+bool CanUseVDSO() {
+  return SANITIZER_ANDROID || (&__vdso_clock_gettime && __vdso_clock_gettime);
+}
----------------
What about __kernel_clock_gettime?


https://reviews.llvm.org/D40657





More information about the llvm-commits mailing list