@@ -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 @@ -12,10 +12,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#ifdef HAVE_CET_H +# include +#else +# define _CET_ENDBR +#endif .globl _OFForward .globl _OFForward_stret .section __TEXT, __objc_methname, cstring_literals @@ -25,14 +31,16 @@ .section __DATA, __objc_selrefs, literal_pointers, no_dead_strip sel_forwardingTargetForSelector_: .quad str_forwardingTargetForSelector_ .section __DATA, __objc_imageinfo, regular, no_dead_strip - .long 0, 0 + .long 0, 0x40 .section __TEXT, __text, regular, pure_instructions _OFForward: + _CET_ENDBR + pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0xC0, %rsp /* 16-byte alignment */ @@ -102,10 +110,12 @@ popq %rbp jmp _OFMethodNotFound _OFForward_stret: + _CET_ENDBR + pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0xC0, %rsp /* 16-byte alignment */