lkml.org 
[lkml]   [2020]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] riscv: move exception table immediately after RO_DATA
Date
Move EXCEPTION_TABLE immediately after RO_DATA. Make it easy to set the
attribution of the sections which should be read-only at a time.
Move .sdata to indicate the start of data section with write permission.
This patch is prepared for STRICT_KERNEL_RWX support.

Signed-off-by: Zong Li <zong.li@sifive.com>
---
arch/riscv/kernel/vmlinux.lds.S | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 1e0193ded420..4ba8a5397e8b 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -9,6 +9,7 @@
#include <asm/page.h>
#include <asm/cache.h>
#include <asm/thread_info.h>
+#include <asm/set_memory.h>

OUTPUT_ARCH(riscv)
ENTRY(_start)
@@ -52,12 +53,15 @@ SECTIONS
}

/* Start of data section */
- _sdata = .;
RO_DATA(L1_CACHE_BYTES)
.srodata : {
*(.srodata*)
}

+ EXCEPTION_TABLE(0x10)
+
+ _sdata = .;
+
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
.sdata : {
__global_pointer$ = . + 0x800;
@@ -69,8 +73,6 @@ SECTIONS

BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)

- EXCEPTION_TABLE(0x10)
-
.rel.dyn : {
*(.rel.dyn*)
}
--
2.25.0
\
 
 \ /
  Last update: 2020-02-17 09:33    [W:0.131 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site