diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-10-01 18:43:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-01 19:11:11 -0400 |
commit | 3ae91c21dd29e413f4111978152c14061f0984b0 (patch) | |
tree | 64b4867e2ee81180661c287fa38d068975d1d37f /kernel/module.c | |
parent | 817b33d38f81c8736d39283c35c886ae4668f1af (diff) |
module: fix up CONFIG_KALLSYMS=n build.
Starting from commit 4a4962263f07d14660849ec134ee42b63e95ea9a "reduce
symbol table for loaded modules (v2)", the kernel/module.c build is broken
with CONFIG_KALLSYMS disabled.
CC kernel/module.o
kernel/module.c:1995: warning: type defaults to 'int' in declaration of 'Elf_Hdr'
kernel/module.c:1995: error: expected ';', ',' or ')' before '*' token
kernel/module.c: In function 'load_module':
kernel/module.c:2203: error: 'strmap' undeclared (first use in this function)
kernel/module.c:2203: error: (Each undeclared identifier is reported only once
kernel/module.c:2203: error: for each function it appears in.)
kernel/module.c:2239: error: 'symoffs' undeclared (first use in this function)
kernel/module.c:2239: error: implicit declaration of function 'layout_symtab'
kernel/module.c:2240: error: 'stroffs' undeclared (first use in this function)
make[1]: *** [kernel/module.o] Error 1
make: *** [kernel/module.o] Error 2
There are three different issues:
- layout_symtab() takes a const Elf_Ehdr
- layout_symtab() needs to return a value
- symoffs/stroffs/strmap are referenced by the load_module() code
despite being ifdefed out, which seems unnecessary given the noop
behaviour of layout_symtab()/add_kallsyms() in the case of
CONFIG_KALLSYMS=n.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/module.c b/kernel/module.c index fe748a86d452..8b7d8805819d 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1992,12 +1992,14 @@ static inline unsigned long layout_symtab(struct module *mod, | |||
1992 | Elf_Shdr *sechdrs, | 1992 | Elf_Shdr *sechdrs, |
1993 | unsigned int symindex, | 1993 | unsigned int symindex, |
1994 | unsigned int strindex, | 1994 | unsigned int strindex, |
1995 | const Elf_Hdr *hdr, | 1995 | const Elf_Ehdr *hdr, |
1996 | const char *secstrings, | 1996 | const char *secstrings, |
1997 | unsigned long *pstroffs, | 1997 | unsigned long *pstroffs, |
1998 | unsigned long *strmap) | 1998 | unsigned long *strmap) |
1999 | { | 1999 | { |
2000 | return 0; | ||
2000 | } | 2001 | } |
2002 | |||
2001 | static inline void add_kallsyms(struct module *mod, | 2003 | static inline void add_kallsyms(struct module *mod, |
2002 | Elf_Shdr *sechdrs, | 2004 | Elf_Shdr *sechdrs, |
2003 | unsigned int shnum, | 2005 | unsigned int shnum, |
@@ -2081,9 +2083,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2081 | struct module *mod; | 2083 | struct module *mod; |
2082 | long err = 0; | 2084 | long err = 0; |
2083 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ | 2085 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ |
2084 | #ifdef CONFIG_KALLSYMS | ||
2085 | unsigned long symoffs, stroffs, *strmap; | 2086 | unsigned long symoffs, stroffs, *strmap; |
2086 | #endif | 2087 | |
2087 | mm_segment_t old_fs; | 2088 | mm_segment_t old_fs; |
2088 | 2089 | ||
2089 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", | 2090 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", |