Index: src/runtime/lookup-asm/lookup-asm-amd64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-amd64-elf.S +++ src/runtime/lookup-asm/lookup-asm-amd64-elf.S @@ -102,11 +102,13 @@ .LreturnNilMethod: leaq .LnilMethod(%rip), %rax ret .LnilMethod: + _CET_ENDBR + xorq %rax, %rax ret #if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-amd64-macho.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-amd64-macho.S +++ src/runtime/lookup-asm/lookup-asm-amd64-macho.S @@ -96,7 +96,9 @@ LreturnNilMethod: leaq LnilMethod(%rip), %rax ret LnilMethod: + _CET_ENDBR + xorq %rax, %rax ret Index: src/runtime/lookup-asm/lookup-asm-amd64-win64.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-amd64-win64.S +++ src/runtime/lookup-asm/lookup-asm-amd64-win64.S @@ -111,7 +111,9 @@ .LreturnNilMethod: leaq .LnilMethod(%rip), %rax ret .LnilMethod: + _CET_ENDBR + xorq %rax, %rax ret Index: src/runtime/lookup-asm/lookup-asm-arm64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-arm64-elf.S +++ src/runtime/lookup-asm/lookup-asm-arm64-elf.S @@ -99,11 +99,15 @@ .LreturnNilMethod: adr x0, .LnilMethod ret .LnilMethod: +#ifdef HAVE_BTI + bti c +#endif + mov x0, #0 ret #if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-x86-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-x86-elf.S +++ src/runtime/lookup-asm/lookup-asm-x86-elf.S @@ -115,10 +115,12 @@ addl $_GLOBAL_OFFSET_TABLE_, %eax leal .LnilMethod@GOTOFF(%eax), %eax ret .LnilMethod: + _CET_ENDBR + xorl %eax, %eax ret .LgetEIP: movl (%esp), %eax Index: src/runtime/lookup-asm/lookup-asm-x86-win32.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-x86-win32.S +++ src/runtime/lookup-asm/lookup-asm-x86-win32.S @@ -104,7 +104,9 @@ .LreturnNilMethod: movl $.LnilMethod, %eax ret .LnilMethod: + _CET_ENDBR + xorl %eax, %eax ret