aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
authorRobin Getz <robin.getz@analog.com>2007-11-15 20:57:53 +0800
committerBryan Wu <bryan.wu@analog.com>2007-11-15 20:57:53 +0800
commit839e01c2bfba34f97ec36d0d355801e94254ffd5 (patch)
tree286efca13b5b9e4dc195460f34409d703b7725c3 /arch/blackfin/kernel/vmlinux.lds.S
parentBlackfin arch: split debug stuff off into Kconfig.debug like everyone else (diff)
downloadlinux-dev-839e01c2bfba34f97ec36d0d355801e94254ffd5.tar.xz
linux-dev-839e01c2bfba34f97ec36d0d355801e94254ffd5.zip
Blackfin arch: move the init sections to the end of memory to help decrease memory fragementation
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. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel/vmlinux.lds.S')
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S47
1 files changed, 28 insertions, 19 deletions
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 9b75bc83c71f..5bdc0f79bb1a 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -41,6 +41,9 @@ _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 = .;
@@ -58,22 +61,25 @@ SECTIONS
*(__ex_table)
___stop___ex_table = .;
- . = ALIGN(4);
__etext = .;
}
- RO_DATA(PAGE_SIZE)
+ /* 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 = .;
+ }
.data :
{
- /* make sure the init_task is aligned to the
- * kernel thread size so we can locate the kernel
- * stack properly and quickly.
- */
__sdata = .;
- . = ALIGN(THREAD_SIZE);
- *(.data.init_task)
-
+ /* This gets done first, so the glob doesn't suck it in */
. = ALIGN(32);
*(.data.cacheline_aligned)
@@ -81,10 +87,22 @@ 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 :
@@ -179,16 +197,7 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
___init_end = .;
- .bss :
- {
- . = ALIGN(4);
- ___bss_start = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- ___bss_stop = .;
- __end = .;
- }
+ __end =.;
STABS_DEBUG