diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-11-22 21:04:45 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-11-22 21:04:45 +0100 |
commit | 59b36ecf239ba0164f55a2ac2cd37154d7963dd9 (patch) | |
tree | d11dfc57c47e4f7387f7f22a57a8e10b78aab3e1 /gcc/sanitizer.def | |
parent | 3e749749392a1d8e0db2ddc311239ccbc200a09f (diff) | |
download | gcc-59b36ecf239ba0164f55a2ac2cd37154d7963dd9.zip gcc-59b36ecf239ba0164f55a2ac2cd37154d7963dd9.tar.gz gcc-59b36ecf239ba0164f55a2ac2cd37154d7963dd9.tar.bz2 |
sanitizer.def (BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT, [...]): New.
* sanitizer.def (BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT,
BUILT_IN_ASAN_AFTER_DYNAMIC_INIT): New.
* asan.c (instrument_derefs): Handle also VAR_DECL loads/stores.
Don't instrument accesses to VAR_DECLs which are known to fit
into their bounds and the vars are known to have shadow bytes
indicating allowed access.
(asan_dynamic_init_call): New function.
(asan_add_global): If vnode->dynamically_initialized,
set __has_dynamic_init to 1 instead of 0.
(initialize_sanitizer_builtins): Add BT_FN_VOID_CONST_PTR var.
* asan.h (asan_dynamic_init_call): New prototype.
* cgraph.h (varpool_node): Add dynamically_initialized bitfield.
cp/
* decl2.c: Include asan.h.
(one_static_initialization_or_destruction): If -fsanitize=address,
init is non-NULL and guard is NULL, set
vnode->dynamically_initialized.
(do_static_initialization_or_destruction): Call
__asan_{before,after}_dynamic_init around the static initialization.
testsuite/
* c-c++-common/asan/no-redundant-instrumentation-1.c: Tweak to avoid
optimizing away some __asan_report* calls.
From-SVN: r205282
Diffstat (limited to 'gcc/sanitizer.def')
-rw-r--r-- | gcc/sanitizer.def | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/sanitizer.def b/gcc/sanitizer.def index 9c59778..ad1248d 100644 --- a/gcc/sanitizer.def +++ b/gcc/sanitizer.def @@ -60,6 +60,12 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNREGISTER_GLOBALS, DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_HANDLE_NO_RETURN, "__asan_handle_no_return", BT_FN_VOID, ATTR_TMPURE_NOTHROW_LEAF_LIST) +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT, + "__asan_before_dynamic_init", + BT_FN_VOID_CONST_PTR, ATTR_NOTHROW_LEAF_LIST) +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT, + "__asan_after_dynamic_init", + BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST) /* Thread Sanitizer */ DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_INIT, "__tsan_init", |