public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@st.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <christophe.lyon@linaro.org>
Subject: [ARM/FDPIC v4 13/20] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture
Date: Fri, 16 Nov 2018 15:52:00 -0000	[thread overview]
Message-ID: <20181116154808.25154-14-christophe.lyon@st.com> (raw)
In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com>

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  <christophe.lyon@st.com>
	Mickaël Guêné <mickael.guene@st.com>

	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 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:
-- 
2.6.3

  parent reply	other threads:[~2018-11-16 15:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 15:48 [ARM/FDPIC v4 00/20] FDPIC ABI for ARM Christophe Lyon
2018-11-16 15:48 ` [ARM/FDPIC v4 01/20] [ARM] FDPIC: Add -mfdpic option support Christophe Lyon
2018-11-16 15:49 ` [ARM/FDPIC v4 02/20] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Christophe Lyon
2018-11-16 15:49 ` [ARM/FDPIC v4 03/20] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Christophe Lyon
2018-11-16 15:49 ` [ARM/FDPIC v4 04/20] [ARM] FDPIC: Add support for FDPIC for arm architecture Christophe Lyon
2018-11-16 15:50 ` [ARM/FDPIC v4 07/20] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Christophe Lyon
2018-11-16 15:50 ` [ARM/FDPIC v4 05/20] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Christophe Lyon
2018-11-16 15:50 ` [ARM/FDPIC v4 08/20] [ARM] FDPIC: Enforce local/global binding for function descriptors Christophe Lyon
2018-11-16 15:50 ` [ARM/FDPIC v4 06/20] [ARM] FDPIC: Add support for c++ exceptions Christophe Lyon
2018-11-16 15:51 ` [ARM/FDPIC v4 10/20] [ARM] FDPIC: Implement TLS support Christophe Lyon
2018-11-16 15:51 ` [ARM/FDPIC v4 09/20] [ARM] FDPIC: Add support for taking address of nested function Christophe Lyon
2018-11-16 15:52 ` [ARM/FDPIC v4 11/20] [ARM] FDPIC: Add support to unwind FDPIC signal frame Christophe Lyon
2018-11-16 15:52 ` [ARM/FDPIC v4 12/20] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Christophe Lyon
2018-11-16 15:52 ` Christophe Lyon [this message]
2018-11-16 15:53 ` [ARM/FDPIC v4 14/20] [ARM][testsuite] FDPIC: Skip unsupported tests Christophe Lyon
2018-11-16 15:53 ` [ARM/FDPIC v4 15/20] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns Christophe Lyon
2018-11-16 15:53 ` [ARM/FDPIC v4 16/20] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Christophe Lyon
2018-11-16 15:54 ` [ARM/FDPIC v4 18/20] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Christophe Lyon
2018-11-16 15:54 ` [ARM/FDPIC v4 17/20] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Christophe Lyon
2018-11-16 15:54 ` [ARM/FDPIC v4 19/20] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc Christophe Lyon
2018-11-16 15:55 ` [ARM/FDPIC v4 20/20] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Christophe Lyon
2018-11-26 10:14 ` [ARM/FDPIC v4 00/20] FDPIC ABI for ARM Christophe Lyon
2018-12-03  9:19   ` Christophe Lyon
2018-12-11 10:27     ` Christophe Lyon
2019-01-02 11:44       ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181116154808.25154-14-christophe.lyon@st.com \
    --to=christophe.lyon@st.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).