[PATCH] x86: Always save and restore shadow stack pointer

H.J. Lu hjl.tools@gmail.com
Tue Feb 9 13:11:15 GMT 2021


On Tue, Feb 9, 2021 at 12:59 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Mon, Feb 8, 2021 at 3:07 PM H.J. Lu via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > When the SHSTK feature is not available or not enabled, RDSSP is a NOP,
> > always save and restore shadow stack pointer to support compiling source
> > codes, containing __builtin_setjmp and __builtin_longjmp, with different
> > -fcf-protection options.
>
> Is that an ABI change for -fno-cf-protection?
>

Currently you can't mix object files with __builtin_setjmp and __builtin_longjmp
compiled with -fcf-protection and -fcf-protection=none.  This patch fixes it for
GCC 11 and newer.  It does nothing for object files compiled by older versions
of GCC.

-- 
H.J.


More information about the Gcc-patches mailing list