@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2023 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -14,16 +14,24 @@ */ #include "config.h" #include "platform.h" + +#ifdef HAVE_CET_H +# include +#else +# define _CET_ENDBR +#endif .globl _OFForward .globl _OFForward_stret .section __TEXT, __text, regular, pure_instructions _OFForward: + _CET_ENDBR + pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0xC0, %rsp /* 16-byte alignment */ @@ -103,10 +111,12 @@ popq %rbp jmp _OFMethodNotFound _OFForward_stret: + _CET_ENDBR + pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0xC0, %rsp /* 16-byte alignment */ @@ -188,10 +198,12 @@ popq %rbp jmp _OFMethodNotFound_stret init: + _CET_ENDBR + leaq module(%rip), %rdi jmp ___objc_exec_class .section __DATA, __mod_init_func, mod_init_funcs .quad init