diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2013-09-02 18:06:28 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2013-09-02 18:06:28 +0000 |
| commit | 3a6c7cea77e2ffd6df97f1679b29b58f63b063bb (patch) | |
| tree | 1f333096a32354852ba63780b977f3f3f71d58a3 /compiler-rt/lib/interception/interception_linux.h | |
| parent | 63872ce19fe1637515ac1e0345f43d38ba6c5880 (diff) | |
| download | bcm5719-llvm-3a6c7cea77e2ffd6df97f1679b29b58f63b063bb.tar.gz bcm5719-llvm-3a6c7cea77e2ffd6df97f1679b29b58f63b063bb.zip | |
tsan: properly intercept pthread_cond functions
llvm-svn: 189767
Diffstat (limited to 'compiler-rt/lib/interception/interception_linux.h')
| -rw-r--r-- | compiler-rt/lib/interception/interception_linux.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/interception/interception_linux.h b/compiler-rt/lib/interception/interception_linux.h index dba60bf7315..200a9ae7d41 100644 --- a/compiler-rt/lib/interception/interception_linux.h +++ b/compiler-rt/lib/interception/interception_linux.h @@ -25,6 +25,7 @@ namespace __interception { // returns true if a function with the given name was found. bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, uptr real, uptr wrapper); +void *GetFuncAddrVer(const char *func_name, const char *ver); } // namespace __interception #define INTERCEPT_FUNCTION_LINUX(func) \ @@ -33,5 +34,10 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, (::__interception::uptr)&(func), \ (::__interception::uptr)&WRAP(func)) +#define INTERCEPT_FUNCTION_VER(func, funcver, symver) \ + __asm__(".symver "#funcver","#func"@"#symver); \ + ::__interception::real_##funcver = (funcver##_f)(unsigned long) \ + ::__interception::GetFuncAddrVer(#func, #symver) + #endif // INTERCEPTION_LINUX_H #endif // __linux__ |

