summaryrefslogtreecommitdiff
path: root/lib/interception/interception_linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/interception/interception_linux.cc')
-rw-r--r--lib/interception/interception_linux.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
index 4b27102a159c8..d07f060b5b642 100644
--- a/lib/interception/interception_linux.cc
+++ b/lib/interception/interception_linux.cc
@@ -33,7 +33,7 @@ static int StrCmp(const char *s1, const char *s2) {
}
#endif
-static void *GetFuncAddr(const char *name, uptr wrapper_addr) {
+static void *GetFuncAddr(const char *name) {
#if SANITIZER_NETBSD
// FIXME: Find a better way to handle renames
if (StrCmp(name, "sigaction"))
@@ -47,18 +47,13 @@ static void *GetFuncAddr(const char *name, uptr wrapper_addr) {
// want the address of the real definition, though, so look it up using
// RTLD_DEFAULT.
addr = dlsym(RTLD_DEFAULT, name);
-
- // In case `name' is not loaded, dlsym ends up finding the actual wrapper.
- // We don't want to intercept the wrapper and have it point to itself.
- if ((uptr)addr == wrapper_addr)
- addr = nullptr;
}
return addr;
}
bool InterceptFunction(const char *name, uptr *ptr_to_real, uptr func,
uptr wrapper) {
- void *addr = GetFuncAddr(name, wrapper);
+ void *addr = GetFuncAddr(name);
*ptr_to_real = (uptr)addr;
return addr && (func == wrapper);
}