From 2f2b881ee8338bb13d1760fb8be65a2b1537796e Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Fri, 6 Jan 2006 00:12:01 -0800 Subject: [PATCH] --- yaml --- r: 16380 b: refs/heads/master c: 37b73c828185731f6236a6387c02d7b08c150810 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/asm-generic/vmlinux.lds.h | 4 ++++ trunk/init/main.c | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index cc3ae9f717db..566456947a82 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d89c145c0344fe2180336af6a309a59a8bc8c1c0 +refs/heads/master: 37b73c828185731f6236a6387c02d7b08c150810 diff --git a/trunk/include/asm-generic/vmlinux.lds.h b/trunk/include/asm-generic/vmlinux.lds.h index 094d4917c1a9..35de20cf8fac 100644 --- a/trunk/include/asm-generic/vmlinux.lds.h +++ b/trunk/include/asm-generic/vmlinux.lds.h @@ -10,6 +10,8 @@ #define ALIGN_FUNCTION() . = ALIGN(8) #define RODATA \ + . = ALIGN(4096); \ + __start_rodata = .; \ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ *(.rodata) *(.rodata.*) \ *(__vermagic) /* Kernel version magic */ \ @@ -74,6 +76,8 @@ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ *(__ksymtab_strings) \ } \ + __end_rodata = .; \ + . = ALIGN(4096); \ \ /* Built-in module parameters. */ \ __param : AT(ADDR(__param) - LOAD_OFFSET) { \ diff --git a/trunk/init/main.c b/trunk/init/main.c index 54aaf561cf66..2ed3638deec7 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -52,6 +52,7 @@ #include #include #include +#include /* * This is one of the first .c files built. Error out early @@ -99,6 +100,9 @@ extern void acpi_early_init(void); #else static inline void acpi_early_init(void) { } #endif +#ifndef CONFIG_DEBUG_RODATA +static inline void mark_rodata_ro(void) { } +#endif #ifdef CONFIG_TC extern void tc_init(void); @@ -708,6 +712,7 @@ static int init(void * unused) */ free_initmem(); unlock_kernel(); + mark_rodata_ro(); system_state = SYSTEM_RUNNING; numa_default_policy();