lkml.org 
[lkml]   [2022]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] x86/alternative: fix undefined reference to __ibt_endbr_seal[_end]
From
Date
On 2022/10/11 19:38, Miaohe Lin wrote:
> 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 like below:
>
> 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 explicit 'noinline' to help gcc optimize them away.
> [Thanks Peter Zijlstra for tweaking the commit log.]
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Add cc Peter Zijlstra.

Change log for v2:
Tweak the commit log per Peter Zijlstra. Thanks!

I should have done this in previous thread. Sorry for make noise.

Thanks,
Miaohe Lin


> ---
> 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 */
>
>

\
 
 \ /
  Last update: 2022-10-11 05:47    [W:0.106 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site