From patchwork Fri Jul 13 16:11:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 141928 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp991703ljj; Fri, 13 Jul 2018 09:16:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdpxdOLE9mrIuFMy+0nfrhDuojQGFVDZ7H8KUUchhV3U+InRiAZkZpOFUd84egXk91M0GHO X-Received: by 2002:a63:440a:: with SMTP id r10-v6mr6628684pga.27.1531498600506; Fri, 13 Jul 2018 09:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531498600; cv=none; d=google.com; s=arc-20160816; b=rgi/UMlkQ8gbMTuFbyLAVTgm4Yu5fAEyzCgzv6oXQqXI/UnbaeGHRrU2qlxkclYnwr MQev1YVkR0JVeG2bSEbR0RtspVmctFdaHSjgr47UnhmY8dc0Ry7lFKFCHOF1McKN4xfd ebRQ3c2YyKPsuSuH07esCciZjohlVsus9z5Qt/Pmd6m+pKt89Imo4rFzolwQbcENkzxg i7fgDq75jvRcbSwEP/SLvNoiMTvCQT+Ix39Ji9+D/SJ1HRwXkWXRzgWkQo7ypygZRxL1 WvRW3vYkDlxI/KLthZfuYtdiV92fKu1Sq45q86B2vWW/nQfgrKHBiTxTvJAOjS7oEOXU Myug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=Tbb6ihnz22lBDAs8hp+xPZtfB+UY9zCmrHCpsZOZ7xI=; b=pf3F0ZKAK90kvbIOobDJv6d5mRdedKavteTtmLdUrfgQPiCiP204H3Eb6eMj/zl1Xg CnayQjtx2q7u3AlSrQouPccRE6eevPyPYpI6uksZf1mNMVc/SifPpcvUshwDwapsemNz FXaeDACht7SX1iagggnqPatBHNucdzilfdOTO1mG+OdQzZBlNK0L4j8o7jj7M5F2ekMj OS6ISPqex9eXB7L/MBOn+WwePPwuxHNuM9FsFwjvcpaD/49RHSv2NLTdFLmhJ1xsemze ezvsMeLRzXgSkdHhNCYqeQ20qhWwkMEekS0xEdiSUP22jVXr19KJibP3RFr1FV9325Jh /Mow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wgpgJnOj; spf=pass (google.com: domain of gcc-patches-return-481523-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-481523-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id d31-v6si24265407pla.190.2018.07.13.09.16.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 09:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-481523-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wgpgJnOj; spf=pass (google.com: domain of gcc-patches-return-481523-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-481523-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=n9b9tHtUxkV/IN1GzlRf6lsVrXTBZqGfODpD/+QH+7bI+E6Ni5P35 rhlmSVnchTLh3IK9jJ/wycZpu3qzTGQ5YzYqe0sgE7j/CxZ2epF5piJaUUuvFxhw OjCIE87/i/PuozW6gm53lLdzgsYsbBAZRVmgYgqimAXhDjCUj0jEEw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=zrrokHAP8RAKR6D/yotlfQDNNf4=; b=wgpgJnOjm79i8CE9Enlxf5PIX7mP Pfxe/F+CwSp1eEeVWOvGPtrjgKyNZRcG8Uqx++xKZjbkJYL1tfx6NzRDtNy5mgx7 tBSTUxKgIpjQf/4lGMwG7pDLqIYSYD22CT6Js2bwd180aVO9on5Fc/PM/sauoYuP yVkbKPdAmqJWJ6w= Received: (qmail 34891 invoked by alias); 13 Jul 2018 16:16:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 34880 invoked by uid 89); 13 Jul 2018 16:16:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1149 X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jul 2018 16:16:26 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w6DGEBNe008274; Fri, 13 Jul 2018 18:16:23 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2k6y3vr2nv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Jul 2018 18:16:23 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 12A5138; Fri, 13 Jul 2018 16:16:23 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EE74EA6CF; Fri, 13 Jul 2018 16:16:22 +0000 (GMT) Received: from gnb.st.com (10.75.127.48) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 13 Jul 2018 18:16:22 +0200 From: To: CC: Subject: [ARM/FDPIC v2 13/21] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Date: Fri, 13 Jul 2018 18:11:08 +0200 Message-ID: <20180713161136.29104-14-christophe.lyon@st.com> In-Reply-To: <20180713161136.29104-1-christophe.lyon@st.com> References: <20180713161136.29104-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 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. 2018-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle v7m architecture. Change-Id: Ie84de548226bcf1751e19a09e8f091fb3013ccea -- 2.6.3 diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index 564e4f13..6da6e3d 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -198,6 +198,11 @@ _Unwind_VRS_Result _Unwind_VRS_Set (_Unwind_Context *context, return _UVRSR_FAILED; vrs->core.r[regno] = *(_uw *) valuep; +#if defined(__ARM_ARCH_7M__) + /* Force LSB bit since we always run thumb code. */ + if (regno == 15) + vrs->core.r[regno] |= 1; +#endif return _UVRSR_OK; case _UVRSC_VFP: