Skip to content

Commit 4ada1e8

Browse files
geertutorvalds
authored andcommitted
initramfs: fix populate_initrd_image() section mismatch
With gcc-4.6.3: WARNING: vmlinux.o(.text.unlikely+0x140): Section mismatch in reference from the function populate_initrd_image() to the variable .init.ramfs.info:__initramfs_size The function populate_initrd_image() references the variable __init __initramfs_size. This is often because populate_initrd_image lacks a __init annotation or the annotation of __initramfs_size is wrong. WARNING: vmlinux.o(.text.unlikely+0x14c): Section mismatch in reference from the function populate_initrd_image() to the function .init.text:unpack_to_rootfs() The function populate_initrd_image() references the function __init unpack_to_rootfs(). This is often because populate_initrd_image lacks a __init annotation or the annotation of unpack_to_rootfs is wrong. WARNING: vmlinux.o(.text.unlikely+0x198): Section mismatch in reference from the function populate_initrd_image() to the function .init.text:xwrite() The function populate_initrd_image() references the function __init xwrite(). This is often because populate_initrd_image lacks a __init annotation or the annotation of xwrite is wrong. Indeed, if the compiler decides not to inline populate_initrd_image(), a warning is generated. Fix this by adding the missing __init annotations. Link: http://lkml.kernel.org/r/[email protected] Fixes: 7c184ec ("initramfs: factor out a helper to populate the initrd image") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 432b1de commit 4ada1e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

init/initramfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static inline void clean_rootfs(void)
617617
#endif /* CONFIG_BLK_DEV_RAM */
618618

619619
#ifdef CONFIG_BLK_DEV_RAM
620-
static void populate_initrd_image(char *err)
620+
static void __init populate_initrd_image(char *err)
621621
{
622622
ssize_t written;
623623
int fd;
@@ -637,7 +637,7 @@ static void populate_initrd_image(char *err)
637637
ksys_close(fd);
638638
}
639639
#else
640-
static void populate_initrd_image(char *err)
640+
static void __init populate_initrd_image(char *err)
641641
{
642642
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
643643
}

0 commit comments

Comments
 (0)