i386: Insert ENDBR after __morestack call

Programming / Compilers / GCC - hjl [138bc75d-0d04-0410-961f-82ee72b054a4] - 18 April 2018 19:14 EDT

Since __morestack will jump back to its callee via indirect call, we need to insert ENDBR after calling __morestack.

gcc/

PR target/85388
- config/i386/i386.c (ix86_expand_split_stack_prologue): Insert ENDBR after calling __morestack.

gcc/testsuite/

PR target/85388
- gcc.dg/pr85388-1.c: New test.
- gcc.dg/pr85388-2.c: Likewise.
- gcc.dg/pr85388-3.c: Likewise.
- gcc.dg/pr85388-4.c: Likewise.
- gcc.dg/pr85388-5.c: Likewise.
- gcc.dg/pr85388-6.c: Likewise.

ccfbf42718c i386: Insert ENDBR after __morestack call
gcc/ChangeLog | 6 ++++
gcc/config/i386/i386.c | 11 ++++++-
gcc/testsuite/ChangeLog | 10 ++++++
gcc/testsuite/gcc.dg/pr85388-1.c | 50 +++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/pr85388-2.c | 56 ++++++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/pr85388-3.c | 65 +++++++++++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/pr85388-4.c | 69 ++++++++++++++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/pr85388-5.c | 54 +++++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/pr85388-6.c | 56 ++++++++++++++++++++++++++++++++
9 files changed, 376 insertions(+), 1 deletion(-)

Upstream: gcc.gnu.org


  • Share