Skip to content

Commit d42a2a8

Browse files
committed
x86/alternatives: Fix section mismatch warnings
Fix stuff like: WARNING: modpost: vmlinux.o: section mismatch in reference: \ __optimize_nops (section: .text) -> debug_alternative (section: .init.data) Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230513160146.16039-1-bp@alien8.de
1 parent d2408e0 commit d42a2a8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/x86/kernel/alternative.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ static int skip_nops(u8 *instr, int offset, int len)
193193
* Optimize a sequence of NOPs, possibly preceded by an unconditional jump
194194
* to the end of the NOP sequence into a single NOP.
195195
*/
196-
static bool __optimize_nops(u8 *instr, size_t len, struct insn *insn,
197-
int *next, int *prev, int *target)
196+
static bool __init_or_module
197+
__optimize_nops(u8 *instr, size_t len, struct insn *insn, int *next, int *prev, int *target)
198198
{
199199
int i = *next - insn->length;
200200

@@ -765,7 +765,7 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
765765

766766
#ifdef CONFIG_X86_KERNEL_IBT
767767

768-
static void poison_endbr(void *addr, bool warn)
768+
static void __init_or_module poison_endbr(void *addr, bool warn)
769769
{
770770
u32 endbr, poison = gen_endbr_poison();
771771

0 commit comments

Comments
 (0)