From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id 3B3623858D39 for ; Wed, 19 Oct 2022 10:07:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B3623858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29J9L0Ye021378; Wed, 19 Oct 2022 12:07:10 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=3ChbHNwg42A/uIXH2C8tmuAgZBNZMChKMhTj54xTjMY=; b=OpE4vyYTPeQqTFr4of2Gt3zPB4ydRGxXTQJFG9Ju0Pz7WPjiTSCd9bZC17/F0OL6zz7N F7kVWvfuQX5nnH0zp8Njh3Q1zMphJEMToI6hNiACNpqdgzhwPJMeMDuMZ4PqzE6ZECBq VNPGbfKkYCXpajtodstIcbX2eg0lPwdbajZq8RFuVsTvTdLX4qaYsDdfPApZpaez7H9W QAGPFsypEXZoHZsA0tTBY/R6Vz2vw1sphETtaFCsGLauVkbTO241GuJb9OjVIyjFrrcl 1Zr2ZW61ZnmMujTC+JNPC64jaDmXYjrLOQfNOhTk/rjFHBwlpKKXFpeo4FdacFEmT6dE Pw== 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 3kaegr0bj6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Oct 2022 12:07:10 +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 18F9C100034; Wed, 19 Oct 2022 12:07:05 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E948821B531; Wed, 19 Oct 2022 12:07:05 +0200 (CEST) Received: from [10.252.25.190] (10.252.25.190) 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 12:07:05 +0200 Message-ID: Date: Wed, 19 Oct 2022 12:07:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] arm: Allow to override location of .gnu.sgstubs section Content-Language: en-US To: Christophe Lyon , References: <20221019094214.1734353-1-torbjorn.svensson@foss.st.com> From: Torbjorn SVENSSON In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.25.190] 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=-10.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,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 List-Id: 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 >> --- >>   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" >> +} >> + > > 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