public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] arm: Allow to override location of .gnu.sgstubs section
@ 2022-10-19  9:42 Torbjörn SVENSSON
  2022-10-19  9:52 ` Christophe Lyon
  2022-11-02 18:18 ` PING^1 " Torbjorn SVENSSON
  0 siblings, 2 replies; 6+ messages in thread
From: Torbjörn SVENSSON @ 2022-10-19  9:42 UTC (permalink / raw)
  To: gcc-patches; +Cc: kyrylo.tkachov, Torbjörn SVENSSON

Depending on the DejaGNU board definition, the .gnu.sgstubs section
might be placed on different locations in order to suite 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 |  2 +-
 gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c |  2 +-
 gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c |  2 +-
 gcc/testsuite/gcc.target/arm/cmse/cmse-20.c    |  2 +-
 gcc/testsuite/gcc.target/arm/cmse/cmse.exp     | 11 +++++++++++
 gcc/testsuite/gcc.target/arm/cmse/struct-1.c   |  2 +-
 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 5685f744435..c1221bef29f 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 7a794d44644..79e9a3efc93 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 5875f8dff48..d621a802ee1 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 08e89bff637..bbea9358870 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 436dd71ef89..1df5d56c6d5 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 75a99f487e7..bebd059b13f 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
 {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: Allow to override location of .gnu.sgstubs section
  2022-10-19  9:42 [PATCH] arm: Allow to override location of .gnu.sgstubs section Torbjörn SVENSSON
@ 2022-10-19  9:52 ` Christophe Lyon
  2022-10-19 10:07   ` Torbjorn SVENSSON
  2022-11-02 18:18 ` PING^1 " Torbjorn SVENSSON
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe Lyon @ 2022-10-19  9:52 UTC (permalink / raw)
  To: Torbjörn SVENSSON, gcc-patches

Hi Torbjörn,

This looks like a nice improvement to me ;-)

On 10/19/22 11:42, Torbjörn SVENSSON via Gcc-patches wrote:
> Depending on the DejaGNU board definition, the .gnu.sgstubs section
> might be placed on different locations in order to suite the target.
typo: suite -> suit

> 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 |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/cmse-20.c    |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/cmse.exp     | 11 +++++++++++
>   gcc/testsuite/gcc.target/arm/cmse/struct-1.c   |  2 +-
>   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 5685f744435..c1221bef29f 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 7a794d44644..79e9a3efc93 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 5875f8dff48..d621a802ee1 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 08e89bff637..bbea9358870 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 436dd71ef89..1df5d56c6d5 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"
> +}
> +

I am not sure if/where this new cmse_sgstubs target-board property needs 
to be documented?

Thanks,

Christophe

>   # 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 75a99f487e7..bebd059b13f 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
>   {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: Allow to override location of .gnu.sgstubs section
  2022-10-19  9:52 ` Christophe Lyon
@ 2022-10-19 10:07   ` Torbjorn SVENSSON
  0 siblings, 0 replies; 6+ messages in thread
From: Torbjorn SVENSSON @ 2022-10-19 10:07 UTC (permalink / raw)
  To: Christophe Lyon, gcc-patches

Hi Christophe,

On 2022-10-19 11:52, Christophe Lyon wrote:
> Hi Torbjörn,
> 
> This looks like a nice improvement to me ;-)
> 
> On 10/19/22 11:42, Torbjörn SVENSSON via Gcc-patches wrote:
>> Depending on the DejaGNU board definition, the .gnu.sgstubs section
>> might be placed on different locations in order to suite the target.
> typo: suite -> suit
> 
>> 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 |  2 +-
>>   gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c |  2 +-
>>   gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c |  2 +-
>>   gcc/testsuite/gcc.target/arm/cmse/cmse-20.c    |  2 +-
>>   gcc/testsuite/gcc.target/arm/cmse/cmse.exp     | 11 +++++++++++
>>   gcc/testsuite/gcc.target/arm/cmse/struct-1.c   |  2 +-
>>   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 5685f744435..c1221bef29f 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 7a794d44644..79e9a3efc93 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 5875f8dff48..d621a802ee1 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 08e89bff637..bbea9358870 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 436dd71ef89..1df5d56c6d5 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"
>> +}
>> +
> 
> I am not sure if/where this new cmse_sgstubs target-board property needs 
> to be documented?

I'm not sure either. Everytime I need to do something with the 
target-board properties, I just look at other examples in the tree and 
replicate what they do.
I'm also not sure if "cmse_sgstubs" is a good name, but I was unable to 
come up with a more meaningful name that was not a mile long... If there 
is any sugession on a better name, please speak up! :)

Kind regards,
Torbjörn

^ permalink raw reply	[flat|nested] 6+ messages in thread

* PING^1 [PATCH] arm: Allow to override location of .gnu.sgstubs section
  2022-10-19  9:42 [PATCH] arm: Allow to override location of .gnu.sgstubs section Torbjörn SVENSSON
  2022-10-19  9:52 ` Christophe Lyon
@ 2022-11-02 18:18 ` Torbjorn SVENSSON
  2022-11-03  9:44   ` Kyrylo Tkachov
  1 sibling, 1 reply; 6+ messages in thread
From: Torbjorn SVENSSON @ 2022-11-02 18:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: kyrylo.tkachov

Hi,

Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603878.html

Kind regards,
Torbjörn

On 2022-10-19 11:42, Torbjörn SVENSSON wrote:
> Depending on the DejaGNU board definition, the .gnu.sgstubs section
> might be placed on different locations in order to suite 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 |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/cmse-20.c    |  2 +-
>   gcc/testsuite/gcc.target/arm/cmse/cmse.exp     | 11 +++++++++++
>   gcc/testsuite/gcc.target/arm/cmse/struct-1.c   |  2 +-
>   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 5685f744435..c1221bef29f 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 7a794d44644..79e9a3efc93 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 5875f8dff48..d621a802ee1 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 08e89bff637..bbea9358870 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 436dd71ef89..1df5d56c6d5 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 75a99f487e7..bebd059b13f 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
>   {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: PING^1 [PATCH] arm: Allow to override location of .gnu.sgstubs section
  2022-11-02 18:18 ` PING^1 " Torbjorn SVENSSON
@ 2022-11-03  9:44   ` Kyrylo Tkachov
  2022-11-04  7:59     ` Torbjorn SVENSSON
  0 siblings, 1 reply; 6+ messages in thread
From: Kyrylo Tkachov @ 2022-11-03  9:44 UTC (permalink / raw)
  To: Torbjorn SVENSSON, gcc-patches



> -----Original Message-----
> From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
> Sent: Wednesday, November 2, 2022 6:19 PM
> To: gcc-patches@gcc.gnu.org
> Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
> Subject: PING^1 [PATCH] arm: Allow to override location of .gnu.sgstubs
> section
> 
> Hi,
> 
> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603878.html
> 

Ok, thanks for pinging it.
Kyrill

> Kind regards,
> Torbjörn
> 
> On 2022-10-19 11:42, Torbjörn SVENSSON wrote:
> > Depending on the DejaGNU board definition, the .gnu.sgstubs section
> > might be placed on different locations in order to suite 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 |  2 +-
> >   gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c |  2 +-
> >   gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c |  2 +-
> >   gcc/testsuite/gcc.target/arm/cmse/cmse-20.c    |  2 +-
> >   gcc/testsuite/gcc.target/arm/cmse/cmse.exp     | 11 +++++++++++
> >   gcc/testsuite/gcc.target/arm/cmse/struct-1.c   |  2 +-
> >   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 5685f744435..c1221bef29f 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 7a794d44644..79e9a3efc93 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 5875f8dff48..d621a802ee1 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 08e89bff637..bbea9358870 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 436dd71ef89..1df5d56c6d5 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 75a99f487e7..bebd059b13f 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
> >   {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PING^1 [PATCH] arm: Allow to override location of .gnu.sgstubs section
  2022-11-03  9:44   ` Kyrylo Tkachov
@ 2022-11-04  7:59     ` Torbjorn SVENSSON
  0 siblings, 0 replies; 6+ messages in thread
From: Torbjorn SVENSSON @ 2022-11-04  7:59 UTC (permalink / raw)
  To: Kyrylo Tkachov, gcc-patches



On 2022-11-03 10:44, Kyrylo Tkachov wrote:
> 
> 
>> -----Original Message-----
>> From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
>> Sent: Wednesday, November 2, 2022 6:19 PM
>> To: gcc-patches@gcc.gnu.org
>> Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
>> Subject: PING^1 [PATCH] arm: Allow to override location of .gnu.sgstubs
>> section
>>
>> Hi,
>>
>> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603878.html
>>
> 
> Ok, thanks for pinging it.
> Kyrill

Pushed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-04  7:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19  9:42 [PATCH] arm: Allow to override location of .gnu.sgstubs section Torbjörn SVENSSON
2022-10-19  9:52 ` Christophe Lyon
2022-10-19 10:07   ` Torbjorn SVENSSON
2022-11-02 18:18 ` PING^1 " Torbjorn SVENSSON
2022-11-03  9:44   ` Kyrylo Tkachov
2022-11-04  7:59     ` Torbjorn SVENSSON

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).