From: Rusty Russell When exporting the module parameters of built-in modules, we need to access the respective struct kernel_parameters. Currently, they're freed at init time, and obviously this can't continue to be done. So, move them out of __init_begin and __init_end and into RODATA in asm-generic/vmlinux.lds.h. Signed-off-by: Rusty Russell (modified) Signed-off-by: Dominik Brodowski Signed-off-by: Andrew Morton --- 25-akpm/arch/alpha/kernel/vmlinux.lds.S | 5 ----- 25-akpm/arch/arm/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/arm26/kernel/vmlinux-arm26-xip.lds.in | 3 --- 25-akpm/arch/arm26/kernel/vmlinux-arm26.lds.in | 3 --- 25-akpm/arch/cris/arch-v10/vmlinux.lds.S | 3 --- 25-akpm/arch/h8300/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/i386/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/ia64/kernel/vmlinux.lds.S | 6 ------ 25-akpm/arch/m68k/kernel/vmlinux-std.lds | 3 --- 25-akpm/arch/m68k/kernel/vmlinux-sun3.lds | 3 --- 25-akpm/arch/m68knommu/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/mips/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/parisc/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/ppc/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/ppc64/kernel/vmlinux.lds.S | 6 ------ 25-akpm/arch/s390/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/sh/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/sh64/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/sparc/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/sparc64/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/v850/kernel/vmlinux.lds.S | 3 --- 25-akpm/arch/x86_64/kernel/vmlinux.lds.S | 3 --- 25-akpm/include/asm-generic/vmlinux.lds.h | 7 +++++++ 25-akpm/include/asm-um/common.lds.S | 4 ---- 24 files changed, 7 insertions(+), 78 deletions(-) diff -puN arch/alpha/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/alpha/kernel/vmlinux.lds.S --- 25/arch/alpha/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.203777656 -0700 +++ 25-akpm/arch/alpha/kernel/vmlinux.lds.S 2004-08-15 19:40:18.284765344 -0700 @@ -46,11 +46,6 @@ SECTIONS __setup_end = .; . = ALIGN(8); - __start___param = .; - __param : { *(__param) } - __stop___param = .; - - . = ALIGN(8); __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/arm26/kernel/vmlinux-arm26.lds.in~module-parameters-in-sysfs-for-built-in-modules arch/arm26/kernel/vmlinux-arm26.lds.in --- 25/arch/arm26/kernel/vmlinux-arm26.lds.in~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.204777504 -0700 +++ 25-akpm/arch/arm26/kernel/vmlinux-arm26.lds.in 2004-08-15 19:40:18.285765192 -0700 @@ -35,9 +35,6 @@ SECTIONS __early_begin = .; *(__early_param) __early_end = .; - __start___param = .; - *(__param) - __stop___param = .; __initcall_start = .; *(.initcall1.init) *(.initcall2.init) diff -puN arch/arm26/kernel/vmlinux-arm26-xip.lds.in~module-parameters-in-sysfs-for-built-in-modules arch/arm26/kernel/vmlinux-arm26-xip.lds.in --- 25/arch/arm26/kernel/vmlinux-arm26-xip.lds.in~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.206777200 -0700 +++ 25-akpm/arch/arm26/kernel/vmlinux-arm26-xip.lds.in 2004-08-15 19:40:18.285765192 -0700 @@ -34,9 +34,6 @@ SECTIONS __early_begin = .; *(__early_param) __early_end = .; - __start___param = .; - *(__param) - __stop___param = .; __initcall_start = .; *(.initcall1.init) *(.initcall2.init) diff -puN arch/arm/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/arm/kernel/vmlinux.lds.S --- 25/arch/arm/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.207777048 -0700 +++ 25-akpm/arch/arm/kernel/vmlinux.lds.S 2004-08-15 19:40:18.285765192 -0700 @@ -38,9 +38,6 @@ SECTIONS __early_begin = .; *(__early_param) __early_end = .; - __start___param = .; - *(__param) - __stop___param = .; __initcall_start = .; *(.initcall1.init) *(.initcall2.init) diff -puN arch/cris/arch-v10/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/cris/arch-v10/vmlinux.lds.S --- 25/arch/cris/arch-v10/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.208776896 -0700 +++ 25-akpm/arch/cris/arch-v10/vmlinux.lds.S 2004-08-15 19:40:18.286765040 -0700 @@ -64,9 +64,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; .initcall.init : { __initcall_start = .; *(.initcall1.init); diff -puN arch/h8300/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/h8300/kernel/vmlinux.lds.S --- 25/arch/h8300/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.210776592 -0700 +++ 25-akpm/arch/h8300/kernel/vmlinux.lds.S 2004-08-15 19:40:18.286765040 -0700 @@ -150,9 +150,6 @@ SECTIONS *(.init.setup) . = ALIGN(0x4) ; ___setup_end = .; - ___start___param = .; - *(__param) - ___stop___param = .; ___initcall_start = .; *(.initcall1.init) *(.initcall2.init) diff -puN arch/i386/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/i386/kernel/vmlinux.lds.S --- 25/arch/i386/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.211776440 -0700 +++ 25-akpm/arch/i386/kernel/vmlinux.lds.S 2004-08-15 19:40:18.287764888 -0700 @@ -67,9 +67,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/ia64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/ia64/kernel/vmlinux.lds.S --- 25/arch/ia64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.212776288 -0700 +++ 25-akpm/arch/ia64/kernel/vmlinux.lds.S 2004-08-15 19:40:18.288764736 -0700 @@ -135,12 +135,6 @@ SECTIONS *(.init.setup) __setup_end = .; } - __param : AT(ADDR(__param) - LOAD_OFFSET) - { - __start___param = .; - *(__param) - __stop___param = .; - } .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { __initcall_start = .; diff -puN arch/m68k/kernel/vmlinux-std.lds~module-parameters-in-sysfs-for-built-in-modules arch/m68k/kernel/vmlinux-std.lds --- 25/arch/m68k/kernel/vmlinux-std.lds~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.214775984 -0700 +++ 25-akpm/arch/m68k/kernel/vmlinux-std.lds 2004-08-15 19:40:18.288764736 -0700 @@ -51,9 +51,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/m68k/kernel/vmlinux-sun3.lds~module-parameters-in-sysfs-for-built-in-modules arch/m68k/kernel/vmlinux-sun3.lds --- 25/arch/m68k/kernel/vmlinux-sun3.lds~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.215775832 -0700 +++ 25-akpm/arch/m68k/kernel/vmlinux-sun3.lds 2004-08-15 19:40:18.288764736 -0700 @@ -45,9 +45,6 @@ __init_begin = .; __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/m68knommu/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/m68knommu/kernel/vmlinux.lds.S --- 25/arch/m68knommu/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.216775680 -0700 +++ 25-akpm/arch/m68knommu/kernel/vmlinux.lds.S 2004-08-15 19:40:18.289764584 -0700 @@ -284,9 +284,6 @@ SECTIONS { __setup_start = .; *(.init.setup) __setup_end = .; - __start___param = .; - *(__param) - __stop___param = .; __initcall_start = .; *(.initcall1.init) *(.initcall2.init) diff -puN arch/mips/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/mips/kernel/vmlinux.lds.S --- 25/arch/mips/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.218775376 -0700 +++ 25-akpm/arch/mips/kernel/vmlinux.lds.S 2004-08-15 19:40:18.289764584 -0700 @@ -96,9 +96,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; .early_initcall.init : { __earlyinitcall_start = .; diff -puN arch/parisc/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/parisc/kernel/vmlinux.lds.S --- 25/arch/parisc/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.219775224 -0700 +++ 25-akpm/arch/parisc/kernel/vmlinux.lds.S 2004-08-15 19:40:18.289764584 -0700 @@ -130,9 +130,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/ppc64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/ppc64/kernel/vmlinux.lds.S --- 25/arch/ppc64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.227774008 -0700 +++ 25-akpm/arch/ppc64/kernel/vmlinux.lds.S 2004-08-15 19:40:18.290764432 -0700 @@ -61,12 +61,6 @@ SECTIONS __setup_end = .; } - __param : { - __start___param = .; - *(__param) - __stop___param = .; - } - .initcall.init : { __initcall_start = .; *(.initcall1.init) diff -puN arch/ppc/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/ppc/kernel/vmlinux.lds.S --- 25/arch/ppc/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.229773704 -0700 +++ 25-akpm/arch/ppc/kernel/vmlinux.lds.S 2004-08-15 19:40:18.290764432 -0700 @@ -102,9 +102,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/s390/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/s390/kernel/vmlinux.lds.S --- 25/arch/s390/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.230773552 -0700 +++ 25-akpm/arch/s390/kernel/vmlinux.lds.S 2004-08-15 19:40:18.291764280 -0700 @@ -78,9 +78,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/sh64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/sh64/kernel/vmlinux.lds.S --- 25/arch/sh64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.242771728 -0700 +++ 25-akpm/arch/sh64/kernel/vmlinux.lds.S 2004-08-15 19:40:18.291764280 -0700 @@ -106,9 +106,6 @@ SECTIONS __setup_start = .; .init.setup : C_PHYS(.init.setup) { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : C_PHYS(__param) { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : C_PHYS(.initcall.init) { *(.initcall1.init) diff -puN arch/sh/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/sh/kernel/vmlinux.lds.S --- 25/arch/sh/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.244771424 -0700 +++ 25-akpm/arch/sh/kernel/vmlinux.lds.S 2004-08-15 19:40:18.291764280 -0700 @@ -75,9 +75,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/sparc64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/sparc64/kernel/vmlinux.lds.S --- 25/arch/sparc64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.245771272 -0700 +++ 25-akpm/arch/sparc64/kernel/vmlinux.lds.S 2004-08-15 19:40:18.292764128 -0700 @@ -52,9 +52,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/sparc/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/sparc/kernel/vmlinux.lds.S --- 25/arch/sparc/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.247770968 -0700 +++ 25-akpm/arch/sparc/kernel/vmlinux.lds.S 2004-08-15 19:40:18.292764128 -0700 @@ -46,9 +46,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN arch/v850/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/v850/kernel/vmlinux.lds.S --- 25/arch/v850/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.248770816 -0700 +++ 25-akpm/arch/v850/kernel/vmlinux.lds.S 2004-08-15 19:40:18.293763976 -0700 @@ -111,9 +111,6 @@ *(.init.setup) /* 2.5 convention */ \ *(.setup.init) /* 2.4 convention */ \ ___setup_end = . ; \ - ___start___param = . ; \ - *(__param) \ - ___stop___param = . ; \ ___initcall_start = . ; \ *(.initcall.init) \ *(.initcall1.init) \ diff -puN arch/x86_64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules arch/x86_64/kernel/vmlinux.lds.S --- 25/arch/x86_64/kernel/vmlinux.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.254769904 -0700 +++ 25-akpm/arch/x86_64/kernel/vmlinux.lds.S 2004-08-15 19:40:18.293763976 -0700 @@ -91,9 +91,6 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; __initcall_start = .; .initcall.init : { *(.initcall1.init) diff -puN include/asm-generic/vmlinux.lds.h~module-parameters-in-sysfs-for-built-in-modules include/asm-generic/vmlinux.lds.h --- 25/include/asm-generic/vmlinux.lds.h~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.255769752 -0700 +++ 25-akpm/include/asm-generic/vmlinux.lds.h 2004-08-15 19:40:18.293763976 -0700 @@ -60,6 +60,13 @@ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ *(__ksymtab_strings) \ + } \ + \ + /* Built-in module parameters. */ \ + __param : AT(ADDR(__param) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start___param) = .; \ + *(__param) \ + VMLINUX_SYMBOL(__stop___param) = .; \ } #define SECURITY_INIT \ diff -puN include/asm-um/common.lds.S~module-parameters-in-sysfs-for-built-in-modules include/asm-um/common.lds.S --- 25/include/asm-um/common.lds.S~module-parameters-in-sysfs-for-built-in-modules 2004-08-15 19:40:18.272767168 -0700 +++ 25-akpm/include/asm-um/common.lds.S 2004-08-15 19:40:18.294763824 -0700 @@ -36,10 +36,6 @@ .init.setup : { *(.init.setup) } __setup_end = .; - __start___param = .; - __param : { *(__param) } - __stop___param = .; - . = ALIGN(32); __per_cpu_start = . ; .data.percpu : { *(.data.percpu) } _