diff options
author | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-12 15:53:47 +0000 |
---|---|---|
committer | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-12 15:53:47 +0000 |
commit | 549e2197b118efb2d947aaa15d445b05c1b5ed62 (patch) | |
tree | 78af479c74cf29780202765e911b12f4bf192001 /libsanitizer/asan/asan_interceptors.h | |
parent | 1ac3509eac3edac47cb5140b0de166557ed1fa3e (diff) | |
download | gcc-549e2197b118efb2d947aaa15d445b05c1b5ed62.tar.gz |
Import the asan runtime library into GCC tree
This patch imports the runtime library in the GCC tree, ensures that
-lasan is passed to the linker when -faddress-sanitizer is used and
sets up the build system accordingly.
ChangeLog:
* configure.ac: Add libsanitizer to target_libraries.
* Makefile.def: Ditto.
* configure: Regenerate.
* Makefile.in: Regenerate.
* libsanitizer: New directory for asan runtime. Contains an empty
tsan directory.
gcc/ChangeLog:
* gcc.c (LINK_COMMAND_SPEC): Add -laddress-sanitizer to link
command if -faddress-sanitizer is on.
libsanitizer:
Initial checkin: migrate asan runtime from llvm.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193441 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer/asan/asan_interceptors.h')
-rw-r--r-- | libsanitizer/asan/asan_interceptors.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libsanitizer/asan/asan_interceptors.h b/libsanitizer/asan/asan_interceptors.h new file mode 100644 index 00000000000..a6ab0309bff --- /dev/null +++ b/libsanitizer/asan/asan_interceptors.h @@ -0,0 +1,39 @@ +//===-- asan_interceptors.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. +// +// ASan-private header for asan_interceptors.cc +//===----------------------------------------------------------------------===// +#ifndef ASAN_INTERCEPTORS_H +#define ASAN_INTERCEPTORS_H + +#include "asan_internal.h" +#include "interception/interception.h" + +DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size) +DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size) +DECLARE_REAL(void*, memset, void *block, int c, uptr size) +DECLARE_REAL(char*, strchr, const char *str, int c) +DECLARE_REAL(uptr, strlen, const char *s) +DECLARE_REAL(char*, strncpy, char *to, const char *from, uptr size) +DECLARE_REAL(uptr, strnlen, const char *s, uptr maxlen) +DECLARE_REAL(char*, strstr, const char *s1, const char *s2) +struct sigaction; +DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act, + struct sigaction *oldact) + +namespace __asan { + +void InitializeAsanInterceptors(); +#if defined(__APPLE__) +void InitializeMacInterceptors(); +#endif // __APPLE__ + +} // namespace __asan + +#endif // ASAN_INTERCEPTORS_H |