diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2013-05-07 14:17:50 +0000 |
---|---|---|
committer | Christophe Lyon <clyon@gcc.gnu.org> | 2013-05-07 16:17:50 +0200 |
commit | 8a5800b82f04303c1a6ed9094885ba79dfc4378a (patch) | |
tree | f49b90d6259dbe7cbb55464ba1121033590c72c4 /gcc/config/arm | |
parent | 7bf55a70ea2a606b387b8c8012dea8caa1f1502d (diff) | |
download | gcc-8a5800b82f04303c1a6ed9094885ba79dfc4378a.zip gcc-8a5800b82f04303c1a6ed9094885ba79dfc4378a.tar.gz gcc-8a5800b82f04303c1a6ed9094885ba79dfc4378a.tar.bz2 |
arm.c (arm_asan_shadow_offset): New function.
2013-05-06 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
* config/arm/arm.c (arm_asan_shadow_offset): New function.
(TARGET_ASAN_SHADOW_OFFSET): Define.
* config/arm/linux-eabi.h (ASAN_CC1_SPEC): Define.
(LINUX_OR_ANDROID_CC): Add ASAN_CC1_SPEC.
libsanitizer/
* configure.tgt: Add ARM pattern.
testsuite/
* lib/target-supports.exp (check_effective_target_hw): New
function.
* c-c++-common/asan/clone-test-1.c: Call
check_effective_target_hw.
* c-c++-common/asan/rlimit-mmap-test-1.c: Likewise.
* c-c++-common/asan/heap-overflow-1.c: Update regexps to accept
possible decorations.
* c-c++-common/asan/null-deref-1.c: Likewise.
* c-c++-common/asan/stack-overflow-1.c: Likewise.
* c-c++-common/asan/strncpy-overflow-1.c: Likewise.
* c-c++-common/asan/use-after-free-1.c: Likewise.
* g++.dg/asan/deep-thread-stack-1.C: Likewise.
* g++.dg/asan/large-func-test-1.C: Likewise.
From-SVN: r198683
Diffstat (limited to 'gcc/config/arm')
-rw-r--r-- | gcc/config/arm/arm.c | 12 | ||||
-rw-r--r-- | gcc/config/arm/linux-eabi.h | 8 |
2 files changed, 18 insertions, 2 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 0b97cf8..170dcb7 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -281,6 +281,7 @@ static unsigned arm_add_stmt_cost (void *data, int count, static void arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, bool op0_preserve_value); +static unsigned HOST_WIDE_INT arm_asan_shadow_offset (void); /* Table of machine attributes. */ static const struct attribute_spec arm_attribute_table[] = @@ -657,6 +658,9 @@ static const struct attribute_spec arm_attribute_table[] = #define TARGET_CANONICALIZE_COMPARISON \ arm_canonicalize_comparison +#undef TARGET_ASAN_SHADOW_OFFSET +#define TARGET_ASAN_SHADOW_OFFSET arm_asan_shadow_offset + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -28062,4 +28066,12 @@ arm_validize_comparison (rtx *comparison, rtx * op1, rtx * op2) } +/* Implement the TARGET_ASAN_SHADOW_OFFSET hook. */ + +static unsigned HOST_WIDE_INT +arm_asan_shadow_offset (void) +{ + return (unsigned HOST_WIDE_INT) 1 << 29; +} + #include "gt-arm.h" diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 23671a7..cb0aad1 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -84,10 +84,14 @@ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) +#undef ASAN_CC1_SPEC +#define ASAN_CC1_SPEC "%{fsanitize=*:-funwind-tables}" + #undef CC1_SPEC #define CC1_SPEC \ - LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \ - GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC) + LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \ + GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ + ANDROID_CC1_SPEC) #define CC1PLUS_SPEC \ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) |