x86/alternatives: Move apply_relocation() out of init section
authorArnd Bergmann <arnd@arndb.de>
Mon, 4 Dec 2023 07:28:41 +0000 (08:28 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 Dec 2023 13:21:49 +0000 (14:21 +0100)
commit86ed430cf5296ca97a66f1f37e30b7dfe47cd36f
tree94a4e8aa7d43a63caeab0dce09d3ae26e3783a97
parent3a1d3829e193c091475ceab481c5f8deab385023
x86/alternatives: Move apply_relocation() out of init section

This function is now called from a few places that are no __init_or_module,
resulting a link time warning:

  WARNING: modpost: vmlinux: section mismatch in reference: patch_dest+0x8a (section: .text) -> apply_relocation (section: .init.text)

Remove the annotation here.

[ mingo: Also sync up add_nop() with these changes. ]

Fixes: 17bce3b2ae2d ("x86/callthunks: Handle %rip-relative relocations in call thunk template")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/r/20231204072856.1033621-1-arnd@kernel.org
arch/x86/kernel/alternative.c