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/cgraph.h | |
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/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 15719fb..c6b35f9 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -532,6 +532,10 @@ public: /* Set when variable has statically initialized pointer or is a static bounds variable and needs initalization. */ unsigned need_bounds_init : 1; + + /* Set if the variable is dynamically initialized, except for + function local statics. */ + unsigned dynamically_initialized : 1; }; /* Every top level asm statement is put into a asm_node. */ |