ARM: S3C24XX: Fix Section mismatch
Subsystems (3)
PATCH 1/1 ARM: S3C24XX: Fix Section mismatch
Fixes following:
WARNING: arch/arm/mach-s3c24xx/built-in.o(.text+0x4464): Section mismatch in reference from the function usb_simtec_init() to the (unknown reference) .init.data:(unknown) The function usb_simtec_init() references
the (unknown reference) __initdata (unknown).
This is often because usb_simtec_init lacks a __initdata
annotation or the annotation of (unknown) is wrong.
WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add() The variable s3c2416_irq_interface references
the function __init s3c2416_irq_add()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add() The variable s3c2443_irq_interface references
the function __init s3c2443_irq_add()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
--- arch/arm/mach-s3c24xx/irq-s3c2416.c | 2 +- arch/arm/mach-s3c24xx/irq-s3c2443.c | 2 +- arch/arm/mach-s3c24xx/simtec-usb.c | 2 +- arch/arm/mach-s3c24xx/simtec.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-s3c24xx/irq-s3c2416.c +1 -1
@@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)return 0 ; } -static struct subsys_interface s3c2416_irq_interface = { +static struct subsys_interface s3c2416_irq_interface__initdata = { .name ="s3c2416_irq" , .subsys = &s3c2416_subsys, .add_dev = s3c2416_irq_add,
arch/arm/mach-s3c24xx/irq-s3c2443.c +1 -1
@@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)return 0 ; } -static struct subsys_interface s3c2443_irq_interface = { +static struct subsys_interface s3c2443_irq_interface__initdata = { .name ="s3c2443_irq" , .subsys = &s3c2443_subsys, .add_dev = s3c2443_irq_add,
arch/arm/mach-s3c24xx/simtec-usb.c +1 -1
@@ -104,7 +104,7 @@ static struct s3c2410_hcd_info usb_simtec_info __initdata = { }; -int usb_simtec_init (void ) +int __init usb_simtec_init (void ) {int ret;
arch/arm/mach-s3c24xx/simtec.h +1 -1
@@ -15,7 +15,7 @@ struct s3c24xx_audio_simtec_pdata;extern void nor_simtec_init (void ); -extern int usb_simtec_init (void ); +extern int __init usb_simtec_init (void );extern int simtec_audio_add (const char *codec_name,bool has_lr_routing,struct s3c24xx_audio_simtec_pdata *pdata);
Signature · 1 line
1.7.4.4
PATCH 1/1 ARM: S3C24XX: Fix Section mismatch
Quoted 34 lines · Kukjin Kim
WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference from the variable
s3c2416_irq_interfaceto the function .init.text:s3c2416_irq_add() The variables3c2416_irq_interfacereferences
the function__inits3c2416_irq_add()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_consoleWARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference from the variable
s3c2443_irq_interfaceto the function .init.text:s3c2443_irq_add() The variables3c2443_irq_interfacereferences
the function__inits3c2443_irq_add()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_consolearch/arm/mach-s3c24xx/irq-s3c2416.c +1
-1@@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)return 0 ; } -static struct subsys_interface s3c2416_irq_interface = { +static struct subsys_interface s3c2416_irq_interface__initdata = { .name ="s3c2416_irq" , .subsys = &s3c2416_subsys, .add_dev = s3c2416_irq_add,arch/arm/mach-s3c24xx/irq-s3c2443.c +0
-0
arch/arm/mach-s3c24xx/irq-s3c2443.c static int __init s3c2443_irq_add(struct device *dev) · line 271
Quoted 8 lines
arch/arm/mach-s3c24xx/irq-s3c2443.c +1
-1@@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)return 0 ; } -static struct subsys_interface s3c2443_irq_interface = { +static struct subsys_interface s3c2443_irq_interface__initdata = { .name ="s3c2443_irq" , .subsys = &s3c2443_subsys, .add_dev = s3c2443_irq_add,
You register these structures with some other bit of code. That other bit of code adds these structures to a list. You then mark them as __initdata, which means they get freed and the memory reused. That corrupts the list beneath the other code.
So, clearly, both of these are wrong.
PATCH 1/1 ARM: S3C24XX: Fix Section mismatch
Quoted 49 lines · Russell King - ARM Linux
Quoted 34 lines · Kukjin Kim
WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference from the variable
s3c2416_irq_interfaceto the function .init.text:s3c2416_irq_add() The variables3c2416_irq_interfacereferences
the function__inits3c2416_irq_add()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_consoleWARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference from the variable
s3c2443_irq_interfaceto the function .init.text:s3c2443_irq_add() The variables3c2443_irq_interfacereferences
the function__inits3c2443_irq_add()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_consolearch/arm/mach-s3c24xx/irq-s3c2416.c +1
-1@@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)return 0 ; } -static struct subsys_interface s3c2416_irq_interface = { +static struct subsys_interface s3c2416_irq_interface__initdata = { .name ="s3c2416_irq" , .subsys =&s3c2416_subsys, .add_dev = s3c2416_irq_add,arch/arm/mach-s3c24xx/irq-s3c2443.c +0
-0arch/arm/mach-s3c24xx/irq-s3c2443.c static int __init s3c2443_irq_add(struct device *dev) · line 271
Quoted 8 lines
arch/arm/mach-s3c24xx/irq-s3c2443.c +1
-1@@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)return 0 ; } -static struct subsys_interface s3c2443_irq_interface = { +static struct subsys_interface s3c2443_irq_interface__initdata = { .name ="s3c2443_irq" , .subsys =&s3c2443_subsys, .add_dev = s3c2443_irq_add,You register these structures with some other bit of code. That other bit of code adds these structures to a list. You then mark them as
__initdata, which means they get freed and the memory reused. That corrupts the list beneath the other code.
Quoted 1 line
So, clearly, both of these are wrong.
Oops, I see. Let me check it again.
Thanks for pointing out.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.