From bf55a678389eaa73186f50f12a41fa2448ff85e1 Mon Sep 17 00:00:00 2001 From: Larry Bassel Date: Tue, 8 Feb 2011 14:14:49 -0800 Subject: [PATCH] arm: 1M align init, text, rodata if CONFIG_STRICT_MEMORY_RWX is set Init code, text, rodata and data need different permissions and so they need to be on different pages. The kernel 1-to-1 mapping is constructed using 1M pages to improve TLB performance and this should not be changed (to 4K pages). Therefore ensure that each of these regions starts on a 1M boundary. Change-Id: I855b58d3deff6c34e58d1cbdef4b360c2b23ca6d Signed-off-by: Larry Bassel Signed-off-by: Jin Hong (cherry picked from commit 4cfee820adbdd7514b67e59c1b87008436d984ab) --- arch/arm/kernel/vmlinux.lds.S | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index f3778c7bd74..826518d9828 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -8,7 +8,10 @@ #include #include #include - +#ifdef CONFIG_STRICT_MEMORY_RWX +#include +#endif + #define PROC_INFO \ . = ALIGN(4); \ VMLINUX_SYMBOL(__proc_info_begin) = .; \ @@ -90,6 +93,7 @@ SECTIONS _text = .; HEAD_TEXT } + .text : { /* Real text segment */ _stext = .; /* Text and read-only data */ __exception_text_start = .; @@ -111,6 +115,9 @@ SECTIONS *(.got) /* Global offset table */ ARM_CPU_KEEP(PROC_INFO) } +#ifdef CONFIG_STRICT_MEMORY_RWX + . = ALIGN(1<