696d846a56
libsanitizer/ 2015-10-20 Maxim Ostapenko <m.ostapenko@partner.samsung.com> * All source files: Merge from upstream r250806. * configure.ac (link_sanitizer_common): Add -lrt flag. * configure.tgt: Enable TSAN and LSAN for aarch64-linux targets. Set CXX_ABI_NEEDED=true for darwin. * asan/Makefile.am (asan_files): Add new files. (DEFS): Add DCAN_SANITIZE_UB=0 and remove unused and legacy DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0. * asan/Makefile.in: Regenerate. * ubsan/Makefile.am (ubsan_files): Add new files. (DEFS): Add DCAN_SANITIZE_UB=1. (libubsan_la_LIBADD): Add -lc++abi if CXX_ABI_NEEDED is true. * ubsan/Makefile.in: Regenerate. * tsan/Makefile.am (tsan_files): Add new files. (DEFS): Add DCAN_SANITIZE_UB=0. * tsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.am (sanitizer_common_files): Add new files. * sanitizer_common/Makefile.in: Regenerate. * asan/libtool-version: Bump the libasan SONAME. From-SVN: r229111
53 lines
2.1 KiB
C++
53 lines
2.1 KiB
C++
//===-- interception_linux.h ------------------------------------*- 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.
|
|
//
|
|
// Windows-specific interception methods.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifdef _WIN32
|
|
|
|
#if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
|
|
# error "interception_win.h should be included from interception library only"
|
|
#endif
|
|
|
|
#ifndef INTERCEPTION_WIN_H
|
|
#define INTERCEPTION_WIN_H
|
|
|
|
namespace __interception {
|
|
// All the functions in the OverrideFunction() family return true on success,
|
|
// false on failure (including "couldn't find the function").
|
|
|
|
// Overrides a function by its address.
|
|
bool OverrideFunction(uptr old_func, uptr new_func, uptr *orig_old_func = 0);
|
|
|
|
// Overrides a function in a system DLL or DLL CRT by its exported name.
|
|
bool OverrideFunction(const char *name, uptr new_func, uptr *orig_old_func = 0);
|
|
|
|
// Windows-only replacement for GetProcAddress. Useful for some sanitizers.
|
|
uptr InternalGetProcAddress(void *module, const char *func_name);
|
|
|
|
} // namespace __interception
|
|
|
|
#if defined(INTERCEPTION_DYNAMIC_CRT)
|
|
#define INTERCEPT_FUNCTION_WIN(func) \
|
|
::__interception::OverrideFunction(#func, \
|
|
(::__interception::uptr)WRAP(func), \
|
|
(::__interception::uptr *)&REAL(func))
|
|
#else
|
|
#define INTERCEPT_FUNCTION_WIN(func) \
|
|
::__interception::OverrideFunction((::__interception::uptr)func, \
|
|
(::__interception::uptr)WRAP(func), \
|
|
(::__interception::uptr *)&REAL(func))
|
|
#endif
|
|
|
|
#define INTERCEPT_FUNCTION_VER_WIN(func, symver) INTERCEPT_FUNCTION_WIN(func)
|
|
|
|
#endif // INTERCEPTION_WIN_H
|
|
#endif // _WIN32
|