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 AA37E3858C33 for ; Wed, 28 Sep 2022 09:17:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA37E3858C33 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 28S81VfR019187; Wed, 28 Sep 2022 11:17:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=h7qHjuYHY7XC4IddiI1MEafKOBdsaSn1f1ADK21Qfl4=; b=wscraVA9JBc1/wrTQyrFZTkzbIKtBW/k3IEMliK/5zjNKzhl8rjcFHsNsPs+hVDyQbYQ KxjxjG478JjR17nCqU+Q2fyiwuncuEM9bM6daY/zZw7FEA89ge1x3vW1q3eH6sBT5cXX d6WHPSeUVDYFWnNTp/PPV9QAKcx+7MugTIuaLUp5Rq6/0O89fq8D+x4QUY3Irj/fRWyE 8C/C4jbhFNyPPdc38l7t7oYUWxkljBNgfmPVE6WFy3jRDxU0KwbS8+/9vZ/a6NHVsapB Lsa5KfEFOzv7mNZ/TA7WXo5GMp+Uv3q9yw26SLX2v5njSNaEgj5hRJRtchgmvVtoh+9u cQ== 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 3jvjd2gj6b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Sep 2022 11:17:18 +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 EE28410002A; Wed, 28 Sep 2022 11:17:15 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id CA00B2194F0; Wed, 28 Sep 2022 11:17:15 +0200 (CEST) Received: from [10.252.30.137] (10.75.127.49) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Wed, 28 Sep 2022 11:17:14 +0200 Message-ID: <9ffd26d4-a14f-2ffa-e6e5-750331fd3cdc@foss.st.com> Date: Wed, 28 Sep 2022 11:17:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: PING^1 [PATCH] testsuite: 'b' instruction can't do long enough jumps Content-Language: en-US To: CC: , , , References: <20220919163040.4104646-1-torbjorn.svensson@foss.st.com> From: Torbjorn SVENSSON In-Reply-To: <20220919163040.4104646-1-torbjorn.svensson@foss.st.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) 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.528,FMLib:17.11.122.1 definitions=2022-09-28_03,2022-09-27_01,2022-06-22_01 X-Spam-Status: No, score=-12.0 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 List-Id: Hi, Ping: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601829.html Kind regards, Torbjörn On 2022-09-19 18:30, Torbjörn SVENSSON wrote: > After moving the testglue in commit 9d503515cee, the jump to exit and > abort is too far for the 'b' instruction on Cortex-M0. As most of the > C code would generate a 'bl' instruction instead of a 'b' > instruction, lets do the same for the inline assembler. > > The error seen without this patch: > > /tmp/cccCRiCl.o: in function `main': > stack-protector-1.c:(.text+0x4e): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `__wrap_exit' defined in .text section in gcc_tg.o > stack-protector-1.c:(.text+0x50): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `__wrap_abort' defined in .text section in gcc_tg.o > collect2: error: ld returned 1 exit status > > gcc/testsuite/ChangeLog: > > * gcc/testsuite/gcc.target/arm/stack-protector-1.c: Use 'bl' > instead of 'b' instruction. > * gcc/testsuite/gcc.target/arm/stack-protector-3.c: Likewise. > > Co-Authored-By: Yvan ROUX > Signed-off-by: Torbjörn SVENSSON > --- > gcc/testsuite/gcc.target/arm/stack-protector-1.c | 4 ++-- > gcc/testsuite/gcc.target/arm/stack-protector-3.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-1.c b/gcc/testsuite/gcc.target/arm/stack-protector-1.c > index 8d28b0a847c..3f0ffc9c3f3 100644 > --- a/gcc/testsuite/gcc.target/arm/stack-protector-1.c > +++ b/gcc/testsuite/gcc.target/arm/stack-protector-1.c > @@ -56,8 +56,8 @@ asm ( > " ldr r1, [sp, #4]\n" > CHECK (r1) > " mov r0, #0\n" > -" b exit\n" > +" bl exit\n" > "1:\n" > -" b abort\n" > +" bl abort\n" > " .size main, .-main" > ); > diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-3.c b/gcc/testsuite/gcc.target/arm/stack-protector-3.c > index b8f77fa2309..2f710529b8f 100644 > --- a/gcc/testsuite/gcc.target/arm/stack-protector-3.c > +++ b/gcc/testsuite/gcc.target/arm/stack-protector-3.c > @@ -26,7 +26,7 @@ asm ( > " .type __stack_chk_fail, %function\n" > "__stack_chk_fail:\n" > " movs r0, #0\n" > -" b exit\n" > +" bl exit\n" > " .size __stack_chk_fail, .-__stack_chk_fail" > ); >