aboutsummaryrefslogtreecommitdiff
path: root/gcc/asan.h
diff options
context:
space:
mode:
authorYury Gribov <y.gribov@samsung.com>2014-10-28 09:46:29 +0000
committerYury Gribov <ygribov@gcc.gnu.org>2014-10-28 09:46:29 +0000
commitfd960af2df5a437302039f248a542354ee4cddcf (patch)
tree504a2ebd7e810c8a58584e3f9ab605bd37f3a29f /gcc/asan.h
parentea41822adfb3ea39ba43e033acd1f745abd79083 (diff)
downloadgcc-fd960af2df5a437302039f248a542354ee4cddcf.zip
gcc-fd960af2df5a437302039f248a542354ee4cddcf.tar.gz
gcc-fd960af2df5a437302039f248a542354ee4cddcf.tar.bz2
Allow to override Asan shadow offset.
2014-10-28 Yury Gribov <y.gribov@samsung.com> gcc/ * asan.c (set_asan_shadow_offset): New function. (asan_shadow_offset): Likewise. (asan_emit_stack_protection): Call asan_shadow_offset. (build_shadow_mem_access): Likewise. * asan.h (set_asan_shadow_offset): Declare. * common.opt (fasan-shadow-offset): New option. (frandom-seed): Fixed parameter name. * doc/invoke.texi (fasan-shadow-offset): Describe new option. (frandom-seed): Fixed parameter name. * opts-global.c (handle_common_deferred_options): Handle -fasan-shadow-offset. * opts.c (common_handle_option): Likewise. gcc/testsuite/ * c-c++-common/asan/shadow-offset-1.c: New test. From-SVN: r216773
Diffstat (limited to 'gcc/asan.h')
-rw-r--r--gcc/asan.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/asan.h b/gcc/asan.h
index 198433f..eadf029 100644
--- a/gcc/asan.h
+++ b/gcc/asan.h
@@ -36,7 +36,7 @@ extern gimple_stmt_iterator create_cond_insert_point
extern alias_set_type asan_shadow_set;
/* Shadow memory is found at
- (address >> ASAN_SHADOW_SHIFT) + targetm.asan_shadow_offset (). */
+ (address >> ASAN_SHADOW_SHIFT) + asan_shadow_offset (). */
#define ASAN_SHADOW_SHIFT 3
/* Red zone size, stack and global variables are padded by ASAN_RED_ZONE_SIZE
@@ -76,4 +76,6 @@ asan_red_zone_size (unsigned int size)
return c ? 2 * ASAN_RED_ZONE_SIZE - c : ASAN_RED_ZONE_SIZE;
}
+extern bool set_asan_shadow_offset (const char *);
+
#endif /* TREE_ASAN */