diff options
author | wmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-01 22:59:28 +0000 |
---|---|---|
committer | wmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-01 22:59:28 +0000 |
commit | 759c16b72b938f8986bd911a6173d89745ec23e1 (patch) | |
tree | 3538292733f4a960b8d2a480863e24627320ad3c /libsanitizer/interception/interception_linux.cc | |
parent | 362cbc2d5f18c9f00dc3b945fb01c43bb0d36aae (diff) | |
download | gcc-asan.tar.gz |
* configure.ac: Change target-libasan to target-libsanitizer.asan
* configure.in: Regenerate.
* Makefile.def: Change libasan module to libsanitizer.
* Makefile.in: Regenerate.
* libsanitizer: Change libasan to libsanitizer and add
an empty tsan directory under libsanitizer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/asan@193074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer/interception/interception_linux.cc')
-rw-r--r-- | libsanitizer/interception/interception_linux.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libsanitizer/interception/interception_linux.cc b/libsanitizer/interception/interception_linux.cc new file mode 100644 index 00000000000..4929a7fce49 --- /dev/null +++ b/libsanitizer/interception/interception_linux.cc @@ -0,0 +1,28 @@ +//===-- interception_linux.cc -----------------------------------*- C++ -*-===// +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of AddressSanitizer, an address sanity checker. +// +// Linux-specific interception methods. +//===----------------------------------------------------------------------===// + +#ifdef __linux__ +#include "interception.h" + +#include <stddef.h> // for NULL +#include <dlfcn.h> // for dlsym + +namespace __interception { +bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, + uptr real, uptr wrapper) { + *func_addr = (uptr)dlsym(RTLD_NEXT, func_name); + return real == wrapper; +} +} // namespace __interception + + +#endif // __linux__ |