diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-01-17 15:21:11 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-17 15:38:58 -0800 |
commit | b0e86f0a3b9329bbebadb01ca935208459df18c3 (patch) | |
tree | e5c662538c6c35a76d6a11a1e2d8db550e369e4d /arch/cris | |
parent | efe7cf2dcf4b72c7a9f991466d1f22850232244f (diff) |
CRIS v10: vmlinux.lds.S: ix kernel oops on boot and use common defines
- Move alignment to page size of init data outside ifdef for BLK_DEV_INITRD.
The reservation up to page size of memory after init data was previously
not done if BLK_DEV_INITRD was undefined.
This caused a kernel oops when init memory pages were freed after startup,
data placed in the same page as the last init memory would also be freed
and reused, with disastrous results.
- Use macros for initcalls and .text sections.
- Replace hardcoded page size constant with PAGE_SIZE define.
- Change include/asm-cris/page.h to use the _AC macro to instead
of testing __ASSEMBLY__.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/arch-v10/vmlinux.lds.S | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/arch/cris/arch-v10/vmlinux.lds.S b/arch/cris/arch-v10/vmlinux.lds.S index 9859d49d088..97a7876ed68 100644 --- a/arch/cris/arch-v10/vmlinux.lds.S +++ b/arch/cris/arch-v10/vmlinux.lds.S @@ -9,7 +9,8 @@ */ #include <asm-generic/vmlinux.lds.h> - +#include <asm/page.h> + jiffies = jiffies_64; SECTIONS { @@ -23,7 +24,7 @@ SECTIONS _stext = .; __stext = .; .text : { - *(.text) + TEXT_TEXT SCHED_TEXT LOCK_TEXT *(.fixup) @@ -49,10 +50,10 @@ SECTIONS __edata = . ; /* End of data section */ _edata = . ; - . = ALIGN(8192); /* init_task and stack, must be aligned */ + . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */ .data.init_task : { *(.data.init_task) } - . = ALIGN(8192); /* Init code and data */ + . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .; @@ -66,13 +67,7 @@ SECTIONS __setup_end = .; .initcall.init : { __initcall_start = .; - *(.initcall1.init); - *(.initcall2.init); - *(.initcall3.init); - *(.initcall4.init); - *(.initcall5.init); - *(.initcall6.init); - *(.initcall7.init); + INITCALLS __initcall_end = .; } @@ -88,16 +83,18 @@ SECTIONS __initramfs_start = .; *(.init.ramfs) __initramfs_end = .; - /* We fill to the next page, so we can discard all init - pages without needing to consider what payload might be - appended to the kernel image. */ - FILL (0); - . = ALIGN (8192); } #endif - __vmlinux_end = .; /* last address of the physical file */ - __init_end = .; + + /* + * We fill to the next page, so we can discard all init + * pages without needing to consider what payload might be + * appended to the kernel image. + */ + . = ALIGN(PAGE_SIZE); + + __init_end = .; __data_end = . ; /* Move to _edata ? */ __bss_start = .; /* BSS */ |