From: Hans-Peter Nilsson Date: Thu, 26 Apr 2018 01:21:32 +0000 (+0000) Subject: mips.c (mips_asan_shadow_offset): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e92306590ef0c4e51a0fc0053469a28ed60b1c1c;p=gcc.git mips.c (mips_asan_shadow_offset): New function. * config/mips/mips.c (mips_asan_shadow_offset): New function. (TARGET_ASAN_SHADOW_OFFSET): Define. * config/mips/mips.h (FRAME_GROWS_DOWNWARD): Augment to also be true for -fsanitize=address. Co-Authored-By: Jean Lee From-SVN: r259666 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f00fdd8c0a3..dd8819065a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-03-22 Hans-Peter Nilsson + Jean Lee + + * config/mips/mips.c (mips_asan_shadow_offset): New function. + (TARGET_ASAN_SHADOW_OFFSET): Define. + * config/mips/mips.h (FRAME_GROWS_DOWNWARD): Augment to also be + true for -fsanitize=address. + 2018-04-25 Mark Wielaard * dwarf2out.c (file_info_cmp): Sort longer dir prefixes before diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index aabd4b1580f..bfe64bb060c 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -22307,6 +22307,14 @@ mips_constant_alignment (const_tree exp, HOST_WIDE_INT align) return align; } +/* Implement the TARGET_ASAN_SHADOW_OFFSET hook. */ + +static unsigned HOST_WIDE_INT +mips_asan_shadow_offset (void) +{ + return 0x0aaa0000; +} + /* Implement TARGET_STARTING_FRAME_OFFSET. See mips_compute_frame_info for details about the frame layout. */ @@ -22618,6 +22626,9 @@ mips_starting_frame_offset (void) #undef TARGET_CONSTANT_ALIGNMENT #define TARGET_CONSTANT_ALIGNMENT mips_constant_alignment +#undef TARGET_ASAN_SHADOW_OFFSET +#define TARGET_ASAN_SHADOW_OFFSET mips_asan_shadow_offset + #undef TARGET_STARTING_FRAME_OFFSET #define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 84ae6752759..f29056016c6 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2289,7 +2289,8 @@ enum reg_class #define STACK_GROWS_DOWNWARD 1 -#define FRAME_GROWS_DOWNWARD flag_stack_protect +#define FRAME_GROWS_DOWNWARD (flag_stack_protect != 0 \ + || (flag_sanitize & SANITIZE_ADDRESS) != 0) /* Size of the area allocated in the frame to save the GP. */