diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-09-22 21:34:44 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-09-22 21:34:44 +0000 |
commit | 908ce765a9d8c0778c2e2986b90a1838b3422770 (patch) | |
tree | 1b04524f886b65bf84c4f963f85ae19c182b55d0 /lib/interception | |
parent | 85c78459ff0e7f18f98615350f4c2f47169ad855 (diff) |
[asan] Versioned interceptor for pthread_create.
This fixes a crash in pthread_create on linux/i386 due to abi
incompatibility between intercepted and non-intercepted functions.
See the test case for more details.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception')
-rw-r--r-- | lib/interception/interception_linux.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h index d3f774bed..27a66c882 100644 --- a/lib/interception/interception_linux.h +++ b/lib/interception/interception_linux.h @@ -35,12 +35,12 @@ void *GetFuncAddrVer(const char *func_name, const char *ver); (::__interception::uptr) & WRAP(func)) #if !defined(__ANDROID__) // android does not have dlvsym -# define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ - ::__interception::real_##func = (func##_f)(unsigned long) \ - ::__interception::GetFuncAddrVer(#func, symver) +#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ + (::__interception::real_##func = (func##_f)( \ + unsigned long)::__interception::GetFuncAddrVer(#func, symver)) #else -# define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ - INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) +#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ + INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) #endif // !defined(__ANDROID__) #endif // INTERCEPTION_LINUX_H |