diff options
author | Julian Lettner <jlettner@apple.com> | 2019-04-27 00:49:14 +0000 |
---|---|---|
committer | Julian Lettner <jlettner@apple.com> | 2019-04-27 00:49:14 +0000 |
commit | c1008e4d3dabfe62120549740decfe6637c2ae55 (patch) | |
tree | fc3b49af28e5f2a26675ba07520bbd36d5970038 /compiler-rt/lib/interception/interception_linux.h | |
parent | 1dbd42ab5babff6329d4f756b5f2237a2937ddb6 (diff) | |
download | bcm5719-llvm-c1008e4d3dabfe62120549740decfe6637c2ae55.tar.gz bcm5719-llvm-c1008e4d3dabfe62120549740decfe6637c2ae55.zip |
[NFC][Sanitizer] Remove GetRealFunctionAddress and replace usages
Reviewers: vitalybuka
Differential Revision: https://reviews.llvm.org/D61205
llvm-svn: 359362
Diffstat (limited to 'compiler-rt/lib/interception/interception_linux.h')
-rw-r--r-- | compiler-rt/lib/interception/interception_linux.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/compiler-rt/lib/interception/interception_linux.h b/compiler-rt/lib/interception/interception_linux.h index abef9c9e65a..0acb4e80b8c 100644 --- a/compiler-rt/lib/interception/interception_linux.h +++ b/compiler-rt/lib/interception/interception_linux.h @@ -22,26 +22,18 @@ #define INTERCEPTION_LINUX_H 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 *GetFuncAddr(const char *name); void *GetFuncAddrVer(const char *name, const char *ver); } // namespace __interception #define INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) \ - do { ::__interception::GetRealFunctionAddress( \ - #func, (::__interception::uptr *)&__interception::PTR_TO_REAL(func), \ - (::__interception::uptr) & (func), \ - (::__interception::uptr) & WRAP(func)); \ - } while (0) // TODO(yln): temporarily make macro void. + (REAL(func) = (FUNC_TYPE(func)) ::__interception::GetFuncAddr(#func)) // Android, Solaris and OpenBSD do not have dlvsym #if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD -#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ - do { (::__interception::real_##func = (func##_type)( \ - unsigned long)::__interception::GetFuncAddrVer(#func, symver)); \ - } while (0) +#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ + (REAL(func) = \ + (FUNC_TYPE(func)) ::__interception::GetFuncAddrVer(#func, symver)) #else #define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) |