linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/alternative: fix undefined reference to __ibt_endbr_seal[_end]
@ 2022-10-09 15:45 Miaohe Lin
  2022-10-09 12:28 ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: Miaohe Lin @ 2022-10-09 15:45 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen; +Cc: hpa, x86, linux-kernel, linmiaohe

When I compile the kernel bzImage, there are several compile errors:

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'

It's because __ibt_endbr_seal and __ibt_endbr_seal_end are not optimized
away when CONFIG_X86_KERNEL_IBT isn't enabled. Remove noinline attribute
to help gcc optimize them away.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 arch/x86/kernel/alternative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 5cadcea035e0..beaf9fc44e2f 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -624,7 +624,7 @@ void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end)
 
 #else
 
-void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end) { }
+void __init_or_module apply_ibt_endbr(s32 *start, s32 *end) { }
 
 #endif /* CONFIG_X86_KERNEL_IBT */
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-11  2:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-09 15:45 [PATCH] x86/alternative: fix undefined reference to __ibt_endbr_seal[_end] Miaohe Lin
2022-10-09 12:28 ` Peter Zijlstra
2022-10-09 12:44   ` Miaohe Lin
2022-10-09 13:11     ` Peter Zijlstra
2022-10-11  2:26       ` Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).