* configure.ac: Change target-libasan to target-libsanitizer.
[official-gcc.git] / libsanitizer / interception / interception_linux.cc
blob4929a7fce49a9f145fab171cbe71365ad9e51b61
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 //===----------------------------------------------------------------------===//
13 #ifdef __linux__
14 #include "interception.h"
16 #include <stddef.h> // for NULL
17 #include <dlfcn.h> // for dlsym
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;
25 } // namespace __interception
28 #endif // __linux__