i386: Insert ENDBR to trampoline for -fcf-protection=branch -mibt
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 27 Mar 2018 17:18:51 +0000 (17:18 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 27 Mar 2018 17:18:51 +0000 (10:18 -0700)
commit6514899f3110f618f60066dca796c327ef20e9fa
tree74c73da032e30d770b72cef8e23b63c614e53b74
parentae0c28bb271ab63aef76e77eacf57bbc23a45564
i386: Insert ENDBR to trampoline for -fcf-protection=branch -mibt

When -fcf-protection=branch -mibt are used, we need to insert ENDBR
to trampoline.  TRAMPOLINE_SIZE is creased by 4 bytes to accommodate
4-byte ENDBR instruction.

gcc/

PR target/85044
* config/i386/i386.c (ix86_trampoline_init): Insert ENDBR for
-fcf-protection=branch -mibt.
* config/i386/i386.h (TRAMPOLINE_SIZE): Increased by 4 bytes.

gcc/testsuite/

PR target/85044
* gcc.target/i386/pr85044.c: New test.

From-SVN: r258897
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr85044.c [new file with mode: 0644]