Skip to contentSkip to conversation

modules in 2.6 kernel - question for FAQ?

DISCUSSION Rusty Russell 4 participants 6 messages Apr 15, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · Arkadiusz Miskiewicz

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.

kernel/module.c +2 -0
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
@@ -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;
 
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#2 lore raw
Quoted 7 lines · Rusty Russell
Quoted 1 line · Arkadiusz Miskiewicz

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...

Is it be possible to detect this during the modpost stage, or do they manage to avoid that in some way?
I would rather see the error a bit earlier. Eventually depmod. Still your patch make relevance as a double check.

Sam

#3 lore raw
Quoted 7 lines · Sam Ravnborg
Quoted 6 lines · Rusty Russell
Quoted 1 line · Arkadiusz Miskiewicz

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.

Quoted 6 lines
Quoted 1 line

Here's a new one...

Is it be possible to detect this during the modpost stage, or do they manage to avoid that in some way?
I would rather see the error a bit earlier. Eventually depmod. Still your patch make relevance as a double check.

They can only do this if they're not using the kernel makefiles. So I don't really think it's a priority...

Cheers,
Rusty.

Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#4 lore raw
Quoted 2 lines · Rusty Russell

They can only do this if they're not using the kernel makefiles. So I don't really think it's a priority...

Unfortunately some of us have no choice but to use binary-only drivers.

This is starting to change, but they are currently still needed for some hardware.

Chris

#5 lore raw
Quoted 9 lines · Chris Friesen
Quoted 2 lines · Rusty Russell

They can only do this if they're not using the kernel makefiles. So I don't really think it's a priority...

Unfortunately some of us have no choice but to use binary-only drivers.

This is starting to change, but they are currently still needed for some hardware.

I think you misunderstood; even binary only module build stuff needs to use the kernel makefiles, via make -C /path/to/kernel etc, as documented in Documentation/kbuild/modules.txt

#6 lore raw
Quoted 3 lines · Arjan van de Ven

I think you misunderstood; even binary only module build stuff needs to use the kernel makefiles, via make -C /path/to/kernel etc, as documented in Documentation/kbuild/modules.txt

I know this, you know this. There are hardware vendors that still do not know this--or at least aren't doing it.

Chris