Fix for modules (not MODVERSIONS) in 2.1.1[89]

Tom Lees (tom@lpsg.demon.co.uk)
Thu, 2 Jan 1997 20:18:13 +0000 (GMT)


Here is a patch that will fix module support in kernels 2.1.18+ when
CONFIG_MODVERSIONS is not used. On closer inspection of the patches and
of the new linux/module.h, the problem turns out to be that linux/module.h
needs to have CONFIG_MODULES defined in order for the new EXPORT_SYMBOL
macros to work properly. I have moved the includes of linux/config.h in
the appropriate files to be above linux/modules.h (and also added them in
several places).

Linus - please include this patch in 2.1.20.

I found the files using the following command:-

debian:/usr/src/linux# grep -c EXPORT_SYMBOL `find -name \*.c` | sed
'/[^:]*:0/d'

Here is a log of which files needed fixing of the files found by this
command, and which files were already OK:

./arch/i386/kernel/ksyms.c:25 OK
./arch/alpha/kernel/ksyms.c:51 Fixed
./arch/sparc/kernel/sparc_ksyms.c:90 OK
./arch/m68k/amiga/ksyms.c:14 Fixed
./arch/m68k/atari/ksyms.c:19 Fixed
./arch/m68k/kernel/ksyms.c:23 Fixed
./drivers/net/slhc.c:6 OK
./drivers/net/ppp.c:3 Fixed
./drivers/net/hdlcdrv.c:5 Fixed
./drivers/block/md.c:4 OK
./drivers/block/ide.c:34 OK
./drivers/char/misc.c:4 OK
./drivers/char/serial.c:2 Fixed
./drivers/char/apm_bios.c:2 OK
./drivers/scsi/scsi_syms.c:29 Fixed
./drivers/isdn/isdn_common.c:1 OK
./fs/msdos/msdosfs_syms.c:10 Fixed
./fs/proc/procfs_syms.c:13 Fixed
./fs/fat/fatfs_syms.c:32 Fixed
./fs/vfat/namei.c:9 Fixed
./kernel/ksyms.c:208 Fixed
./net/802/p8022.c:2 Fixed
./net/802/psnap.c:2 Fixed
./net/802/p8022tr.c:2 Fixed
./net/802/llc_macinit.c:6 Fixed
./net/ax25/af_ax25.c:16 OK
./net/core/firewall.c:5 Fixed
./net/ipv4/ip_masq.c:5 OK
./net/ipv4/ip_masq_app.c:3 OK
./net/netsyms.c:157 Fixed

Here is the patch file:

--- linux/arch/alpha/kernel/ksyms.c.pre-fix Thu Jan 2 16:23:23 1997
+++ linux/arch/alpha/kernel/ksyms.c Thu Jan 2 20:00:58 1997
@@ -6,6 +6,7 @@
*/

#include <linux/string.h>
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/user.h>
--- linux/arch/m68k/amiga/ksyms.c.pre-fix Thu Jan 2 16:23:24 1997
+++ linux/arch/m68k/amiga/ksyms.c Thu Jan 2 20:02:34 1997
@@ -1,4 +1,5 @@
#include <linux/types.h>
+#include <linux/config.h>
#include <linux/module.h>
#include <asm/zorro.h>
#include <asm/amigahw.h>
--- linux/arch/m68k/atari/ksyms.c.pre-fix Thu Jan 2 16:23:24 1997
+++ linux/arch/m68k/atari/ksyms.c Thu Jan 2 20:03:04 1997
@@ -1,3 +1,4 @@
+#include <linux/config.h>
#include <linux/module.h>
#include <asm/ptrace.h>
#include <asm/traps.h>
--- linux/arch/m68k/kernel/ksyms.c.pre-fix Thu Jan 2 16:23:24 1997
+++ linux/arch/m68k/kernel/ksyms.c Thu Jan 2 20:01:58 1997
@@ -1,3 +1,4 @@
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/linkage.h>
#include <linux/sched.h>
--- linux/drivers/net/ppp.c.pre-fix Thu Jan 2 16:24:08 1997
+++ linux/drivers/net/ppp.c Thu Jan 2 20:04:00 1997
@@ -59,6 +59,7 @@
* released under the GNU General Public License Version 2.
*/

+#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
--- linux/drivers/net/hdlcdrv.c.pre-fix Thu Jan 2 16:23:34 1997
+++ linux/drivers/net/hdlcdrv.c Thu Jan 2 20:04:33 1997
@@ -35,9 +35,9 @@

/*****************************************************************************/

+#include <linux/config.h>
#include <linux/module.h>

-#include <linux/config.h>
#include <linux/types.h>
#include <linux/net.h>
#include <linux/in.h>
--- linux/drivers/char/serial.c.pre-fix Thu Jan 2 16:23:33 1997
+++ linux/drivers/char/serial.c Thu Jan 2 20:05:34 1997
@@ -25,6 +25,7 @@
* int rs_open(struct tty_struct * tty, struct file * filp)
*/

+#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/signal.h>
@@ -35,7 +36,6 @@
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/serial_reg.h>
-#include <linux/config.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
--- linux/drivers/scsi/scsi_syms.c.pre-fix Thu Jan 2 16:23:39 1997
+++ linux/drivers/scsi/scsi_syms.c Thu Jan 2 20:06:19 1997
@@ -2,9 +2,9 @@
* We should not even be trying to compile this if we are not doing
* a module.
*/
+#include <linux/config.h>
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/config.h>

#ifdef CONFIG_MODULES

--- linux/fs/msdos/msdosfs_syms.c.pre-fix Thu Jan 2 16:23:43 1997
+++ linux/fs/msdos/msdosfs_syms.c Thu Jan 2 20:07:24 1997
@@ -5,6 +5,7 @@
* These symbols are used by umsdos.
*/

+#include <linux/config.h>
#include <linux/module.h>

#include <linux/mm.h>
--- linux/fs/proc/procfs_syms.c.pre-fix Thu Jan 2 16:23:43 1997
+++ linux/fs/proc/procfs_syms.c Thu Jan 2 20:07:58 1997
@@ -1,5 +1,5 @@
-#include <linux/module.h>
#include <linux/config.h>
+#include <linux/module.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>

--- linux/fs/fat/fatfs_syms.c.pre-fix Thu Jan 2 16:23:42 1997
+++ linux/fs/fat/fatfs_syms.c Thu Jan 2 20:08:31 1997
@@ -4,6 +4,7 @@
* Exported kernel symbols for the low-level FAT-based fs support.
*
*/
+#include <linux/config.h>
#include <linux/module.h>

#include <linux/mm.h>
--- linux/fs/vfat/namei.c.pre-fix Thu Jan 2 16:23:44 1997
+++ linux/fs/vfat/namei.c Thu Jan 2 20:09:03 1997
@@ -10,6 +10,7 @@
* the problem, send a script that demonstrates it.
*/

+#include <linux/config.h>
#include <linux/module.h>

#include <linux/sched.h>
--- linux/kernel/ksyms.c.pre-fix Thu Jan 2 16:35:12 1997
+++ linux/kernel/ksyms.c Thu Jan 2 19:54:27 1997
@@ -9,8 +9,8 @@
* by Bjorn Ekwall <bj0rn@blox.se>
*/

-#include <linux/module.h>
#include <linux/config.h>
+#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/fs.h>
--- linux/net/802/p8022.c.pre-fix Thu Jan 2 16:23:47 1997
+++ linux/net/802/p8022.c Thu Jan 2 20:09:45 1997
@@ -1,3 +1,4 @@
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
--- linux/net/802/psnap.c.pre-fix Thu Jan 2 16:23:47 1997
+++ linux/net/802/psnap.c Thu Jan 2 20:10:06 1997
@@ -10,6 +10,7 @@
* 2 of the License, or (at your option) any later version.
*/

+#include <linux/config.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
--- linux/net/802/p8022tr.c.pre-fix Thu Jan 2 16:23:47 1997
+++ linux/net/802/p8022tr.c Thu Jan 2 20:11:21 1997
@@ -1,3 +1,4 @@
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
--- linux/net/802/llc_macinit.c.pre-fix Thu Jan 2 16:23:47 1997
+++ linux/net/802/llc_macinit.c Thu Jan 2 20:12:13 1997
@@ -19,6 +19,7 @@
* Started restructuring handlers
*/

+#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
--- linux/net/core/firewall.c.pre-fix Thu Jan 2 16:23:48 1997
+++ linux/net/core/firewall.c Thu Jan 2 20:12:54 1997
@@ -6,6 +6,7 @@
* much hacked by: Alan Cox
*/

+#include <linux/config.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/firewall.h>
=== End of patch file ===

-- 
Tom Lees <tom@lpsg.demon.co.uk>			http://www.lpsg.demon.co.uk/
PGP ID 87D4D065, fingerprint 2A 66 86 9D 02 4D A6 1E  B8 A2 17 9D 4F 9B 89 D6
finger tom@master.debian.org for full public key (also available on keyservers)