summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2024-11-26 09:34:09 -0800
committerMasahiro Yamada <masahiroy@kernel.org>2024-11-27 09:36:01 +0900
commit52892ed6b03a14b961c1df783ed05763758abc73 (patch)
treef1e991c64bf3586954062960963be39e09e26d73
parent18e885099f1c52755f054202525cb60d3edcda44 (diff)
downloadlwn-52892ed6b03a14b961c1df783ed05763758abc73.tar.gz
lwn-52892ed6b03a14b961c1df783ed05763758abc73.zip
MIPS: Place __kernel_entry at the beginning of text section
Mark __kernel_entry as ".head.text" and place HEAD_TEXT before TEXT_TEXT in the linker script. This ensures that __kernel_entry will be placed at the beginning of text section. Drop mips from scripts/head-object-list.txt. Signed-off-by: Rong Xu <xur@google.com> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Closes: https://lore.kernel.org/lkml/c6719149-8531-4174-824e-a3caf4bc6d0e@alliedtelesis.co.nz/T/ Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-rw-r--r--arch/mips/kernel/head.S1
-rw-r--r--arch/mips/kernel/vmlinux.lds.S1
-rw-r--r--scripts/head-object-list.txt1
3 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index b825ed4476c7..e3ff6179c99f 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -59,6 +59,7 @@
#endif
.endm
+ __HEAD
#ifndef CONFIG_NO_EXCEPT_FILL
/*
* Reserved space for exception handlers.
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 9ff55cb80a64..2b708fac8d2c 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -61,6 +61,7 @@ SECTIONS
/* read-only */
_text = .; /* Text and read-only data */
.text : {
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
diff --git a/scripts/head-object-list.txt b/scripts/head-object-list.txt
index fd5d00bac447..f12b4a7b8406 100644
--- a/scripts/head-object-list.txt
+++ b/scripts/head-object-list.txt
@@ -23,7 +23,6 @@ arch/m68k/coldfire/head.o
arch/m68k/kernel/head.o
arch/m68k/kernel/sun3-head.o
arch/microblaze/kernel/head.o
-arch/mips/kernel/head.o
arch/nios2/kernel/head.o
arch/openrisc/kernel/head.o
arch/parisc/kernel/head.o