diff options
author | Christophe Lyon <christophe.lyon@st.com> | 2019-09-10 09:58:44 +0200 |
---|---|---|
committer | Christophe Lyon <clyon@gcc.gnu.org> | 2019-09-10 09:58:44 +0200 |
commit | 84818dbb70375810557ce9d8880c4345e845c01d (patch) | |
tree | 05518d4a47b33ba9fb18fe2c4b548d0c2b60d4fc /libgcc | |
parent | bb33a88e3d4746470d3f969c6d764d20d726f9f1 (diff) | |
download | gcc-84818dbb70375810557ce9d8880c4345e845c01d.zip gcc-84818dbb70375810557ce9d8880c4345e845c01d.tar.gz gcc-84818dbb70375810557ce9d8880c4345e845c01d.tar.bz2 |
[ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture
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-09-10 Christophe Lyon <christophe.lyon@st.com>
Mickaël Guêné <mickael.guene@st.com>
libgcc/
* config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle thumb-only
architecture.
Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>
From-SVN: r275575
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 7 | ||||
-rw-r--r-- | libgcc/config/arm/unwind-arm.c | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d6d73e9..d61374d 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,7 +1,12 @@ 2019-09-10 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> - libgcc/ + * config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle thumb-only + architecture. + +2019-09-10 Christophe Lyon <christophe.lyon@st.com> + Mickaël Guêné <mickael.guene@st.com> + * unwind-arm-common.inc (ARM_SET_R7_RT_SIGRETURN) (THUMB2_SET_R7_RT_SIGRETURN, FDPIC_LDR_R12_WITH_FUNCDESC) (FDPIC_LDR_R9_WITH_GOT, FDPIC_LDR_PC_WITH_RESTORER) diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index 9ba73e7..8313ee0 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] = *(_uw *) valuep; +#if defined(__thumb__) + /* Force LSB bit since we always run thumb code. */ + if (regno == R_PC) + vrs->core.r[regno] |= 1; +#endif return _UVRSR_OK; case _UVRSC_VFP: |