]> git.ipfire.org Git - thirdparty/gcc.git/blob - libsanitizer/interception/interception_linux.cc
Import the asan runtime library into GCC tree
[thirdparty/gcc.git] / libsanitizer / interception / interception_linux.cc
1 //===-- interception_linux.cc -----------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is a part of AddressSanitizer, an address sanity checker.
9 //
10 // Linux-specific interception methods.
11 //===----------------------------------------------------------------------===//
12
13 #ifdef __linux__
14 #include "interception.h"
15
16 #include <stddef.h> // for NULL
17 #include <dlfcn.h> // for dlsym
18
19 namespace __interception {
20 bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
21 uptr real, uptr wrapper) {
22 *func_addr = (uptr)dlsym(RTLD_NEXT, func_name);
23 return real == wrapper;
24 }
25 } // namespace __interception
26
27
28 #endif // __linux__