libgcc/CET: Add _CET_ENDBR to __stack_split_initialize
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 19 Apr 2018 15:22:27 +0000 (15:22 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 19 Apr 2018 15:22:27 +0000 (08:22 -0700)
Program received signal SIGSEGV, Segmentation fault.
__stack_split_initialize ()
    at /export/gnu/import/git/sources/gcc/libgcc/config/i386/morestack.S:751
751 leaq -16000(%rsp),%rax # We should have at least 16K.
Missing separate debuginfos, use: dnf debuginfo-install libgcc-8.0.1-0.21.0.fc28.x86_64
(gdb) disass
Dump of assembler code for function __stack_split_initialize:
=> 0x0000000000402858 <+0>: lea    -0x3e80(%rsp),%rax
   0x0000000000402860 <+8>: mov    %rax,%fs:0x70
   0x0000000000402869 <+17>: sub    $0x8,%rsp
   0x000000000040286d <+21>: mov    %rsp,%rdi
   0x0000000000402870 <+24>: mov    $0x3e80,%esi
   0x0000000000402875 <+29>: callq  0x401810 <__generic_morestack_set_initial_sp>
   0x000000000040287a <+34>: add    $0x8,%rsp
   0x000000000040287e <+38>: retq
End of assembler dump.
(gdb)

This patch adds the missing ENDBR to __stack_split_initialize.

PR libgcc/85379
* config/i386/morestack.S (__stack_split_initialize): Add
_CET_ENDBR.

From-SVN: r259497

libgcc/ChangeLog
libgcc/config/i386/morestack.S

index 7de2ff6e565157ff3cf937d904f2531faf61539c..674d2041bd762dcbc0532c0ef9dc0d1a7d3d9e6e 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR libgcc/85379
+       * config/i386/morestack.S (__stack_split_initialize): Add
+       _CET_ENDBR.
+
 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
 
        * configure: Regenerated.
index eca441a28675a6ffbb5b050a6f4a9ab8dbc018b3..99e65eaaff44a8a8c9a98e4f4b8f7fcd6f8c6cd4 100644 (file)
@@ -730,6 +730,7 @@ __morestack_large_model:
 #endif
 
 __stack_split_initialize:
+       _CET_ENDBR
 
 #ifndef __x86_64__