Revert "Revert "arm: 1M align init, text, rodata if CONFIG_STRICT_MEMORY_RWX is set""
This reverts commit e6e30a85204bf1ce83d8ce72dba7007fd8ba7a13.
Signed-off-by: Jin Hong <jinh@codeaurora.org>
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index e5287f2..8652d45 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -7,6 +7,9 @@
#include <asm/thread_info.h>
#include <asm/memory.h>
#include <asm/page.h>
+#ifdef CONFIG_STRICT_MEMORY_RWX
+#include <asm/pgtable.h>
+#endif
#define PROC_INFO \
VMLINUX_SYMBOL(__proc_info_begin) = .; \
@@ -108,6 +111,9 @@
#endif
}
+#ifdef CONFIG_STRICT_MEMORY_RWX
+ . = ALIGN(1<<SECTION_SHIFT);
+#endif
.text : { /* Real text segment */
_text = .; /* Text and read-only data */
__exception_text_start = .;
@@ -130,6 +136,9 @@
*(.got) /* Global offset table */
ARM_CPU_KEEP(PROC_INFO)
}
+#ifdef CONFIG_STRICT_MEMORY_RWX
+ . = ALIGN(1<<SECTION_SHIFT);
+#endif
RO_DATA(PAGE_SIZE)
@@ -156,7 +165,11 @@
__data_loc = ALIGN(4); /* location in binary */
. = PAGE_OFFSET + TEXT_OFFSET;
#else
+#ifdef CONFIG_STRICT_MEMORY_RWX
+ . = ALIGN(1<<SECTION_SHIFT);
+#else
. = ALIGN(THREAD_SIZE);
+#endif
__data_loc = .;
#endif