mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 03:21:06 +01:00
arm64: Add a BTI landing pad to .mcount
The .mcount function needs a BTI branch target. As we can't rely on asm.h being included use the hint version of a "bti c" instruction. This is a nop when BTI is not supported or not used. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42230
This commit is contained in:
parent
5270cc9757
commit
0590ed0967
@ -68,6 +68,8 @@ static void _mcount
|
||||
" .globl .mcount \n" \
|
||||
" .mcount: \n" \
|
||||
" .cfi_startproc \n" \
|
||||
/* Allow this to work with BTI, see BTI_C in asm.h */ \
|
||||
" hint #34 \n" \
|
||||
/* Load the caller return address as frompc */ \
|
||||
" ldr x0, [x29, #8] \n" \
|
||||
/* Use our return address as selfpc */ \
|
||||
|
Loading…
Reference in New Issue
Block a user