2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-19 04:02:17 +00:00

Merge pull request #199 from PeterYang12/endbr

Add support for Indirect Branch Tracking (IBT)
This commit is contained in:
Oliver Kowalke
2022-05-16 10:39:25 +02:00
committed by GitHub
3 changed files with 20 additions and 3 deletions

View File

@@ -23,13 +23,18 @@
* ---------------------------------------------------------------------------------- *
* *
****************************************************************************************/
# if defined __CET__
# include <cet.h>
# else
# define _CET_ENDBR
# endif
.file "jump_x86_64_sysv_elf_gas.S"
.text
.globl jump_fcontext
.type jump_fcontext,@function
.align 16
jump_fcontext:
_CET_ENDBR
leaq -0x38(%rsp), %rsp /* prepare stack */
#if !defined(BOOST_USE_TSX)

View File

@@ -23,13 +23,18 @@
* ---------------------------------------------------------------------------------- *
* *
****************************************************************************************/
# if defined __CET__
# include <cet.h>
# else
# define _CET_ENDBR
# endif
.file "make_x86_64_sysv_elf_gas.S"
.text
.globl make_fcontext
.type make_fcontext,@function
.align 16
make_fcontext:
_CET_ENDBR
/* first arg of make_fcontext() == top of context-stack */
movq %rdi, %rax
@@ -64,6 +69,7 @@ make_fcontext:
ret /* return pointer to context-data */
trampoline:
_CET_ENDBR
/* store return address on stack */
/* fix stack alignment */
push %rbp
@@ -71,6 +77,7 @@ trampoline:
jmp *%rbx
finish:
_CET_ENDBR
/* exit code is zero */
xorq %rdi, %rdi
/* exit application */

View File

@@ -23,13 +23,18 @@
* ---------------------------------------------------------------------------------- *
* *
****************************************************************************************/
# if defined __CET__
# include <cet.h>
# else
# define _CET_ENDBR
# endif
.file "ontop_x86_64_sysv_elf_gas.S"
.text
.globl ontop_fcontext
.type ontop_fcontext,@function
.align 16
ontop_fcontext:
_CET_ENDBR
/* preserve ontop-function in R8 */
movq %rdx, %r8