summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception/interception_linux.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/interception/interception_linux.h')
-rw-r--r--compiler-rt/lib/interception/interception_linux.h6
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__
OpenPOWER on IntegriCloud