initramfs: fix initramfs size calculation
[linux-drm-fsl-dcu.git] / usr / initramfs_data.S
index 49a545fea12019616cd1476cd8fa7c4eb0e5e279..b9efed5e35cc222f3e7b34d922bbc1b90b29987b 100644 (file)
   -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
    ld -m elf_i386  -r -o built-in.o initramfs_data.o
 
-  initramfs_data.scr looks like this:
-SECTIONS
-{
-       .init.ramfs : { *(.data) }
-}
+  For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds.
 
   The above example is for i386 - the parameters vary from architectures.
   Eventually look up LDFLAGS_BLOB in an older version of the
@@ -28,4 +24,14 @@ SECTIONS
 #include <linux/stringify.h>
 
 .section .init.ramfs,"a"
+__irf_start:
 .incbin __stringify(INITRAMFS_IMAGE)
+__irf_end:
+.section .init.ramfs.info,"a"
+.globl __initramfs_size
+__initramfs_size:
+#ifdef CONFIG_32BIT
+       .long __irf_end - __irf_start
+#else
+       .quad __irf_end - __irf_start
+#endif