]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: Allow to override location of .gnu.sgstubs section
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Wed, 19 Oct 2022 09:31:33 +0000 (11:31 +0200)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 4 Nov 2022 07:58:36 +0000 (08:58 +0100)
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>
gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
gcc/testsuite/gcc.target/arm/cmse/cmse-20.c
gcc/testsuite/gcc.target/arm/cmse/cmse.exp
gcc/testsuite/gcc.target/arm/cmse/struct-1.c

index 5685f744435cac17d65f8896dcefdf657ad3dd45..c1221bef29f6a3bc3352bdbccb39e023f1003a15 100644 (file)
@@ -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
 {
index 7a794d446448ad2f3ca5329098cf7a4abac93bdf..79e9a3efc93d6f7b1b23074c5e8531b35d4b95b2 100644 (file)
@@ -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
 {
index 5875f8dff486e3e44cec91a255acf4d08c6c6a7e..d621a802ee117a71118bd9cb396c838487c6b2e5 100644 (file)
@@ -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
 {
index 08e89bff6378f1f96950fc40f3ab3946bd433773..bbea93588704f9cf39fbc3604a23192baa625649 100644 (file)
@@ -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>
index 436dd71ef89c5602f71f6f147ce8f468acb934ae..1df5d56c6d5ecc2b6d9ac00261e92703655c18ec 100644 (file)
@@ -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
index 75a99f487e7a0cb4ab6960b6c0bf0338a9c171fd..bebd059b13f1517dfeb11acd923745bfd0290403 100644 (file)
@@ -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
 {