diff --git a/block_trampolines.S b/block_trampolines.S index e943818c..cbf72fdf 100644 --- a/block_trampolines.S +++ b/block_trampolines.S @@ -23,6 +23,7 @@ // x86-64 trampoline //////////////////////////////////////////////////////////////////////////////// .macro trampoline arg0, arg1 + endbr64 mov -0x1007(%rip), \arg1 # Load the block pointer into the second argument xchg \arg1, \arg0 # Swap the first and second arguments jmp *-0x1008(%rip) # Call the block function @@ -161,6 +162,7 @@ // AArch64 (ARM64) trampoline //////////////////////////////////////////////////////////////////////////////// .macro trampoline arg0, arg1 + bti c adr x17, #-4096 mov \arg1, \arg0 ldp \arg0, x17, [x17] diff --git a/objc_msgSend.aarch64.S b/objc_msgSend.aarch64.S index e9e30ba3..dc52e464 100644 --- a/objc_msgSend.aarch64.S +++ b/objc_msgSend.aarch64.S @@ -47,7 +47,7 @@ # define EH_NOP .seh_nop #else // Marks the real start and end of the function -# define EH_START .cfi_startproc +# define EH_START .cfi_startproc; bti c # define EH_END .cfi_endproc // The following directives are either not diff --git a/objc_msgSend.x86-64.S b/objc_msgSend.x86-64.S index 2d153140..1dd516d0 100644 --- a/objc_msgSend.x86-64.S +++ b/objc_msgSend.x86-64.S @@ -8,7 +8,7 @@ # define SECOND_ARGUMENT %rdx # define THIRD_ARGUMENT %r8 #else -# define START_PROC(x) .cfi_startproc +# define START_PROC(x) .cfi_startproc; endbr64 # define END_PROC(x) .cfi_endproc # define FRAME_OFFSET(x) .cfi_adjust_cfa_offset x # define FIRST_ARGUMENT_STR "%rdi"