lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/3] MIPS: Move kernel head into a standalone section
Date
That's what already done by Arm64 and other architectures.
That would allow us put more things like PE headers safely into
the header.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
arch/mips/kernel/head.S | 4 ++--
arch/mips/kernel/vmlinux.lds.S | 8 ++++++--
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index c7c2795837e7..8081a905a71c 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -59,6 +59,8 @@
#endif
.endm

+ __HEAD
+_head:
#ifndef CONFIG_NO_EXCEPT_FILL
/*
* Reserved space for exception handlers.
@@ -67,8 +69,6 @@
.fill 0x400
#endif

-EXPORT(_stext)
-
/*
* Give us a fighting chance of running if execution beings at the
* kernel load address. This is needed because this platform does
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index f185a85a27c1..b9ace667b82b 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -57,8 +57,12 @@ SECTIONS
#endif
. = LINKER_LOAD_ADDRESS;
/* read-only */
- _text = .; /* Text and read-only data */
- .text : {
+ .head.text : {
+ _text = .;
+ HEAD_TEXT
+ }
+ .text : { /* Real text segment */
+ _stext = .; /* Text and read-only data */
TEXT_TEXT
SCHED_TEXT
CPUIDLE_TEXT
--
2.27.0.rc0
\
 
 \ /
  Last update: 2020-05-27 08:36    [W:0.052 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site