initramfs: fix initramfs size calculation
[linux-drm-fsl-dcu.git] / include / asm-generic / vmlinux.lds.h
index 48c5299cbf26e796e3188f397faa96cd3889a112..0c6387d6a6aef1e82826de20523e5947ff2f7c46 100644 (file)
 /* Align . to a 8 byte boundary equals to maximum function alignment. */
 #define ALIGN_FUNCTION()  . = ALIGN(8)
 
+/*
+ * Align to a 32 byte boundary equal to the
+ * alignment gcc 4.5 uses for a struct
+ */
+#define STRUCT_ALIGN() . = ALIGN(32)
+
 /* The actual configuration determine if the init/exit sections
  * are handled as text/data or they can be discarded (which
  * often happens at runtime)
        LIKELY_PROFILE()                                                \
        BRANCH_PROFILE()                                                \
        TRACE_PRINTKS()                                                 \
+                                                                       \
+       STRUCT_ALIGN();                                                 \
        FTRACE_EVENTS()                                                 \
+                                                                       \
+       STRUCT_ALIGN();                                                 \
        TRACE_SYSCALLS()
 
 /*
  */
 #define INIT_TASK_DATA_SECTION(align)                                  \
        . = ALIGN(align);                                               \
-       .data..init_task : {                                            \
+       .data..init_task :  AT(ADDR(.data..init_task) - LOAD_OFFSET) {  \
                INIT_TASK_DATA(align)                                   \
        }
 
        . = ALIGN(PAGE_SIZE);                                           \
        VMLINUX_SYMBOL(__initramfs_start) = .;                          \
        *(.init.ramfs)                                                  \
-       VMLINUX_SYMBOL(__initramfs_end) = .;
+       . = ALIGN(8);                                                   \
+       *(.init.ramfs.info)
 #else
 #define INIT_RAM_FS
 #endif