Skip to content

Commit 55d5b7d

Browse files
arndbtorvalds
authored andcommitted
initramfs: fix clang build failure
There is only one function in init/initramfs.c that is in the .text section, and it is marked __weak. When building with clang-12 and the integrated assembler, this leads to a bug with recordmcount: ./scripts/recordmcount "init/initramfs.o" Cannot find symbol for section 2: .text. init/initramfs.o: failed I'm not quite sure what exactly goes wrong, but I notice that this function is only ever called from an __init function, and normally inlined. Marking it __init as well is clearly correct and it leads to recordmcount no longer complaining. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Barret Rhoden <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 14dc398 commit 55d5b7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

init/initramfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ extern unsigned long __initramfs_size;
535535
#include <linux/initrd.h>
536536
#include <linux/kexec.h>
537537

538-
void __weak free_initrd_mem(unsigned long start, unsigned long end)
538+
void __weak __init free_initrd_mem(unsigned long start, unsigned long end)
539539
{
540540
#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
541541
unsigned long aligned_start = ALIGN_DOWN(start, PAGE_SIZE);

0 commit comments

Comments
 (0)