linux-next: build warning after merge of the rcu tree
Hi all,
After merging the rcu tree, today's linux-next build (x86_64 allmodconfig) produced this warning:
WARNING: modpost: vmlinux: section mismatch in reference: cmdline_load_proc_show+0x22 (section: .text) -> boot_command_line (section: .init.data)
Introduced by commit
cf9eca90a339 ("fs/proc: Add /proc/cmdline_load for boot loader arguments")
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 10 lines · Stephen Rothwell
Hi all,
After merging the rcu tree, today's linux-next build (
x86_64allmodconfig) produced this warning:WARNING: modpost: vmlinux: section mismatch in reference:
cmdline_load_proc_show+0x22(section: .text) ->boot_command_line(section: .init.data)Introduced by commit
cf9eca90a339("fs/proc: Add/proc/cmdline_loadfor boot loader arguments")
That __initdata needs to be __ro_after_init, doesn't it? Will fix, thank you!
Thanx, Paul
Quoted 6 lines · Paul E. McKenney
Quoted 5 lines · Stephen Rothwell
Hi all,
After merging the rcu tree, today's linux-next build (
x86_64allmodconfig) produced this warning:
Quoted 8 lines
Quoted 5 lines
WARNING: modpost: vmlinux: section mismatch in reference:
cmdline_load_proc_show+0x22(section: .text) ->boot_command_line(section: .init.data)Introduced by commit
cf9eca90a339("fs/proc: Add/proc/cmdline_loadfor boot loader arguments")That
__initdataneeds to be__ro_after_init, doesn't it? Will fix, thank you!
Sigh. Hit "send" too soon. :-/
Does the following incremental diff (to be squashed into the original) help?
Thanx, Paul
------------------------------------------------------------------------
init/main.c +1 -1
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);void (*__initdata late_time_init)(void );/* Untouched command line saved by arch-specific code. */ -char __initdata boot_command_line[COMMAND_LINE_SIZE ]; +char boot_command_line[COMMAND_LINE_SIZE ]__ro_after_init ;/* Untouched saved command line (eg. for /proc) */ char *saved_command_line__ro_after_init ;unsigned int saved_command_line_len__ro_after_init ;
Hi Paul,
Quoted 12 lines · On Tue, 25 Jul 2023 20:48:13 -0700 "Paul E. McKenney" <[email protected]>…
Does the following incremental diff (to be squashed into the original) help?
Thanx, Paul
------------------------------------------------------------------------
init/main.c +0
-0
init/main.c EXPORT_SYMBOL(system_state); · line 141
Quoted 8 lines
init/main.c +1
-1@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);void (*__initdata late_time_init)(void );/* Untouched command line saved by arch-specific code. */ -char __initdata boot_command_line[COMMAND_LINE_SIZE ]; +char boot_command_line[COMMAND_LINE_SIZE ]__ro_after_init ;/* Untouched saved command line (eg. for /proc) */ char *saved_command_line__ro_after_init ;unsigned int saved_command_line_len__ro_after_init ;
I needed the following (only tested x86_64 allmodconfig build):
include/linux/init.h +4 -1
@@ -112,6 +112,9 @@#define __REFCONST .section ".ref.rodata", "a"#ifndef __ASSEMBLY__ + +#include <linux/cache.h> +/* * Used for initialization calls.. */
@@ -143,7 +146,7 @@ struct file_system_type;/* Defined in init/main.c */ extern int do_one_initcall (initcall_t fn); -extern char __initdata boot_command_line[]; +extern char boot_command_line[]__ro_after_init ;extern char *saved_command_line;extern unsigned int saved_command_line_len;extern unsigned int reset_devices;
init/main.c +1 -1
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);void (*__initdata late_time_init)(void );/* Untouched command line saved by arch-specific code. */ -char __initdata boot_command_line[COMMAND_LINE_SIZE ]; +char boot_command_line[COMMAND_LINE_SIZE ]__ro_after_init ;/* Untouched saved command line (eg. for /proc) */ char *saved_command_line__ro_after_init ;unsigned int saved_command_line_len__ro_after_init ;
Signature · 2 lines
Cheers, Stephen Rothwell