Commit baa69b12 authored by Jesper Nilsson's avatar Jesper Nilsson

CRIS v32: Fix startup oops and replace hardcoded pagesize in vmlinux.lds.S

- Move alignment of init data to page size outside define CONFIG_BLK_DEV_INITRD
  This avoids oops due to memory on the same page as init data being freed.
- Change hardcoded page size to use macro from asm/page.h
- Add reserved memory via CONFIG_ETRAX_VMEM_SIZE.
- Use available defines for TEXT_TEXT and INITCALLS.
- Cleanup whitespace.
parent 52d82ef1
......@@ -9,6 +9,13 @@
*/
#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
#ifdef CONFIG_ETRAX_VMEM_SIZE
#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
#else
#define __CONFIG_ETRAX_VMEM_SIZE 0
#endif
jiffies = jiffies_64;
SECTIONS
......@@ -17,18 +24,19 @@ SECTIONS
dram_start = .;
ebp_start = .;
/* The boot section is only necessary until the VCS top level testbench */
/* includes both flash and DRAM. */
/* The boot section is only necessary until the VCS top */
/* level testbench includes both flash and DRAM. */
.boot : { *(.boot) }
. = DRAM_VIRTUAL_BASE + 0x4000; /* See head.S and pages reserved at the start. */
/* See head.S and pages reserved at the start. */
. = DRAM_VIRTUAL_BASE + 0x4000;
_text = .; /* Text and read-only data. */
text_start = .; /* Lots of aliases. */
_stext = .;
__stext = .;
.text : {
*(.text)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
*(.fixup)
......@@ -39,9 +47,9 @@ SECTIONS
__etext = .;
. = ALIGN(4); /* Exception table. */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
RODATA
......@@ -54,33 +62,27 @@ SECTIONS
__edata = . ; /* End of data section. */
_edata = . ;
. = ALIGN(8192); /* init_task and stack, must be aligned. */
.data.init_task : { *(.data.init_task) }
. = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
.data.init_task : { *(.data.init_task) }
. = ALIGN(8192); /* Init code and data. */
__init_begin = .;
. = ALIGN(PAGE_SIZE); /* Init code and data. */
__init_begin = .;
.init.text : {
_sinittext = .;
INIT_TEXT
_einittext = .;
}
.init.data : { INIT_DATA }
. = ALIGN(16);
__setup_start = .;
.init.setup : { *(.init.setup) }
__setup_end = .;
. = ALIGN(16);
__setup_start = .;
.init.setup : { *(.init.setup) }
__setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
.initcall.init : {
.initcall.init : {
__initcall_start = .;
*(.initcall1.init);
*(.initcall2.init);
*(.initcall3.init);
*(.initcall4.init);
*(.initcall5.init);
*(.initcall6.init);
*(.initcall7.init);
INITCALLS
__initcall_end = .;
}
......@@ -91,25 +93,23 @@ SECTIONS
}
SECURITY_INIT
PERCPU(8192)
__vmlinux_end = .; /* Last address of the physical file. */
PERCPU(PAGE_SIZE)
#ifdef CONFIG_BLK_DEV_INITRD
.init.ramfs : {
__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. */
......@@ -123,11 +123,11 @@ SECTIONS
__end = .;
/* Sections to be discarded */
/DISCARD/ : {
/DISCARD/ : {
EXIT_TEXT
EXIT_DATA
*(.exitcall.exit)
}
dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024;
dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment