Commit 67d38229dfa64cf9a75f83746dde345f47bbd8dc

Authored by Jean-Paul Saman
Committed by Linus Torvalds
1 parent c33df4eaaf

[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>

Showing 27 changed files with 70 additions and 3 deletions Side-by-side Diff

arch/alpha/kernel/vmlinux.lds.S
... ... @@ -52,10 +52,12 @@
52 52 }
53 53 __initcall_end = .;
54 54  
  55 +#ifdef CONFIG_BLK_DEV_INITRD
55 56 . = ALIGN(8192);
56 57 __initramfs_start = .;
57 58 .init.ramfs : { *(.init.ramfs) }
58 59 __initramfs_end = .;
  60 +#endif
59 61  
60 62 . = ALIGN(8);
61 63 .con_initcall.init : {
arch/arm/kernel/vmlinux.lds.S
... ... @@ -53,10 +53,12 @@
53 53 __security_initcall_start = .;
54 54 *(.security_initcall.init)
55 55 __security_initcall_end = .;
  56 +#ifdef CONFIG_BLK_DEV_INITRD
56 57 . = ALIGN(32);
57 58 __initramfs_start = .;
58 59 usr/built-in.o(.init.ramfs)
59 60 __initramfs_end = .;
  61 +#endif
60 62 . = ALIGN(64);
61 63 __per_cpu_start = .;
62 64 *(.data.percpu)
arch/arm26/kernel/vmlinux-arm26-xip.lds.in
... ... @@ -46,10 +46,12 @@
46 46 __con_initcall_start = .;
47 47 *(.con_initcall.init)
48 48 __con_initcall_end = .;
  49 +#ifdef CONFIG_BLK_DEV_INITRD
49 50 . = ALIGN(32);
50 51 __initramfs_start = .;
51 52 usr/built-in.o(.init.ramfs)
52 53 __initramfs_end = .;
  54 +#endif
53 55 . = ALIGN(32768);
54 56 __init_end = .;
55 57 }
arch/arm26/kernel/vmlinux-arm26.lds.in
... ... @@ -47,10 +47,12 @@
47 47 __con_initcall_start = .;
48 48 *(.con_initcall.init)
49 49 __con_initcall_end = .;
  50 +#ifdef CONFIG_BLK_DEV_INITRD
50 51 . = ALIGN(32);
51 52 __initramfs_start = .;
52 53 usr/built-in.o(.init.ramfs)
53 54 __initramfs_end = .;
  55 +#endif
54 56 . = ALIGN(32768);
55 57 __init_end = .;
56 58 }
arch/avr32/kernel/vmlinux.lds.c
... ... @@ -46,10 +46,12 @@
46 46 __security_initcall_start = .;
47 47 *(.security_initcall.init)
48 48 __security_initcall_end = .;
  49 +#ifdef CONFIG_BLK_DEV_INITRD
49 50 . = ALIGN(32);
50 51 __initramfs_start = .;
51 52 *(.init.ramfs)
52 53 __initramfs_end = .;
  54 +#endif
53 55 . = ALIGN(4096);
54 56 __init_end = .;
55 57 }
arch/cris/arch-v10/vmlinux.lds.S
... ... @@ -82,7 +82,8 @@
82 82 __con_initcall_end = .;
83 83 }
84 84 SECURITY_INIT
85   -
  85 +
  86 +#ifdef CONFIG_BLK_DEV_INITRD
86 87 .init.ramfs : {
87 88 __initramfs_start = .;
88 89 *(.init.ramfs)
... ... @@ -93,6 +94,7 @@
93 94 FILL (0);
94 95 . = ALIGN (8192);
95 96 }
  97 +#endif
96 98  
97 99 __vmlinux_end = .; /* last address of the physical file */
98 100 __init_end = .;
arch/cris/arch-v32/vmlinux.lds.S
... ... @@ -95,6 +95,7 @@
95 95 .data.percpu : { *(.data.percpu) }
96 96 __per_cpu_end = .;
97 97  
  98 +#ifdef CONFIG_BLK_DEV_INITRD
98 99 .init.ramfs : {
99 100 __initramfs_start = .;
100 101 *(.init.ramfs)
... ... @@ -107,6 +108,7 @@
107 108 FILL (0);
108 109 . = ALIGN (8192);
109 110 }
  111 +#endif
110 112  
111 113 __vmlinux_end = .; /* Last address of the physical file. */
112 114 __init_end = .;
arch/frv/kernel/vmlinux.lds.S
... ... @@ -61,10 +61,12 @@
61 61 .data.percpu : { *(.data.percpu) }
62 62 __per_cpu_end = .;
63 63  
  64 +#ifdef CONFIG_BLK_DEV_INITRD
64 65 . = ALIGN(4096);
65 66 __initramfs_start = .;
66 67 .init.ramfs : { *(.init.ramfs) }
67 68 __initramfs_end = .;
  69 +#endif
68 70  
69 71 . = ALIGN(THREAD_SIZE);
70 72 __init_end = .;
arch/h8300/kernel/vmlinux.lds.S
... ... @@ -126,10 +126,12 @@
126 126 ___con_initcall_end = .;
127 127 *(.exit.text)
128 128 *(.exit.data)
  129 +#if defined(CONFIG_BLK_DEV_INITRD)
129 130 . = ALIGN(4);
130 131 ___initramfs_start = .;
131 132 *(.init.ramfs)
132 133 ___initramfs_end = .;
  134 +#endif
133 135 . = ALIGN(0x4) ;
134 136 ___init_end = .;
135 137 __edata = . ;
arch/i386/kernel/vmlinux.lds.S
... ... @@ -181,12 +181,14 @@
181 181 from .altinstructions and .eh_frame */
182 182 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
183 183 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
  184 +#if defined(CONFIG_BLK_DEV_INITRD)
184 185 . = ALIGN(4096);
185 186 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
186 187 __initramfs_start = .;
187 188 *(.init.ramfs)
188 189 __initramfs_end = .;
189 190 }
  191 +#endif
190 192 . = ALIGN(L1_CACHE_BYTES);
191 193 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
192 194 __per_cpu_start = .;
arch/ia64/kernel/vmlinux.lds.S
... ... @@ -111,12 +111,14 @@
111 111 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
112 112 { *(.init.data) }
113 113  
  114 +#ifdef CONFIG_BLK_DEV_INITRD
114 115 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
115 116 {
116 117 __initramfs_start = .;
117 118 *(.init.ramfs)
118 119 __initramfs_end = .;
119 120 }
  121 +#endif
120 122  
121 123 . = ALIGN(16);
122 124 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET)
arch/m32r/kernel/vmlinux.lds.S
... ... @@ -102,10 +102,14 @@
102 102 from .altinstructions and .eh_frame */
103 103 .exit.text : { *(.exit.text) }
104 104 .exit.data : { *(.exit.data) }
  105 +
  106 +#ifdef CONFIG_BLK_DEV_INITRD
105 107 . = ALIGN(4096);
106 108 __initramfs_start = .;
107 109 .init.ramfs : { *(.init.ramfs) }
108 110 __initramfs_end = .;
  111 +#endif
  112 +
109 113 . = ALIGN(32);
110 114 __per_cpu_start = .;
111 115 .data.percpu : { *(.data.percpu) }
arch/m68k/kernel/vmlinux-std.lds
... ... @@ -61,10 +61,12 @@
61 61 .con_initcall.init : { *(.con_initcall.init) }
62 62 __con_initcall_end = .;
63 63 SECURITY_INIT
  64 +#ifdef CONFIG_BLK_DEV_INITRD
64 65 . = ALIGN(8192);
65 66 __initramfs_start = .;
66 67 .init.ramfs : { *(.init.ramfs) }
67 68 __initramfs_end = .;
  69 +#endif
68 70 . = ALIGN(8192);
69 71 __init_end = .;
70 72  
arch/m68k/kernel/vmlinux-sun3.lds
... ... @@ -55,10 +55,12 @@
55 55 .con_initcall.init : { *(.con_initcall.init) }
56 56 __con_initcall_end = .;
57 57 SECURITY_INIT
  58 +#ifdef CONFIG_BLK_DEV_INITRD
58 59 . = ALIGN(8192);
59 60 __initramfs_start = .;
60 61 .init.ramfs : { *(.init.ramfs) }
61 62 __initramfs_end = .;
  63 +#endif
62 64 . = ALIGN(8192);
63 65 __init_end = .;
64 66 .data.init.task : { *(.data.init_task) }
arch/m68knommu/kernel/vmlinux.lds.S
... ... @@ -159,10 +159,12 @@
159 159 __security_initcall_start = .;
160 160 *(.security_initcall.init)
161 161 __security_initcall_end = .;
  162 +#ifdef CONFIG_BLK_DEV_INITRD
162 163 . = ALIGN(4);
163 164 __initramfs_start = .;
164 165 *(.init.ramfs)
165 166 __initramfs_end = .;
  167 +#endif
166 168 . = ALIGN(4096);
167 169 __init_end = .;
168 170 } > INIT
arch/mips/kernel/vmlinux.lds.S
... ... @@ -113,10 +113,12 @@
113 113 references from .rodata */
114 114 .exit.text : { *(.exit.text) }
115 115 .exit.data : { *(.exit.data) }
  116 +#if defined(CONFIG_BLK_DEV_INITRD)
116 117 . = ALIGN(_PAGE_SIZE);
117 118 __initramfs_start = .;
118 119 .init.ramfs : { *(.init.ramfs) }
119 120 __initramfs_end = .;
  121 +#endif
120 122 . = ALIGN(32);
121 123 __per_cpu_start = .;
122 124 .data.percpu : { *(.data.percpu) }
arch/parisc/kernel/vmlinux.lds.S
... ... @@ -173,10 +173,12 @@
173 173 from .altinstructions and .eh_frame */
174 174 .exit.text : { *(.exit.text) }
175 175 .exit.data : { *(.exit.data) }
  176 +#ifdef CONFIG_BLK_DEV_INITRD
176 177 . = ALIGN(ASM_PAGE_SIZE);
177 178 __initramfs_start = .;
178 179 .init.ramfs : { *(.init.ramfs) }
179 180 __initramfs_end = .;
  181 +#endif
180 182 . = ALIGN(32);
181 183 __per_cpu_start = .;
182 184 .data.percpu : { *(.data.percpu) }
arch/powerpc/kernel/vmlinux.lds.S
... ... @@ -131,14 +131,14 @@
131 131 __stop___fw_ftr_fixup = .;
132 132 }
133 133 #endif
134   -
  134 +#ifdef CONFIG_BLK_DEV_INITRD
135 135 . = ALIGN(PAGE_SIZE);
136 136 .init.ramfs : {
137 137 __initramfs_start = .;
138 138 *(.init.ramfs)
139 139 __initramfs_end = .;
140 140 }
141   -
  141 +#endif
142 142 #ifdef CONFIG_PPC32
143 143 . = ALIGN(32);
144 144 #else
arch/ppc/kernel/vmlinux.lds.S
... ... @@ -135,10 +135,12 @@
135 135 .data.percpu : { *(.data.percpu) }
136 136 __per_cpu_end = .;
137 137  
  138 +#ifdef CONFIG_BLK_DEV_INITRD
138 139 . = ALIGN(4096);
139 140 __initramfs_start = .;
140 141 .init.ramfs : { *(.init.ramfs) }
141 142 __initramfs_end = .;
  143 +#endif
142 144  
143 145 . = ALIGN(4096);
144 146 __init_end = .;
arch/s390/kernel/vmlinux.lds.S
... ... @@ -91,11 +91,14 @@
91 91 .con_initcall.init : { *(.con_initcall.init) }
92 92 __con_initcall_end = .;
93 93 SECURITY_INIT
  94 +
  95 +#ifdef CONFIG_BLK_DEV_INITRD
94 96 . = ALIGN(256);
95 97 __initramfs_start = .;
96 98 .init.ramfs : { *(.init.initramfs) }
97 99 . = ALIGN(2);
98 100 __initramfs_end = .;
  101 +#endif
99 102 . = ALIGN(256);
100 103 __per_cpu_start = .;
101 104 .data.percpu : { *(.data.percpu) }
arch/sh/kernel/vmlinux.lds.S
... ... @@ -83,9 +83,13 @@
83 83 .con_initcall.init : { *(.con_initcall.init) }
84 84 __con_initcall_end = .;
85 85 SECURITY_INIT
  86 +
  87 +#ifdef CONFIG_BLK_DEV_INITRD
86 88 __initramfs_start = .;
87 89 .init.ramfs : { *(.init.ramfs) }
88 90 __initramfs_end = .;
  91 +#endif
  92 +
89 93 __machvec_start = .;
90 94 .init.machvec : { *(.init.machvec) }
91 95 __machvec_end = .;
arch/sh64/kernel/vmlinux.lds.S
... ... @@ -115,9 +115,13 @@
115 115 .con_initcall.init : C_PHYS(.con_initcall.init) { *(.con_initcall.init) }
116 116 __con_initcall_end = .;
117 117 SECURITY_INIT
  118 +
  119 +#ifdef CONFIG_BLK_DEV_INITRD
118 120 __initramfs_start = .;
119 121 .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) }
120 122 __initramfs_end = .;
  123 +#endif
  124 +
121 125 . = ALIGN(PAGE_SIZE);
122 126 __init_end = .;
123 127  
arch/sparc/kernel/vmlinux.lds.S
... ... @@ -57,10 +57,14 @@
57 57 .con_initcall.init : { *(.con_initcall.init) }
58 58 __con_initcall_end = .;
59 59 SECURITY_INIT
  60 +
  61 +#ifdef CONFIG_BLK_DEV_INITRD
60 62 . = ALIGN(4096);
61 63 __initramfs_start = .;
62 64 .init.ramfs : { *(.init.ramfs) }
63 65 __initramfs_end = .;
  66 +#endif
  67 +
64 68 . = ALIGN(32);
65 69 __per_cpu_start = .;
66 70 .data.percpu : { *(.data.percpu) }
arch/sparc64/kernel/vmlinux.lds.S
... ... @@ -81,10 +81,14 @@
81 81 __sun4v_2insn_patch = .;
82 82 .sun4v_2insn_patch : { *(.sun4v_2insn_patch) }
83 83 __sun4v_2insn_patch_end = .;
  84 +
  85 +#ifdef CONFIG_BLK_DEV_INITRD
84 86 . = ALIGN(8192);
85 87 __initramfs_start = .;
86 88 .init.ramfs : { *(.init.ramfs) }
87 89 __initramfs_end = .;
  90 +#endif
  91 +
88 92 . = ALIGN(8192);
89 93 __per_cpu_start = .;
90 94 .data.percpu : { *(.data.percpu) }
arch/v850/kernel/vmlinux.lds.S
... ... @@ -190,12 +190,16 @@
190 190 __root_fs_image_start = . ; \
191 191 *(.root) \
192 192 __root_fs_image_end = . ;
  193 +
  194 +#ifdef CONFIG_BLK_DEV_INITRD
193 195 /* The initramfs archive. */
194 196 #define INITRAMFS_CONTENTS \
195 197 . = ALIGN (4) ; \
196 198 ___initramfs_start = . ; \
197 199 *(.init.ramfs) \
198 200 ___initramfs_end = . ;
  201 +#endif
  202 +
199 203 /* Where the initial bootmap (bitmap for the boot-time memory allocator)
200 204 should be place. */
201 205 #define BOOTMAP_CONTENTS \
arch/x86_64/kernel/vmlinux.lds.S
... ... @@ -192,10 +192,14 @@
192 192 from .altinstructions and .eh_frame */
193 193 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
194 194 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
  195 +
  196 +#ifdef CONFIG_BLK_DEV_INITRD
195 197 . = ALIGN(4096);
196 198 __initramfs_start = .;
197 199 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
198 200 __initramfs_end = .;
  201 +#endif
  202 +
199 203 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
200 204 __per_cpu_start = .;
201 205 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
arch/xtensa/kernel/vmlinux.lds.S
... ... @@ -203,10 +203,12 @@
203 203 .data.percpu : { *(.data.percpu) }
204 204 __per_cpu_end = .;
205 205  
  206 +#ifdef CONFIG_BLK_DEV_INITRD
206 207 . = ALIGN(4096);
207 208 __initramfs_start =.;
208 209 .init.ramfs : { *(.init.ramfs) }
209 210 __initramfs_end = .;
  211 +#endif
210 212  
211 213 /* We need this dummy segment here */
212 214