diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
commit | 88a3ea34080ad3087a8191fbf479543153175d59 (patch) | |
tree | 34eaec34d3588e09f9a77abba776266f124dc823 /libgcc/config/i386/shadow-stack-unwind.h | |
parent | 25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff) | |
parent | e65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff) | |
download | gccgo.tar.gz |
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/i386/shadow-stack-unwind.h')
-rw-r--r-- | libgcc/config/i386/shadow-stack-unwind.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libgcc/config/i386/shadow-stack-unwind.h b/libgcc/config/i386/shadow-stack-unwind.h index ef75d97aa2f..b7c3d98a9dc 100644 --- a/libgcc/config/i386/shadow-stack-unwind.h +++ b/libgcc/config/i386/shadow-stack-unwind.h @@ -22,30 +22,30 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef __x86_64__ -# define incssp(x) __builtin_ia32_incsspq ((x)) -# define rdssp(x) __builtin_ia32_rdsspq (x) -#else -# define incssp(x) __builtin_ia32_incsspd ((x)) -# define rdssp(x) __builtin_ia32_rdsspd (x) -#endif +/* NB: We need _get_ssp and _inc_ssp from <cetintrin.h>. But we can't + include <x86intrin.h> which ends up including <mm_malloc.h>, which + includes <stdlib.h> and <errno.h> unconditionally. But we can't + include any libc system headers unconditionally from libgcc. Avoid + including <mm_malloc.h> here by defining _IMMINTRIN_H_INCLUDED. */ +#define _IMMINTRIN_H_INCLUDED +#include <cetintrin.h> +#undef _IMMINTRIN_H_INCLUDED /* Unwind the shadow stack for EH. */ #undef _Unwind_Frames_Extra #define _Unwind_Frames_Extra(x) \ do \ { \ - unsigned long ssp = 0; \ - ssp = rdssp (ssp); \ + _Unwind_Word ssp = _get_ssp (); \ if (ssp != 0) \ { \ - unsigned long tmp = (x); \ + _Unwind_Word tmp = (x); \ while (tmp > 255) \ { \ - incssp (tmp); \ + _inc_ssp (tmp); \ tmp -= 255; \ } \ - incssp (tmp); \ + _inc_ssp (tmp); \ } \ } \ while (0) |