summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-12-01 02:15:26 -0800
committerJames Bottomley <jejb@raven.il.steeleye.com>2002-12-01 02:15:26 -0800
commitc99f5cea7036f066e9cdefade80a85f0c4f13d93 (patch)
tree9f22f0cd5b16e8da9930261325903546351c0595 /kernel
parent1504317a0d85ff9cbf729d9d4ff3886aacc7a695 (diff)
[PATCH] module names fix
By Kai Germaschewski: "Well, I have another solution, which doesn't need additional Makefile magic or anything. I just put the module name into each .o file where <linux/module.h> is included. Putting it into the section .gnu.linkonce.modname has the effect that even for multi-part modules, we only end up with one copy of the name. Caveat: I'm using the preprocessor macro KBUILD_MODNAME to know what to put into .gnu.linkonce.modname. The following used to happen: (drivers/isdn/eicon/Makefile) divas-objs := common.o Divas_mod.o ... eicon-objs := common.o eicon_mod.o ... Divas_mod.o is compiled with -DKBUILD_MODNAME=divas eicon_mod.o is compiled with -DKBUILD_MODNAME=eicon common.o is compiled with -DKBUILD_MODNAME=divas_eicon So in the case above, both divas.o and eicon.o would end up with a .gnu.linkonce.modname section containing "divas_eicon" My fix to this is to not define KBUILD_MODNAME when compiling an object whilch will be linked into more than one module - so common.o gets no .gnu.linkonce.modname section at all. Works fine here. Now, doing this I remove one of the reasons why we would need modules linked as '.ko' ;), but it seems much cleaner than generating a temporary file, using objcopy etc."
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 712f780d6be1..a30c32e38e23 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -867,8 +867,8 @@ static struct module *load_module(void *umod,
/* Internal symbols */
DEBUGP("Symbol table in section %u\n", i);
symindex = i;
- } else if (strcmp(secstrings+sechdrs[i].sh_name, ".modulename")
- == 0) {
+ } else if (strcmp(secstrings+sechdrs[i].sh_name,
+ ".gnu.linkonce.modname") == 0) {
/* This module's name */
DEBUGP("Module name in section %u\n", i);
modnameindex = i;