diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-11-12 16:52:42 +0100 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2012-11-12 16:52:42 +0100 |
commit | 8240018b0c5da12a6e6df5689055983e76768151 (patch) | |
tree | 18be1f25e100232473bd95eeef5508dbb137f634 /gcc/gimple.c | |
parent | f3ddd6929ad26e1c6202265460730241ad6c28d0 (diff) | |
download | gcc-8240018b0c5da12a6e6df5689055983e76768151.zip gcc-8240018b0c5da12a6e6df5689055983e76768151.tar.gz gcc-8240018b0c5da12a6e6df5689055983e76768151.tar.bz2 |
Implement protection of global variables
This patch implements the protection of global variables. See the
comments appended to the beginning of the asan.c file.
* varasm.c: Include asan.h.
(assemble_noswitch_variable): Grow size by asan_red_zone_size
if decl is asan protected.
(place_block_symbol): Likewise.
(assemble_variable): If decl is asan protected, increase
DECL_ALIGN if needed, and for decls emitted using
assemble_variable_contents append padding zeros after it.
* Makefile.in (varasm.o): Depend on asan.h.
* asan.c: Include output.h.
(asan_pp, asan_pp_initialized, asan_ctor_statements): New variables.
(asan_pp_initialize, asan_pp_string): New functions.
(asan_emit_stack_protection): Use asan_pp{,_initialized}
instead of local pp{,_initialized} vars, use asan_pp_initialize
and asan_pp_string helpers.
(asan_needs_local_alias, asan_protect_global,
asan_global_struct, asan_add_global): New functions.
(asan_finish_file): Protect global vars that can be protected. Use
asan_ctor_statements instead of ctor_statements
* asan.h (asan_protect_global): New prototype.
(asan_red_zone_size): New inline function.
Co-Authored-By: Wei Mi <wmi@google.com>
From-SVN: r193437
Diffstat (limited to 'gcc/gimple.c')
0 files changed, 0 insertions, 0 deletions