Section mismatches pcmcia_core and pcmcia

James Ronald james.ronald at gmail.com
Wed Jun 25 10:20:26 EDT 2008


When building the kernel with pcmcia modules selected the section
mismatch warnings below are displayed.   Per Sam Ravnborg the
variables of type class_interface contains references to __devinit and
__devexit functions which is OK.  Sam also submitted upstream the
patches included below that silence said warnings by annotating the
variables with __refdata.  I have not seen any mention of such on this
list so I though that I would mention it.  I have applied these
patches and they do silence the section mismatches as advertised
assuming that just silencing them is indeed the correct action.

=== WARNINGS ===
  LD [M]  drivers/pcmcia/pcmcia_core.o
WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x12c): Section mismatch
in reference from the variable pccard_sysfs_interface to the function
.devinit.text:pccard_sysfs_add_socket()
The variable pccard_sysfs_interface references
the function __devinit pccard_sysfs_add_socket()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x130): Section mismatch
in reference from the variable pccard_sysfs_interface to the function
.devexit.text:pccard_sysfs_remove_socket()
The variable pccard_sysfs_interface references
the function __devexit pccard_sysfs_remove_socket()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

  LD [M]  drivers/pcmcia/pcmcia.o
WARNING: drivers/pcmcia/pcmcia.o(.data+0x4c): Section mismatch in
reference from the variable pcmcia_bus_interface to the function
.devinit.text:pcmcia_bus_add_socket()
The variable pcmcia_bus_interface references
the function __devinit pcmcia_bus_add_socket()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

  LD [M]  drivers/pcmcia/lh7a40x_core.o
  LD [M]  drivers/pcmcia/lh7a400_cs.o


==== Patches ====
drivers/pcmcia/ds.c | 2 +-
drivers/pcmcia/rsrc_nonstatic.c | 2 +-
drivers/pcmcia/socket_sysfs.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 15c18f5..7426139 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1517,7 +1517,7 @@ static void pcmcia_bus_remove_socket(struct device *dev,
/* the pcmcia_bus_interface is used to handle pcmcia socket devices */
-static struct class_interface pcmcia_bus_interface = {
+static struct class_interface pcmcia_bus_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pcmcia_bus_add_socket,
.remove_dev = &pcmcia_bus_remove_socket,


diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index bfcaad6..66a52e0 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -1044,7 +1044,7 @@ static void __devexit
pccard_sysfs_remove_rsrc(struct device *dev,
device_remove_file(dev, *attr);
}

-static struct class_interface pccard_rsrc_interface = {
+static struct class_interface pccard_rsrc_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pccard_sysfs_add_rsrc,
.remove_dev = __devexit_p(&pccard_sysfs_remove_rsrc),
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
index b440900..4677286 100644
--- a/drivers/pcmcia/socket_sysfs.c
+++ b/drivers/pcmcia/socket_sysfs.c
@@ -403,7 +403,7 @@ static void __devexit
pccard_sysfs_remove_socket(struct device *dev,
device_remove_file(dev, *attr);
}

-struct class_interface pccard_sysfs_interface = {
+struct class_interface pccard_sysfs_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pccard_sysfs_add_socket,
.remove_dev = __devexit_p(&pccard_sysfs_remove_socket),



More information about the linux-pcmcia mailing list