gcc: xtensa: enable address sanitizer
gcc/ 2017-12-05 Max Filippov <jcmvbkbc@gmail.com> * config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New function. (TARGET_ASAN_SHADOW_OFFSET): New macro definition. * config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): Set to 1 if ASAN is enabled. From-SVN: r255420
This commit is contained in:
parent
ac550b9a0e
commit
8c9ee176a6
3 changed files with 22 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2017-12-05 Max Filippov <jcmvbkbc@gmail.com>
|
||||
|
||||
* config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New
|
||||
function.
|
||||
(TARGET_ASAN_SHADOW_OFFSET): New macro definition.
|
||||
* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): Set to 1 if
|
||||
ASAN is enabled.
|
||||
|
||||
2017-12-05 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* timevar.def (TV_TREE_RECIP, TV_TREE_SINCOS, TV_TREE_WIDEN_MUL):
|
||||
|
|
|
@ -183,6 +183,7 @@ static bool xtensa_hard_regno_mode_ok (unsigned int, machine_mode);
|
|||
static bool xtensa_modes_tieable_p (machine_mode, machine_mode);
|
||||
static HOST_WIDE_INT xtensa_constant_alignment (const_tree, HOST_WIDE_INT);
|
||||
static HOST_WIDE_INT xtensa_starting_frame_offset (void);
|
||||
static unsigned HOST_WIDE_INT xtensa_asan_shadow_offset (void);
|
||||
|
||||
|
||||
|
||||
|
@ -325,6 +326,9 @@ static HOST_WIDE_INT xtensa_starting_frame_offset (void);
|
|||
#undef TARGET_STARTING_FRAME_OFFSET
|
||||
#define TARGET_STARTING_FRAME_OFFSET xtensa_starting_frame_offset
|
||||
|
||||
#undef TARGET_ASAN_SHADOW_OFFSET
|
||||
#define TARGET_ASAN_SHADOW_OFFSET xtensa_asan_shadow_offset
|
||||
|
||||
struct gcc_target targetm = TARGET_INITIALIZER;
|
||||
|
||||
|
||||
|
@ -4413,4 +4417,12 @@ xtensa_starting_frame_offset (void)
|
|||
return crtl->outgoing_args_size;
|
||||
}
|
||||
|
||||
/* Implement TARGET_ASAN_SHADOW_OFFSET. */
|
||||
|
||||
static unsigned HOST_WIDE_INT
|
||||
xtensa_asan_shadow_offset (void)
|
||||
{
|
||||
return HOST_WIDE_INT_UC (0x10000000);
|
||||
}
|
||||
|
||||
#include "gt-xtensa.h"
|
||||
|
|
|
@ -430,7 +430,8 @@ enum reg_class
|
|||
|
||||
#define STACK_GROWS_DOWNWARD 1
|
||||
|
||||
#define FRAME_GROWS_DOWNWARD flag_stack_protect
|
||||
#define FRAME_GROWS_DOWNWARD (flag_stack_protect \
|
||||
|| (flag_sanitize & SANITIZE_ADDRESS) != 0)
|
||||
|
||||
/* The ARG_POINTER and FRAME_POINTER are not real Xtensa registers, so
|
||||
they are eliminated to either the stack pointer or hard frame pointer. */
|
||||
|
|
Loading…
Add table
Reference in a new issue