aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/interception/interception_linux.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-08-14 10:47:11 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-08-14 08:47:11 +0000
commitb667dd7017a8f9d36d3ab266f22290d75fa527b0 (patch)
tree4ac4174c89a321d511fafb283509ffca6562ca9e /libsanitizer/interception/interception_linux.h
parent063082768aab23d26e42954eb115b76318f0176d (diff)
downloadgcc-b667dd7017a8f9d36d3ab266f22290d75fa527b0.zip
gcc-b667dd7017a8f9d36d3ab266f22290d75fa527b0.tar.gz
gcc-b667dd7017a8f9d36d3ab266f22290d75fa527b0.tar.bz2
Libsanitizer merge from trunk r368656.
2019-08-14 Martin Liska <mliska@suse.cz> PR sanitizer/89832 PR sanitizer/91325 * All source files: Merge from upstream 368656. From-SVN: r274426
Diffstat (limited to 'libsanitizer/interception/interception_linux.h')
-rw-r--r--libsanitizer/interception/interception_linux.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/libsanitizer/interception/interception_linux.h b/libsanitizer/interception/interception_linux.h
index 37e6386..e578da0 100644
--- a/libsanitizer/interception/interception_linux.h
+++ b/libsanitizer/interception/interception_linux.h
@@ -1,7 +1,8 @@
//===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -21,23 +22,27 @@
#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 *GetFuncAddrVer(const char *func_name, const char *ver);
+bool InterceptFunction(const char *name, uptr *ptr_to_real, uptr func,
+ uptr wrapper);
+bool InterceptFunction(const char *name, const char *ver, uptr *ptr_to_real,
+ uptr func, uptr wrapper);
} // namespace __interception
-#define INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) \
- ::__interception::GetRealFunctionAddress( \
- #func, (::__interception::uptr *)&__interception::PTR_TO_REAL(func), \
- (::__interception::uptr) & (func), \
+#define INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) \
+ ::__interception::InterceptFunction( \
+ #func, \
+ (::__interception::uptr *) & REAL(func), \
+ (::__interception::uptr) & (func), \
(::__interception::uptr) & WRAP(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) \
- (::__interception::real_##func = (func##_type)( \
- unsigned long)::__interception::GetFuncAddrVer(#func, symver))
+ ::__interception::InterceptFunction( \
+ #func, symver, \
+ (::__interception::uptr *) & REAL(func), \
+ (::__interception::uptr) & (func), \
+ (::__interception::uptr) & WRAP(func))
#else
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)