llvm-project/compiler-rt/lib/interception
Etienne Bergeron 8c6eb1566c [compiler-rt] Fix warnings in interception code
Summary:
This patch is re-introducing the code to fix the
dynamic hooking on windows and to fix a compiler
warning on Apple.

Related patches:

* https://reviews.llvm.org/D22641
* https://reviews.llvm.org/D22610
* https://reviews.llvm.org/rL276311
* https://reviews.llvm.org/rL276490

Both architecture are using different techniques to
hook on library functions (memchr, strcpy,...). 

On Apple, the function is not dynamically hooked and
the symbol always points to a valid function 
(i.e. can't be null). The REAL macro returns the
symbol.

On windows, the function is dynamically patch and the
REAL(...) function may or may not be null. It depend
on whether or not the function was hooked correctly.
Also, on windows memcpy and memmove are the same.

```
#if !defined(__APPLE__)
[...]
# define REAL(x) __interception::PTR_TO_REAL(x)
# define ASSIGN_REAL(dst, src) REAL(dst) = REAL(src)
[...]
#else  // __APPLE__
[...]
# define REAL(x) x
# define ASSIGN_REAL(x, y)
[...]
#endif  // __APPLE__

Reviewers: rnk

Subscribers: kcc, hans, kubabrecka, llvm-commits, bruno, chrisha

Differential Revision: https://reviews.llvm.org/D22758

llvm-svn: 276885
2016-07-27 16:16:54 +00:00
..
tests [asan] Fix interception unittest on Windows64. 2016-07-12 19:39:07 +00:00
.clang-format Tell clang-format that (most) sanitizers are written using Google style guide. 2015-11-19 22:11:10 +00:00
CMakeLists.txt [compilter-rt] Add unittests for interception library 2016-07-06 19:15:11 +00:00
interception.h [compiler-rt] Fix warnings in interception code 2016-07-27 16:16:54 +00:00
interception_linux.cc [sanitizer] Interception macros for sanitizers on FreeBSD; patch by Viktor Kutuzov 2014-02-24 08:37:41 +00:00
interception_linux.h [asan] Versioned interceptor for pthread_create. 2015-09-22 21:34:44 +00:00
interception_mac.cc [ASan] Delete the code related to static runtime on OS X. 2013-02-05 15:57:12 +00:00
interception_mac.h Make some pthread_mutex_* and pthread_cond_* interceptors common. 2013-10-16 08:20:31 +00:00
interception_type_test.cc PR16532: work around old GCC bug in interception_type_test.cc 2013-12-05 13:29:46 +00:00
interception_win.cc [compiler-rt] Add support for relative offset adjustment in interception 2016-07-21 21:08:54 +00:00
interception_win.h [compiler-rt] Refactor the interception code on windows. 2016-07-11 23:02:18 +00:00