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

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:10:52 PST 2017


krytarowski added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:2011
+int real_clock_gettime(u32 clk_id, void *tp) {
+  return REAL(clock_gettime)(clk_id, tp);
+}
----------------
cryptoad wrote:
> krytarowski wrote:
> > This symbol name needs to be mangled for NetBSD.
> So I don't think I understand what you mean here.
> I have never touched a BSD, I am sorry if I am bit dense on this.
> Which one has to be mangled and how?
> It looks like the interceptor above also calls REAL(clock_gettime), so it would have triggered some NetBSD issue as well?
Ah right, good catch. We need to fix more calls in this file: `__clock_gettime50`, `__clock_getres50`, `__clock_settime50`, `__setitimer50`, `__getitimer50` and few more: `__opendir30`, `__readdir30`, `__time50`, `__localtime_r50`, `__gmtime_r50`, `__gmtime50`, `__ctime50`, `__ctime_r50`, `__mktime50`, `__getpwnam50`, `__getpwuid50`, `__getpwnam_r50`, `__getpwuid_r50`, `__getpwent50`, `__glob30`, `__wait350`, `__wait450`, `__readdir_r30`, `__setlocale50`, `__scandir30`, `__sigtimedwait50`, `__sigemptyset14`, `__sigfillset14`, `__sigpending14`, `__sigprocmask14`, `__shmctl50`, `__times13`, `__stat50`, `__getutent50`, `__getutxent50`, `__getutxid50`, `__getutxline50`.

Please ignore symbol demangling yourself, I will send a patch myself.


https://reviews.llvm.org/D40679





More information about the llvm-commits mailing list