[patch] Fix .text.exit error with static compile of synclinkmp.c

From: Adrian Bunk (bunk@fs.tum.de)
Date: Thu Sep 05 2002 - 12:36:45 EST


Hi,

when compiling synclinkmp.c statically into the kernel the following error
occurs at the final linking (this is 2.4.20-pre5-ac2 but the problem also
exists in 2.4.20-pre5):

<-- snip -->

...
        --end-group \
        -o vmlinux
drivers/char/char.o(.data+0x81b4): undefined reference to `local symbols
in discarded section .text.exit'
make: *** [vmlinux] Error 1

<-- snip -->

The problem is that the __exit function synclinkmp_remove_one is referred
to in "static struct pci_driver synclinkmp_pci_driver".

The fix is simple:

--- drivers/char/synclinkmp.c.old 2002-09-05 12:40:25.000000000 +0200
+++ drivers/char/synclinkmp.c 2002-09-05 12:42:34.000000000 +0200
@@ -519,7 +519,9 @@
         name: "synclinkmp",
         id_table: synclinkmp_pci_tbl,
         probe: synclinkmp_init_one,
+#ifdef MODULE
         remove: synclinkmp_remove_one,
+#endif
 };

cu
Adrian

-- 

You only think this is a free country. Like the US the UK spends a lot of time explaining its a free country because its a police state. Alan Cox

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 07 2002 - 22:00:25 EST