Skip to content

Commit 023e59d

Browse files
MiaoheLinKAGA-KOKO
authored andcommitted
x86/alternative: Remove noinline from __ibt_endbr_seal[_end]() stubs
Due to the explicit 'noinline' GCC-7.3 is not able to optimize away the argument setup of: apply_ibt_endbr(__ibt_endbr_seal, __ibt_enbr_seal_end); even when X86_KERNEL_IBT=n and the function is an empty stub, which leads to link errors due to missing __ibt_endbr_seal* symbols: ld: arch/x86/kernel/alternative.o: in function `alternative_instructions': alternative.c:(.init.text+0x15d): undefined reference to `__ibt_endbr_seal_end' ld: alternative.c:(.init.text+0x164): undefined reference to `__ibt_endbr_seal' Remove the explicit 'noinline' to help gcc optimize them away. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20221011113803.956808-1-linmiaohe@huawei.com
1 parent b7b275e commit 023e59d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/kernel/alternative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end)
624624

625625
#else
626626

627-
void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end) { }
627+
void __init_or_module apply_ibt_endbr(s32 *start, s32 *end) { }
628628

629629
#endif /* CONFIG_X86_KERNEL_IBT */
630630

0 commit comments

Comments
 (0)