https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82699
Bug ID: 82699 Summary: ENDBR isn't generated at function entrance Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: igor.v.tsimbalist at intel dot com Blocks: 81652 Target Milestone: --- [hjl@gnu-tools-1 xxx]$ cat x.i extern int bar (int); int foo (int i) { return bar (i); } [hjl@gnu-tools-1 xxx]$ make /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fcf-protection -mcet -O2 -mfentry -pg -S x.i [hjl@gnu-tools-1 xxx]$ cat x.s .file "x.i" .text .p2align 4,,15 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc 1: call __fentry__ endbr64 <<<<<<<<<<<<<<<< Wrong place. subq $8, %rsp .cfi_def_cfa_offset 16 addq $8, %rsp .cfi_def_cfa_offset 8 jmp bar .cfi_endproc .LFE0: .size foo, .-foo .ident "GCC: (GNU) 8.0.0 20171024 (experimental)" .section .note.GNU-stack,"",@progbits .section .note.gnu.property,"a" .align 8 .long 1f - 0f .long 4f - 1f .long 5 0: .string "GNU" 1: .align 8 .long 0xc0000002 .long 3f - 2f 2: .long 0x3 3: .align 8 4: [hjl@gnu-tools-1 xxx]$ Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81652 [Bug 81652] [meta-bug] -fcf-protection=full -mcet bugs