aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2022-10-19 11:31:33 +0200
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2022-11-04 08:58:36 +0100
commitd201bd1aab513266eb7f3adabfb3fafc6578228f (patch)
tree0e79c74b75e32a420608befcce142b3e158952fc /gcc
parent97752b7c446e513677e9d49b0c57427d41aaebde (diff)
downloadgcc-d201bd1aab513266eb7f3adabfb3fafc6578228f.zip
gcc-d201bd1aab513266eb7f3adabfb3fafc6578228f.tar.gz
gcc-d201bd1aab513266eb7f3adabfb3fafc6578228f.tar.bz2
arm: Allow to override location of .gnu.sgstubs section
Depending on the DejaGNU board definition, the .gnu.sgstubs section might be placed on different locations in order to suit the target. With this patch, the start location of the section is overrideable from the board definition with the fallback of the previously hardcoded location. gcc/testsuite/ChangeLog: * gcc.target/arm/cmse/bitfield-1.c: Use overridable location. * gcc.target/arm/cmse/bitfield-2.c: Likewise. * gcc.target/arm/cmse/bitfield-3.c: Likewise. * gcc.target/arm/cmse/cmse-20.c: Likewise. * gcc.target/arm/cmse/struct-1.c: Likewise. * gcc.target/arm/cmse/cmse.exp (cmse_sgstubs): New. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/cmse-20.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/cmse.exp11
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/struct-1.c2
6 files changed, 16 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
index 5685f74..c1221be 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
@@ -1,5 +1,5 @@
/* This test is executed only if the execution engine supports CMSE instructions. */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=[cmse_sgstubs]" } */
typedef struct
{
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
index 7a794d4..79e9a3e 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
@@ -1,5 +1,5 @@
/* This test is executed only if the execution engine supports CMSE instructions. */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=[cmse_sgstubs]" } */
typedef struct
{
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
index 5875f8df..d621a80 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
@@ -1,5 +1,5 @@
/* This test is executed only if the execution engine supports CMSE instructions. */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=[cmse_sgstubs]" } */
typedef struct
{
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-20.c b/gcc/testsuite/gcc.target/arm/cmse/cmse-20.c
index 08e89bf..bbea935 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/cmse-20.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-20.c
@@ -1,5 +1,5 @@
/* This test is executed only if the execution engine supports CMSE instructions. */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=[cmse_sgstubs]" } */
#include <arm_cmse.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse.exp b/gcc/testsuite/gcc.target/arm/cmse/cmse.exp
index 436dd71..1df5d56 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/cmse.exp
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse.exp
@@ -44,6 +44,17 @@ if {[is-effective-target arm_cmse_hw]} then {
set saved-lto_torture_options ${LTO_TORTURE_OPTIONS}
set LTO_TORTURE_OPTIONS ""
+# Return the start address of the .gnu.sgstubs section.
+proc cmse_sgstubs {} {
+ # Allow to override the location of .gnu.sgstubs section.
+ set tboard [target_info name]
+ if {[board_info $tboard exists cmse_sgstubs]} {
+ return [board_info $tboard cmse_sgstubs]
+ }
+
+ return "0x00400000"
+}
+
# These are for both baseline and mainline.
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] \
"" $DEFAULT_CFLAGS
diff --git a/gcc/testsuite/gcc.target/arm/cmse/struct-1.c b/gcc/testsuite/gcc.target/arm/cmse/struct-1.c
index 75a99f4..bebd059 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/struct-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/struct-1.c
@@ -1,5 +1,5 @@
/* This test is executed only if the execution engine supports CMSE instructions. */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=[cmse_sgstubs]" } */
typedef struct
{