From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111273 invoked by alias); 9 Sep 2019 08:58:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 111264 invoked by uid 89); 9 Sep 2019 08:58:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=6M, 6m, became, sk:arm-non X-HELO: mail-lf1-f68.google.com Received: from mail-lf1-f68.google.com (HELO mail-lf1-f68.google.com) (209.85.167.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 08:58:19 +0000 Received: by mail-lf1-f68.google.com with SMTP id l11so9821613lfk.6 for ; Mon, 09 Sep 2019 01:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9g0QCwUi/Ze98DF0rI4jz/QCl9PfsEAGIoB7XmosVxo=; b=X6nQ0qBsysw5XLntJ5KQc/dzchCepn13fQD0nH396qIwfj0iYLZRs2ET+nbBA/upWU RXpkZBujs0C9+0tnuGAclESzCPwzFnDhOyWNTRTpj7qy0xEwCU3x/wJKLUd0/hz8L720 jdVIo4XTrz0tWARr8jkkCuW4uo9yf2cDrBa5iE+YbYjRXVa1p9oVCPwP1Xv2/w4aW2wT DR/JiNcOEwVNCBV5LeK+0tV5PucFIcVeqwrhV54uDO/FHuTcwMxqbUX3TNFw2Cs8nj25 AY47W5Po93y2zJcOOMBBNTu8Xzm3c8jmqVFQCGhnmad+l0izTU+SHSaCiXDzV1my0Qh9 5Wng== MIME-Version: 1.0 References: <20190515124006.25840-1-christophe.lyon@st.com> <20190515124006.25840-14-christophe.lyon@st.com> <19a091e0-c1fe-c4f7-5eab-5e09ab1de3fd@foss.arm.com> <2ab4a3ea-22a6-0b60-7e47-8173dc203be6@foss.arm.com> In-Reply-To: <2ab4a3ea-22a6-0b60-7e47-8173dc203be6@foss.arm.com> From: Christophe Lyon Date: Mon, 09 Sep 2019 08:58:00 -0000 Message-ID: Subject: Re: [ARM/FDPIC v5 13/21] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture To: Kyrill Tkachov Cc: Christophe Lyon , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00470.txt.bz2 On Thu, 5 Sep 2019 at 11:03, Kyrill Tkachov w= rote: > > Hi Christophe, > > On 9/5/19 9:30 AM, Christophe Lyon wrote: > > On Thu, 29 Aug 2019 at 17:32, Kyrill Tkachov > > wrote: > >> Hi Christophe, > >> > >> On 5/15/19 1:39 PM, Christophe Lyon wrote: > >>> Without this, when we are unwinding across a signal frame we can jump > >>> to an even address which leads to an exception. > >>> > >>> This is needed in __gnu_persnality_sigframe_fdpic() when restoring the > >>> PC from the signal frame since the PC saved by the kernel has the LSB > >>> bit set to zero. > >>> > >>> 2019-XX-XX Christophe Lyon > >>> Micka=C3=ABl Gu=C3=AAn=C3=A9 > >>> > >>> libgcc/ > >>> * config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle v7m > >>> architecture. > >>> > >>> Change-Id: Ie84de548226bcf1751e19a09e8f091fb3013ccea > >>> > >>> diff --git a/libgcc/config/arm/unwind-arm.c > >>> b/libgcc/config/arm/unwind-arm.c > >>> index 9ba73e7..ba47150 100644 > >>> --- a/libgcc/config/arm/unwind-arm.c > >>> +++ b/libgcc/config/arm/unwind-arm.c > >>> @@ -199,6 +199,11 @@ _Unwind_VRS_Result _Unwind_VRS_Set > >>> (_Unwind_Context *context, > >>> return _UVRSR_FAILED; > >>> > >>> vrs->core.r[regno] =3D *(_uw *) valuep; > >>> +#if defined(__ARM_ARCH_7M__) > >>> + /* Force LSB bit since we always run thumb code. */ > >>> + if (regno =3D=3D 15) > >>> + vrs->core.r[regno] |=3D 1; > >>> +#endif > >> Hmm, this looks quite specific. There are other architectures that are > >> thumb-only too (6-M, 7E-M etc). > >> > >> Would checking for __thumb__ be better? > >> > > Right. > > The attached updated patch also uses R_PC instead of 15. > > > Looks ok to me but we'll need to make sure this doesn't break non-FDPIC > targets now. > > A bootstrap and test of an arm-none-linux-gnueabihf targeting thumb > should do it. > Bootstrap of the whole series OK, modulo the problems with the tests discussed in patch 20. (some tests became unsupported on arm-linux-gnueabihf with thumb target) Christophe > Thanks, > > Kyrill > > > > > > Christophe > > > >> Thanks, > >> > >> Kyrill > >> > >> > >>> return _UVRSR_OK; > >>> > >>> case _UVRSC_VFP: > >>> -- > >>> 2.6.3 > >>>