[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>
This commit is contained in:
		
							parent
							
								
									c33df4eaaf
								
							
						
					
					
						commit
						67d38229df
					
				@ -52,10 +52,12 @@ SECTIONS
 | 
			
		||||
  }
 | 
			
		||||
  __initcall_end = .;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(8192);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(8);
 | 
			
		||||
  .con_initcall.init : {
 | 
			
		||||
 | 
			
		||||
@ -53,10 +53,12 @@ SECTIONS
 | 
			
		||||
		__security_initcall_start = .;
 | 
			
		||||
			*(.security_initcall.init)
 | 
			
		||||
		__security_initcall_end = .;
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
		. = ALIGN(32);
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
			usr/built-in.o(.init.ramfs)
 | 
			
		||||
		__initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
		. = ALIGN(64);
 | 
			
		||||
		__per_cpu_start = .;
 | 
			
		||||
			*(.data.percpu)
 | 
			
		||||
 | 
			
		||||
@ -46,10 +46,12 @@ SECTIONS
 | 
			
		||||
		__con_initcall_start = .;
 | 
			
		||||
			*(.con_initcall.init)
 | 
			
		||||
		__con_initcall_end = .;
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
		. = ALIGN(32);
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
			usr/built-in.o(.init.ramfs)
 | 
			
		||||
		__initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
		. = ALIGN(32768);
 | 
			
		||||
		__init_end = .;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -47,10 +47,12 @@ SECTIONS
 | 
			
		||||
		__con_initcall_start = .;
 | 
			
		||||
			*(.con_initcall.init)
 | 
			
		||||
		__con_initcall_end = .;
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
		. = ALIGN(32);
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
			usr/built-in.o(.init.ramfs)
 | 
			
		||||
		__initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
		. = ALIGN(32768);
 | 
			
		||||
		__init_end = .;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -46,10 +46,12 @@ SECTIONS
 | 
			
		||||
		__security_initcall_start = .;
 | 
			
		||||
			*(.security_initcall.init)
 | 
			
		||||
		__security_initcall_end = .;
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
		. = ALIGN(32);
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
			*(.init.ramfs)
 | 
			
		||||
		__initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
		. = ALIGN(4096);
 | 
			
		||||
		__init_end = .;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -82,7 +82,8 @@ SECTIONS
 | 
			
		||||
		__con_initcall_end = .;
 | 
			
		||||
	}	
 | 
			
		||||
	SECURITY_INIT
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
	.init.ramfs : {
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
		*(.init.ramfs)
 | 
			
		||||
@ -93,6 +94,7 @@ SECTIONS
 | 
			
		||||
		FILL (0); 
 | 
			
		||||
		. = ALIGN (8192);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
	__vmlinux_end = .;            /* last address of the physical file */
 | 
			
		||||
  	__init_end = .;
 | 
			
		||||
 | 
			
		||||
@ -95,6 +95,7 @@ SECTIONS
 | 
			
		||||
	.data.percpu  : { *(.data.percpu) }
 | 
			
		||||
	__per_cpu_end = .;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
	.init.ramfs : {
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
		*(.init.ramfs)
 | 
			
		||||
@ -107,6 +108,7 @@ SECTIONS
 | 
			
		||||
		FILL (0);
 | 
			
		||||
		. = ALIGN (8192);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	__vmlinux_end = .;	/* Last address of the physical file. */
 | 
			
		||||
  	__init_end = .;
 | 
			
		||||
 | 
			
		||||
@ -61,10 +61,12 @@ SECTIONS
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
  __per_cpu_end = .;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(THREAD_SIZE);
 | 
			
		||||
  __init_end = .;
 | 
			
		||||
 | 
			
		||||
@ -126,10 +126,12 @@ SECTIONS
 | 
			
		||||
	___con_initcall_end = .;
 | 
			
		||||
		*(.exit.text)
 | 
			
		||||
		*(.exit.data)
 | 
			
		||||
#if defined(CONFIG_BLK_DEV_INITRD)
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
	___initramfs_start = .;
 | 
			
		||||
  		*(.init.ramfs)
 | 
			
		||||
  	___initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
	. = ALIGN(0x4) ;
 | 
			
		||||
	___init_end = .;
 | 
			
		||||
	__edata = . ;
 | 
			
		||||
 | 
			
		||||
@ -181,12 +181,14 @@ SECTIONS
 | 
			
		||||
     from .altinstructions and .eh_frame */
 | 
			
		||||
  .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
 | 
			
		||||
  .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
 | 
			
		||||
#if defined(CONFIG_BLK_DEV_INITRD)
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
 | 
			
		||||
	__initramfs_start = .;
 | 
			
		||||
	*(.init.ramfs)
 | 
			
		||||
	__initramfs_end = .;
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
  . = ALIGN(L1_CACHE_BYTES);
 | 
			
		||||
  .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
 | 
			
		||||
	__per_cpu_start = .;
 | 
			
		||||
 | 
			
		||||
@ -111,12 +111,14 @@ SECTIONS
 | 
			
		||||
  .init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
 | 
			
		||||
	{ *(.init.data) }
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
 | 
			
		||||
	{
 | 
			
		||||
	  __initramfs_start = .;
 | 
			
		||||
	  *(.init.ramfs)
 | 
			
		||||
	  __initramfs_end = .;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   . = ALIGN(16);
 | 
			
		||||
  .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET)
 | 
			
		||||
 | 
			
		||||
@ -102,10 +102,14 @@ SECTIONS
 | 
			
		||||
     from .altinstructions and .eh_frame */
 | 
			
		||||
  .exit.text : { *(.exit.text) }
 | 
			
		||||
  .exit.data : { *(.exit.data) }
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(32);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -61,10 +61,12 @@ SECTIONS
 | 
			
		||||
  .con_initcall.init : { *(.con_initcall.init) }
 | 
			
		||||
  __con_initcall_end = .;
 | 
			
		||||
  SECURITY_INIT
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(8192);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
  . = ALIGN(8192);
 | 
			
		||||
  __init_end = .;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -55,10 +55,12 @@ __init_begin = .;
 | 
			
		||||
	.con_initcall.init : { *(.con_initcall.init) }
 | 
			
		||||
	__con_initcall_end = .;
 | 
			
		||||
	SECURITY_INIT
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
	. = ALIGN(8192);
 | 
			
		||||
	__initramfs_start = .;
 | 
			
		||||
	.init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
	__initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
	. = ALIGN(8192);
 | 
			
		||||
	__init_end = .;
 | 
			
		||||
	.data.init.task : { *(.data.init_task) }
 | 
			
		||||
 | 
			
		||||
@ -159,10 +159,12 @@ SECTIONS {
 | 
			
		||||
		__security_initcall_start = .;
 | 
			
		||||
		*(.security_initcall.init)
 | 
			
		||||
		__security_initcall_end = .;
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
		*(.init.ramfs)
 | 
			
		||||
		__initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
		. = ALIGN(4096);
 | 
			
		||||
		__init_end = .;
 | 
			
		||||
	} > INIT
 | 
			
		||||
 | 
			
		||||
@ -113,10 +113,12 @@ SECTIONS
 | 
			
		||||
     references from .rodata */
 | 
			
		||||
  .exit.text : { *(.exit.text) }
 | 
			
		||||
  .exit.data : { *(.exit.data) }
 | 
			
		||||
#if defined(CONFIG_BLK_DEV_INITRD)
 | 
			
		||||
  . = ALIGN(_PAGE_SIZE);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
  . = ALIGN(32);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -173,10 +173,12 @@ SECTIONS
 | 
			
		||||
     from .altinstructions and .eh_frame */
 | 
			
		||||
  .exit.text : { *(.exit.text) }
 | 
			
		||||
  .exit.data : { *(.exit.data) }
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(ASM_PAGE_SIZE);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
  . = ALIGN(32);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -131,14 +131,14 @@ SECTIONS
 | 
			
		||||
		__stop___fw_ftr_fixup = .;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
	. = ALIGN(PAGE_SIZE);
 | 
			
		||||
	.init.ramfs : {
 | 
			
		||||
		__initramfs_start = .;
 | 
			
		||||
		*(.init.ramfs)
 | 
			
		||||
		__initramfs_end = .;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_PPC32
 | 
			
		||||
	. = ALIGN(32);
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
@ -135,10 +135,12 @@ SECTIONS
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
  __per_cpu_end = .;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __init_end = .;
 | 
			
		||||
 | 
			
		||||
@ -91,11 +91,14 @@ SECTIONS
 | 
			
		||||
  .con_initcall.init : { *(.con_initcall.init) }
 | 
			
		||||
  __con_initcall_end = .;
 | 
			
		||||
  SECURITY_INIT
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(256);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.initramfs) }
 | 
			
		||||
  . = ALIGN(2);
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
  . = ALIGN(256);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -83,9 +83,13 @@ SECTIONS
 | 
			
		||||
  .con_initcall.init : { *(.con_initcall.init) }
 | 
			
		||||
  __con_initcall_end = .;
 | 
			
		||||
  SECURITY_INIT
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  __machvec_start = .;
 | 
			
		||||
  .init.machvec : { *(.init.machvec) }
 | 
			
		||||
  __machvec_end = .;
 | 
			
		||||
 | 
			
		||||
@ -115,9 +115,13 @@ SECTIONS
 | 
			
		||||
  .con_initcall.init : C_PHYS(.con_initcall.init) { *(.con_initcall.init) }
 | 
			
		||||
  __con_initcall_end = .;
 | 
			
		||||
  SECURITY_INIT
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(PAGE_SIZE);
 | 
			
		||||
  __init_end = .;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -57,10 +57,14 @@ SECTIONS
 | 
			
		||||
  .con_initcall.init : { *(.con_initcall.init) }
 | 
			
		||||
  __con_initcall_end = .;
 | 
			
		||||
  SECURITY_INIT
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(32);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -81,10 +81,14 @@ SECTIONS
 | 
			
		||||
  __sun4v_2insn_patch = .;
 | 
			
		||||
  .sun4v_2insn_patch : { *(.sun4v_2insn_patch) }
 | 
			
		||||
  __sun4v_2insn_patch_end = .;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(8192); 
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  . = ALIGN(8192);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -190,12 +190,16 @@
 | 
			
		||||
		__root_fs_image_start = . ;				      \
 | 
			
		||||
		*(.root)						      \
 | 
			
		||||
		__root_fs_image_end = . ;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
/* The initramfs archive.  */
 | 
			
		||||
#define INITRAMFS_CONTENTS						      \
 | 
			
		||||
		. = ALIGN (4) ;						      \
 | 
			
		||||
		___initramfs_start = . ;				      \
 | 
			
		||||
			*(.init.ramfs)					      \
 | 
			
		||||
		___initramfs_end = . ;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Where the initial bootmap (bitmap for the boot-time memory allocator) 
 | 
			
		||||
   should be place.  */
 | 
			
		||||
#define BOOTMAP_CONTENTS						      \
 | 
			
		||||
 | 
			
		||||
@ -192,10 +192,14 @@ SECTIONS
 | 
			
		||||
     from .altinstructions and .eh_frame */
 | 
			
		||||
  .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
 | 
			
		||||
  .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __initramfs_start = .;
 | 
			
		||||
  .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
 | 
			
		||||
  __per_cpu_start = .;
 | 
			
		||||
  .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
 | 
			
		||||
 | 
			
		||||
@ -203,10 +203,12 @@ SECTIONS
 | 
			
		||||
  .data.percpu  : { *(.data.percpu) }
 | 
			
		||||
  __per_cpu_end = .;
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_BLK_DEV_INITRD
 | 
			
		||||
  . = ALIGN(4096);
 | 
			
		||||
  __initramfs_start =.;
 | 
			
		||||
  .init.ramfs : { *(.init.ramfs) }
 | 
			
		||||
  __initramfs_end = .;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /* We need this dummy segment here */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user