Subject: Re: modules in 2.6 kernel - question for FAQ?
From: Rusty Russell <[email-masked]>
To: Arkadiusz Miskiewicz <[email-masked]>
Cc: Andrew Morton <[email-masked]>, lkml - Kernel Mailing List <[email-masked]>
Date: Thu, 15 Apr 2004 11:52:48 +1000

On Thu, 2004-04-15 at 05:42, Arkadiusz Miskiewicz wrote:
> insmod: error inserting './Intel537.ko': -1 Invalid module format

They didn't use -fno-common.  The patch which adds in the warning got
lost a while back.

Here's a new one...
Rusty.

Name: Print Warning for Common Symbols
Status: Trivial

People still build modules wrong, particularly without -fno-common.
The resulting modules don't load, but we should at least warn about it.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17714-linux-2.6.5-bk2/kernel/module.c .17714-linux-2.6.5-bk2.updated/kernel/module.c
--- .17714-linux-2.6.5-bk2/kernel/module.c	2004-04-15 09:24:16.000000000 +1000
+++ .17714-linux-2.6.5-bk2.updated/kernel/module.c	2004-04-15 10:32:39.000000000 +1000
@@ -1003,6 +1003,8 @@ static int simplify_symbols(Elf_Shdr *se
 			/* We compiled with -fno-common.  These are not
 			   supposed to happen.  */
 			DEBUGP("Common symbol: %s\n", strtab + sym[i].st_name);
+			printk("%s: please compile with -fno-common\n",
+			       mod->name);
 			ret = -ENOEXEC;
 			break;

-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell