From patchwork Wed Oct 19 09:42:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Torbjorn SVENSSON X-Patchwork-Id: 4918 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp225788wrs; Wed, 19 Oct 2022 02:44:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5I5X+YjJH/P+rqVcHE0Hfz1ph2UqkwyTlbXhbj9tnVyOV+HxMxJeChrEqY4OVLaE+AtJxN X-Received: by 2002:a05:6402:1a4d:b0:459:319f:ff80 with SMTP id bf13-20020a0564021a4d00b00459319fff80mr6665307edb.144.1666172642438; Wed, 19 Oct 2022 02:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172642; cv=none; d=google.com; s=arc-20160816; b=Jp2QK/Ue+4HudEqdNy+KAxRDvWoUONw9UNNUtAmGstfPdGIwC5X+2Wdqi8EMYPNkKp YA8VfCGV0rItPZPgiHbqY87ke70aTHDhCmbEPoBAATRQMNlyyXMeezhwcLmknP9/nEdG wcwPs2GnfyIASTg7BpWk4+XiqeMXLwSNH5gXwMQHCuJOiZ72P82ty6t7HxXhMlIkw5LS o2tnmgVqfaIGmC5ML+eDu4K3zp1iEfDLv0r0R0UU4hVGhJCd4qznVad5lhL23QraLDSH 95WuF1Uvm13Jvues8lQDo4o4rUUEJ5eOWfPqsgn9Rz294AdmMw3ZpyvBME+nSsLB0Ttb 8GWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=A/3vQLA3E8HHA5cOhc/5itpx+/u2Xo+5Yjc4atTwFuA=; b=qHzXPs6aJzR36bLOtkHeJ0GMacCAj76U9/IzLOaWZRlJgy7BwA43Q3njP8n35sgPBY qQzhSo3gcLQ5DXwIHkoYw/NKO00n8xVnSpx3IHRI2CTAUg/NKeuavhDRgfNY6TpfWCRG y8HrGaSYrlFWDZeZAr8BMbSLqToRWaLJ/Sr8i1wCPknAzEmTbW2F09jI73PsKoTOYzkl atnGOIjZLszKlGBErJjKBnhsHd654f0bfJf4jy+d2sTlor6lVpUOvRO1jP+wrAi7o06v nOeTyNe8gstkbDcE4Lijn3xQ9pamgkln6WnNPsa5Itgo/gWgcjvzi3X/Xx9AlnwZN4Nd kilg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pSWE8st2; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id di10-20020a170906730a00b0078d51aa5967si16358041ejc.944.2022.10.19.02.44.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 02:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pSWE8st2; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CDCEE3857C77 for ; Wed, 19 Oct 2022 09:43:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDCEE3857C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666172632; bh=A/3vQLA3E8HHA5cOhc/5itpx+/u2Xo+5Yjc4atTwFuA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=pSWE8st2WZ+/HODpNRBgDCl6BnfDQRkj617XXj9adwDZr52S06tF4V+f2jM/TwKjx aybjs8gjTXHQNBOJ7o6eIz8Whsg8am6thKF6Cv5CkRX+dnznrGaH56Z20jpDhAfaUb LqW9HXviMpjgsxxYuX3GuYxZxPtIM7UofH40z/qk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 40F783858C83 for ; Wed, 19 Oct 2022 09:43:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40F783858C83 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29J88lmC028224; Wed, 19 Oct 2022 11:43:03 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3k7j9n1qfs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Oct 2022 11:43:03 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D71C810002A; Wed, 19 Oct 2022 11:42:58 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id B2AA921A90B; Wed, 19 Oct 2022 11:42:58 +0200 (CEST) Received: from jkgcxl0002.jkg.st.com (10.210.54.218) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:42:56 +0200 To: Subject: [PATCH] arm: Allow to override location of .gnu.sgstubs section Date: Wed, 19 Oct 2022 11:42:15 +0200 Message-ID: <20221019094214.1734353-1-torbjorn.svensson@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.210.54.218] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-19_06,2022-10-19_01,2022-06-22_01 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Torbj=C3=B6rn_SVENSSON_via_Gcc-patches?= From: Torbjorn SVENSSON Reply-To: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747108644945619964?= X-GMAIL-MSGID: =?utf-8?q?1747108644945619964?= 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 --- 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 {