aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2006-09-29 19:47:55 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-29 19:47:55 -0400
commit120b114237e2461fb4fa437c5c37edf014c916b9 (patch)
tree0083bec556d2c3bec35a909a35286c7aded24a56 /arch/x86_64/kernel
parent9d0ef4fd61693acd3741ab7ee544246cda1f8738 (diff)
[PATCH] Re-positioning the bss segment
[AK: This apparently broke some systems, but we need it to fix a compile problem with old binutils and in theory the patch is correct. So let's trying reenabling it again.] o Currently bss segment is being placed somewhere in the middle (after .data) section and after bss lots of init section and data sections are coming. Is it intentional? o One side affect of placing bss in the middle is that objcopy keeps the bss in raw binary image (vmlinux.bin) hence unnecessarily increasing the size of raw binary image. (In my case ~600K). It also increases the size of generated bzImage, though the increase is very small (896 bytes), probably a very high compression ratio for stream of zeros. o This patch moves the bss at the end hence reducing the size of bzImage by 896 bytes and size of vmlinux.bin by 600K. o This change benefits in the context of relocatable kernel patches. If kernel bss is not part of compressed data (vmlinux.bin) then it does not have to be decompressed and this area can be used by the decompressor for its execution hence keeping the memory requirements bounded and decompressor code does not stomp over any other data loaded beyond kernel image (As might be the case with bootloaders like kexec). Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel')
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index d0564f1bcb0b..f8aeccf105fa 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -67,13 +67,6 @@ SECTIONS
67 67
68 _edata = .; /* End of data section */ 68 _edata = .; /* End of data section */
69 69
70 __bss_start = .; /* BSS */
71 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
72 *(.bss.page_aligned)
73 *(.bss)
74 }
75 __bss_stop = .;
76
77 . = ALIGN(PAGE_SIZE); 70 . = ALIGN(PAGE_SIZE);
78 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 71 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
79 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { 72 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
@@ -229,6 +222,13 @@ SECTIONS
229 . = ALIGN(4096); 222 . = ALIGN(4096);
230 __nosave_end = .; 223 __nosave_end = .;
231 224
225 __bss_start = .; /* BSS */
226 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
227 *(.bss.page_aligned)
228 *(.bss)
229 }
230 __bss_stop = .;
231
232 _end = . ; 232 _end = . ;
233 233
234 /* Sections to be discarded */ 234 /* Sections to be discarded */