Skip to content

Commit 67d3822

Browse files
Jean-Paul SamanLinus Torvalds
authored andcommitted
[PATCH] disable init/initramfs.c: architectures
Update all arch/*/kernel/vmlinux.lds.S to not include space for initramfs when CONFIG_BLK_DEV_INITRAMFS is not selected. This saves another 4 kbytes on most platfoms (some reserve PAGE_SIZE for initramfs). Signed-off-by: Jean-Paul Saman <jean-paul.saman@nxp.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c33df4e commit 67d3822

27 files changed

Lines changed: 70 additions & 3 deletions

File tree

‎arch/alpha/kernel/vmlinux.lds.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ SECTIONS
5252
}
5353
__initcall_end = .;
5454

55+
#ifdef CONFIG_BLK_DEV_INITRD
5556
. = ALIGN(8192);
5657
__initramfs_start = .;
5758
.init.ramfs : { *(.init.ramfs) }
5859
__initramfs_end = .;
60+
#endif
5961

6062
. = ALIGN(8);
6163
.con_initcall.init : {

‎arch/arm/kernel/vmlinux.lds.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ SECTIONS
5353
__security_initcall_start = .;
5454
*(.security_initcall.init)
5555
__security_initcall_end = .;
56+
#ifdef CONFIG_BLK_DEV_INITRD
5657
. = ALIGN(32);
5758
__initramfs_start = .;
5859
usr/built-in.o(.init.ramfs)
5960
__initramfs_end = .;
61+
#endif
6062
. = ALIGN(64);
6163
__per_cpu_start = .;
6264
*(.data.percpu)

‎arch/arm26/kernel/vmlinux-arm26-xip.lds.in‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ SECTIONS
4646
__con_initcall_start = .;
4747
*(.con_initcall.init)
4848
__con_initcall_end = .;
49+
#ifdef CONFIG_BLK_DEV_INITRD
4950
. = ALIGN(32);
5051
__initramfs_start = .;
5152
usr/built-in.o(.init.ramfs)
5253
__initramfs_end = .;
54+
#endif
5355
. = ALIGN(32768);
5456
__init_end = .;
5557
}

‎arch/arm26/kernel/vmlinux-arm26.lds.in‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ SECTIONS
4747
__con_initcall_start = .;
4848
*(.con_initcall.init)
4949
__con_initcall_end = .;
50+
#ifdef CONFIG_BLK_DEV_INITRD
5051
. = ALIGN(32);
5152
__initramfs_start = .;
5253
usr/built-in.o(.init.ramfs)
5354
__initramfs_end = .;
55+
#endif
5456
. = ALIGN(32768);
5557
__init_end = .;
5658
}

‎arch/avr32/kernel/vmlinux.lds.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ SECTIONS
4646
__security_initcall_start = .;
4747
*(.security_initcall.init)
4848
__security_initcall_end = .;
49+
#ifdef CONFIG_BLK_DEV_INITRD
4950
. = ALIGN(32);
5051
__initramfs_start = .;
5152
*(.init.ramfs)
5253
__initramfs_end = .;
54+
#endif
5355
. = ALIGN(4096);
5456
__init_end = .;
5557
}

‎arch/cris/arch-v10/vmlinux.lds.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ SECTIONS
8282
__con_initcall_end = .;
8383
}
8484
SECURITY_INIT
85-
85+
86+
#ifdef CONFIG_BLK_DEV_INITRD
8687
.init.ramfs : {
8788
__initramfs_start = .;
8889
*(.init.ramfs)
@@ -93,6 +94,7 @@ SECTIONS
9394
FILL (0);
9495
. = ALIGN (8192);
9596
}
97+
#endif
9698

9799
__vmlinux_end = .; /* last address of the physical file */
98100
__init_end = .;

‎arch/cris/arch-v32/vmlinux.lds.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ SECTIONS
9595
.data.percpu : { *(.data.percpu) }
9696
__per_cpu_end = .;
9797

98+
#ifdef CONFIG_BLK_DEV_INITRD
9899
.init.ramfs : {
99100
__initramfs_start = .;
100101
*(.init.ramfs)
@@ -107,6 +108,7 @@ SECTIONS
107108
FILL (0);
108109
. = ALIGN (8192);
109110
}
111+
#endif
110112

111113
__vmlinux_end = .; /* Last address of the physical file. */
112114
__init_end = .;

‎arch/frv/kernel/vmlinux.lds.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ SECTIONS
6161
.data.percpu : { *(.data.percpu) }
6262
__per_cpu_end = .;
6363

64+
#ifdef CONFIG_BLK_DEV_INITRD
6465
. = ALIGN(4096);
6566
__initramfs_start = .;
6667
.init.ramfs : { *(.init.ramfs) }
6768
__initramfs_end = .;
69+
#endif
6870

6971
. = ALIGN(THREAD_SIZE);
7072
__init_end = .;

‎arch/h8300/kernel/vmlinux.lds.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,12 @@ SECTIONS
126126
___con_initcall_end = .;
127127
*(.exit.text)
128128
*(.exit.data)
129+
#if defined(CONFIG_BLK_DEV_INITRD)
129130
. = ALIGN(4);
130131
___initramfs_start = .;
131132
*(.init.ramfs)
132133
___initramfs_end = .;
134+
#endif
133135
. = ALIGN(0x4) ;
134136
___init_end = .;
135137
__edata = . ;

‎arch/i386/kernel/vmlinux.lds.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,14 @@ SECTIONS
181181
from .altinstructions and .eh_frame */
182182
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
183183
.exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
184+
#if defined(CONFIG_BLK_DEV_INITRD)
184185
. = ALIGN(4096);
185186
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
186187
__initramfs_start = .;
187188
*(.init.ramfs)
188189
__initramfs_end = .;
189190
}
191+
#endif
190192
. = ALIGN(L1_CACHE_BYTES);
191193
.data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
192194
__per_cpu_start = .;

0 commit comments

Comments
 (0)