* asan.c (asan_init_shadow_ptr_types): Move earlier in the file.
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Dec 2012 12:14:36 +0000 (12:14 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Dec 2012 12:14:36 +0000 (12:14 +0000)
commit55b58027644caba54158d5ee8fa9ddf43fbf7acb
tree3bd1c13134ce9fb42d46d64f6d4cfee4d5b21d3f
parent614aede0da661b3519e751fe6ab234e45c40fe37
* asan.c (asan_init_shadow_ptr_types): Move earlier in the file.
Call initialize_sanitizer_builtins at the end.
(asan_pp_string): Use TREE_TYPE (shadow_ptr_types[0])
as character type instead of char_type_node.
(asan_emit_stack_protection): Call asan_init_shadow_ptr_types
if shadow_ptr_types isn't initialized.
(asan_protect_global): Return true for STRING_CSTs except those
created by asan_pp_string.
(count_string_csts, add_string_csts): New functions.
(struct asan_add_string_csts_data): New type.
(asan_finish_file): Clear flag_asan at the beginning, restore at the
end.  Traverse constant_pool_htab () to look for protected
STRING_CSTs.  Don't call initialize_sanitizer_builtins,
instead call asan_init_shadow_ptr_types if shadow_ptr_types isn't
initialized yet.
(asan_instrument): Don't call initialize_sanitizer_builtins.
* varasm.c (output_constant_def_contents): If STRING_CST should be
asan protected, align it sufficiently and emit padding after it.
(categorize_decl_for_section): If flag_asan, don't put STRING_CSTs
that should be asan protected into mergeable sections.  For
-fmerge-all-constants, ignore it for -fmudflap or if decl is
asan protected.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194355 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/asan.c
gcc/varasm.c