From 8565e13d5d29eb32bed9674240593315f3bdd7f5 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 24 Oct 2022 11:17:04 +0200 Subject: [PATCH] head fix Signed-off-by: Jiri Slaby --- arch/x86/kernel/head_64.S | 4 +++- arch/x86/kernel/vmlinux.lds.S | 1 + include/linux/init.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index d860d437631b..417bcd9da3df 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -39,8 +39,8 @@ L4_START_KERNEL = l4_index(__START_KERNEL_map) L3_START_KERNEL = pud_index(__START_KERNEL_map) .text - __HEAD .code64 + __HEAD_FIRST SYM_CODE_START_NOALIGN(startup_64) UNWIND_HINT_EMPTY /* @@ -126,6 +126,8 @@ SYM_CODE_START_NOALIGN(startup_64) jmp 1f SYM_CODE_END(startup_64) + __HEAD + SYM_CODE_START(secondary_startup_64) UNWIND_HINT_EMPTY ANNOTATE_NOENDBR diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 15f29053cec4..a10a9c50bc3f 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -126,6 +126,7 @@ SECTIONS _text = .; _stext = .; /* bootstrapping code */ + KEEP(*(.head.first.text)) HEAD_TEXT TEXT_TEXT SCHED_TEXT diff --git a/include/linux/init.h b/include/linux/init.h index ca827e2fb0da..3a11d19e39cf 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -92,6 +92,7 @@ #define __memexitconst __section(".memexit.rodata") /* For assembly routines */ +#define __HEAD_FIRST .section ".head.first.text","ax" #define __HEAD .section ".head.text","ax" #define __INIT .section ".init.text","ax" #define __FINIT .previous -- 2.38.0