Blame usr/initramfs_data.S

f2d475
/* SPDX-License-Identifier: GPL-2.0 */
f2d475
/*
f2d475
  initramfs_data includes the compressed binary that is the
f2d475
  filesystem used for early user space.
f2d475
  Note: Older versions of "as" (prior to binutils 2.11.90.0.23
f2d475
  released on 2001-07-14) dit not support .incbin.
f2d475
  If you are forced to use older binutils than that then the
f2d475
  following trick can be applied to create the resulting binary:
f2d475
f2d475
f2d475
  ld -m elf_i386  --format binary --oformat elf32-i386 -r \
f2d475
  -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
f2d475
   ld -m elf_i386  -r -o built-in.a initramfs_data.o
f2d475
f2d475
  For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds.
f2d475
f2d475
  The above example is for i386 - the parameters vary from architectures.
f2d475
  Eventually look up LDFLAGS_BLOB in an older version of the
f2d475
  arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
f2d475
f2d475
  Using .incbin has the advantage over ld that the correct flags are set
f2d475
  in the ELF header, as required by certain architectures.
f2d475
*/
f2d475
f2d475
#include <linux/stringify.h>
f2d475
#include <asm-generic/vmlinux.lds.h>
f2d475
f2d475
.section .init.ramfs,"a"
f2d475
__irf_start:
f2d475
.incbin __stringify(INITRAMFS_IMAGE)
f2d475
__irf_end:
f2d475
.section .init.ramfs.info,"a"
f2d475
.globl VMLINUX_SYMBOL(__initramfs_size)
f2d475
VMLINUX_SYMBOL(__initramfs_size):
f2d475
#ifdef CONFIG_64BIT
f2d475
	.quad __irf_end - __irf_start
f2d475
#else
f2d475
	.long __irf_end - __irf_start
f2d475
#endif