Skip to contentSkip to conversation

ARM: S3C24XX: Fix Section mismatch

PATCH New Kukjin Kim 2 participants 3 messages Mar 7, 2012

Subsystems (3)
lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

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
index b8a5836..59b7632 100644
@@ -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
index 35e4ff2..439f186 100644
@@ -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
index d91c1a7..c303d1b 100644
@@ -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
index ae8f4f9..f514cd5 100644
@@ -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
#1 lore raw

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_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 +1 -1
index b8a5836..59b7632 100644
@@ -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
index 35e4ff2..439f186 100644

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.

author
#2 lore raw

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_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 +1 -1
index b8a5836..59b7632 100644
@@ -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
index 35e4ff2..439f186 100644

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.

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.