From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7897) id 557B53858C54; Fri, 4 Nov 2022 07:59:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 557B53858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667548767; bh=ZCyC5byO2U0+v92nFEYAb4unMeWH6Kn8EzfZbNHjneE=; h=From:To:Subject:Date:From; b=rcdmKOnN4Hbwo4MjNVTNbKV2qS5vsWsDtrWI4cQNjtee4bS0FYWovVipQADdbDSP4 DgmrtLid0QKsHlajuuFE0k8K3x/Rg8rJ5t1aBUREdk3AAysWa4g8rAM37s3TdG3UOq rig527m4Kp3vqkt6kUb9tryKn0RgT6PxWxdIzQ5E= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Torbjorn Svensson To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3647] arm: Allow to override location of .gnu.sgstubs section X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 97752b7c446e513677e9d49b0c57427d41aaebde X-Git-Newrev: d201bd1aab513266eb7f3adabfb3fafc6578228f Message-Id: <20221104075927.557B53858C54@sourceware.org> Date: Fri, 4 Nov 2022 07:59:24 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d201bd1aab513266eb7f3adabfb3fafc6578228f commit r13-3647-gd201bd1aab513266eb7f3adabfb3fafc6578228f Author: Torbjörn SVENSSON Date: Wed Oct 19 11:31:33 2022 +0200 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 Diff: --- 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 #include 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 {