From af8a5af3ff73055f7554a3a66307ad58792f09d5 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Sun, 18 Nov 2007 00:09:49 +0800 Subject: Blackfin arch: fix bug kernel not to boot up with mtd filesystems Revert this patch: move the init sections to the end of memory, so that after they are free, run time memory is all continugous - this should help decrease memory fragementation. When doing this, we also pack some of the other sections a little closer together, to make sure we don't waste memory. To make this happen, we need to rename the .data.init_task section to .init_task.data, so it doesn't get picked up by the linker script glob. Since it causes the kernel not to boot up with mtd filesystems. Signed-off-by: Bernd Schmidt Signed-off-by: Bryan Wu --- arch/blackfin/kernel/vmlinux.lds.S | 47 +++++++++++++++----------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'arch/blackfin/kernel/vmlinux.lds.S') diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 5bdc0f79bb1a..9b75bc83c71f 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -41,9 +41,6 @@ _jiffies = _jiffies_64; SECTIONS { . = CONFIG_BOOT_LOAD; - /* Neither the text, ro_data or bss section need to be aligned - * So pack them back to back - */ .text : { __text = .; @@ -61,25 +58,22 @@ SECTIONS *(__ex_table) ___stop___ex_table = .; + . = ALIGN(4); __etext = .; } - /* Just in case the first read only is a 32-bit access */ - RO_DATA(4) - - .bss : - { - . = ALIGN(4); - ___bss_start = .; - *(.bss .bss.*) - *(COMMON) - ___bss_stop = .; - } + RO_DATA(PAGE_SIZE) .data : { + /* make sure the init_task is aligned to the + * kernel thread size so we can locate the kernel + * stack properly and quickly. + */ __sdata = .; - /* This gets done first, so the glob doesn't suck it in */ + . = ALIGN(THREAD_SIZE); + *(.data.init_task) + . = ALIGN(32); *(.data.cacheline_aligned) @@ -87,22 +81,10 @@ SECTIONS *(.data.*) CONSTRUCTORS - /* make sure the init_task is aligned to the - * kernel thread size so we can locate the kernel - * stack properly and quickly. - */ . = ALIGN(THREAD_SIZE); - *(.init_task.data) - __edata = .; } - /* The init section should be last, so when we free it, it goes into - * the general memory pool, and (hopefully) will decrease fragmentation - * a tiny bit. The init section has a _requirement_ that it be - * PAGE_SIZE aligned - */ - . = ALIGN(PAGE_SIZE); ___init_begin = .; .init.text : @@ -197,7 +179,16 @@ SECTIONS . = ALIGN(PAGE_SIZE); ___init_end = .; - __end =.; + .bss : + { + . = ALIGN(4); + ___bss_start = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + ___bss_stop = .; + __end = .; + } STABS_DEBUG -- cgit v1.2.3-59-g8ed1b