diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2020-08-12 09:22:38 +0000 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 15:08:03 -0300 |
commit | 6be3ca813fdebddf5d689d34638dfb22a6fde84c (patch) | |
tree | 93bc1e8cb3f1c7935d332898d469b1c0feec50ef /gcc | |
parent | 8567d6d1abeaf0026aac005840d632de0f5bf018 (diff) | |
download | gcc-6be3ca813fdebddf5d689d34638dfb22a6fde84c.zip gcc-6be3ca813fdebddf5d689d34638dfb22a6fde84c.tar.gz gcc-6be3ca813fdebddf5d689d34638dfb22a6fde84c.tar.bz2 |
testsuite: Fix gcc.target/arm/stack-protector-1.c for Cortex-M
The stack-protector-1.c test fails when compiled for Cortex-M:
- for Cortex-M0/M1, str r0, [sp #-8]! is not supported
- for Cortex-M3/M4..., the assembler complains that "use of r13 is
deprecated"
This patch replaces the str instruction with
sub sp, sp, #8
str r0, [sp]
and removes the check for r13, which is unlikely to leak the canary
value.
2020-08-11 Christophe Lyon <christophe.lyon@linaro.org>
gcc/testsuite/
* gcc.target/arm/stack-protector-1.c: Adapt code to Cortex-M
restrictions.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.target/arm/stack-protector-1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-1.c b/gcc/testsuite/gcc.target/arm/stack-protector-1.c index b03ea14..8d28b0a 100644 --- a/gcc/testsuite/gcc.target/arm/stack-protector-1.c +++ b/gcc/testsuite/gcc.target/arm/stack-protector-1.c @@ -34,7 +34,8 @@ asm ( " .type main, %function\n" "main:\n" " bl get_ptr\n" -" str r0, [sp, #-8]!\n" +" sub sp, sp, #8\n" +" str r0, [sp]\n" " bl f\n" " str r0, [sp, #4]\n" " ldr r0, [sp]\n" @@ -51,7 +52,6 @@ asm ( CHECK (r10) CHECK (r11) CHECK (r12) - CHECK (r13) CHECK (r14) " ldr r1, [sp, #4]\n" CHECK (r1) |