summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-01-24 09:54:53 -0600
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-01-24 09:54:53 -0600
commit82455d2ece7982bf0f73e363304dc9b8ecf8c5d2 (patch)
tree014856dcea341da6e30a5b0f7c2ae9d91c7fd820 /kernel
parentdcc38eae49e06d798497373771ae03f5508a2ec7 (diff)
kbuild/modules: Return the index of the symbol from __find_symbol()
We'll need that index to find the version checksum for the symbol in a bit.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/module.c b/kernel/module.c
index c9dc1996d136..150c606a1e07 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -78,6 +78,7 @@ EXPORT_SYMBOL(init_module);
/* Find a symbol, return value and the symbol group */
static unsigned long __find_symbol(const char *name,
struct kernel_symbol_group **group,
+ unsigned int *symidx,
int gplok)
{
struct kernel_symbol_group *ks;
@@ -90,6 +91,8 @@ static unsigned long __find_symbol(const char *name,
for (i = 0; i < ks->num_syms; i++) {
if (strcmp(ks->syms[i].name, name) == 0) {
*group = ks;
+ if (symidx)
+ *symidx = i;
return ks->syms[i].value;
}
}
@@ -520,7 +523,7 @@ void __symbol_put(const char *symbol)
unsigned long flags;
spin_lock_irqsave(&modlist_lock, flags);
- if (!__find_symbol(symbol, &ksg, 1))
+ if (!__find_symbol(symbol, &ksg, NULL, 1))
BUG();
module_put(ksg->owner);
spin_unlock_irqrestore(&modlist_lock, flags);
@@ -732,9 +735,10 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs,
{
struct kernel_symbol_group *ksg;
unsigned long ret;
+ unsigned int symidx;
spin_lock_irq(&modlist_lock);
- ret = __find_symbol(name, &ksg, mod->license_gplok);
+ ret = __find_symbol(name, &ksg, &symidx, mod->license_gplok);
if (ret) {
/* This can fail due to OOM, or module unloading */
if (!use_module(mod, ksg->owner))
@@ -772,7 +776,7 @@ void *__symbol_get(const char *symbol)
unsigned long value, flags;
spin_lock_irqsave(&modlist_lock, flags);
- value = __find_symbol(symbol, &ksg, 1);
+ value = __find_symbol(symbol, &ksg, NULL, 1);
if (value && !strong_try_module_get(ksg->owner))
value = 0;
spin_unlock_irqrestore(&modlist_lock, flags);