aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-generic/vmlinux.lds.h4
-rw-r--r--init/main.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 094d4917c1a9..35de20cf8fac 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -10,6 +10,8 @@
10#define ALIGN_FUNCTION() . = ALIGN(8) 10#define ALIGN_FUNCTION() . = ALIGN(8)
11 11
12#define RODATA \ 12#define RODATA \
13 . = ALIGN(4096); \
14 __start_rodata = .; \
13 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 15 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
14 *(.rodata) *(.rodata.*) \ 16 *(.rodata) *(.rodata.*) \
15 *(__vermagic) /* Kernel version magic */ \ 17 *(__vermagic) /* Kernel version magic */ \
@@ -74,6 +76,8 @@
74 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ 76 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
75 *(__ksymtab_strings) \ 77 *(__ksymtab_strings) \
76 } \ 78 } \
79 __end_rodata = .; \
80 . = ALIGN(4096); \
77 \ 81 \
78 /* Built-in module parameters. */ \ 82 /* Built-in module parameters. */ \
79 __param : AT(ADDR(__param) - LOAD_OFFSET) { \ 83 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
diff --git a/init/main.c b/init/main.c
index 54aaf561cf66..2ed3638deec7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -52,6 +52,7 @@
52#include <asm/bugs.h> 52#include <asm/bugs.h>
53#include <asm/setup.h> 53#include <asm/setup.h>
54#include <asm/sections.h> 54#include <asm/sections.h>
55#include <asm/cacheflush.h>
55 56
56/* 57/*
57 * This is one of the first .c files built. Error out early 58 * This is one of the first .c files built. Error out early
@@ -99,6 +100,9 @@ extern void acpi_early_init(void);
99#else 100#else
100static inline void acpi_early_init(void) { } 101static inline void acpi_early_init(void) { }
101#endif 102#endif
103#ifndef CONFIG_DEBUG_RODATA
104static inline void mark_rodata_ro(void) { }
105#endif
102 106
103#ifdef CONFIG_TC 107#ifdef CONFIG_TC
104extern void tc_init(void); 108extern void tc_init(void);
@@ -708,6 +712,7 @@ static int init(void * unused)
708 */ 712 */
709 free_initmem(); 713 free_initmem();
710 unlock_kernel(); 714 unlock_kernel();
715 mark_rodata_ro();
711 system_state = SYSTEM_RUNNING; 716 system_state = SYSTEM_RUNNING;
712 numa_default_policy(); 717 numa_default_policy();
713 718