[lkml]   [2009]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectFix 4a49622: module: reduce symbol table for loaded modules (v2)
Unfortunately, the above referenced change results in the following
for the !KALLSYMS case:

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)

Signed-off-by: Russell King <>
kernel/module.c | 30 ++++++++----------------------
1 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index fe748a8..e30df34 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1987,28 +1987,6 @@ static void add_kallsyms(struct module *mod,
if (test_bit(i, strmap))
*++s = mod->strtab[i];
-static inline unsigned long layout_symtab(struct module *mod,
- Elf_Shdr *sechdrs,
- unsigned int symindex,
- unsigned int strindex,
- const Elf_Hdr *hdr,
- const char *secstrings,
- unsigned long *pstroffs,
- unsigned long *strmap)
-static inline void add_kallsyms(struct module *mod,
- Elf_Shdr *sechdrs,
- unsigned int shnum,
- unsigned int symindex,
- unsigned int strindex,
- unsigned long symoffs,
- unsigned long stroffs,
- const char *secstrings,
- const unsigned long *strmap)
#endif /* CONFIG_KALLSYMS */

static void dynamic_debug_setup(struct _ddebug *debug, unsigned int num)
@@ -2200,12 +2178,14 @@ static noinline struct module *load_module(void __user *umod,
goto free_hdr;

strmap = kzalloc(BITS_TO_LONGS(sechdrs[strindex].sh_size)
* sizeof(long), GFP_KERNEL);
if (!strmap) {
err = -ENOMEM;
goto free_mod;

if (find_module(mod->name)) {
err = -EEXIST;
@@ -2236,8 +2216,10 @@ static noinline struct module *load_module(void __user *umod,
this is done generically; there doesn't appear to be any
special cases for the architectures. */
layout_sections(mod, hdr, sechdrs, secstrings);
symoffs = layout_symtab(mod, sechdrs, symindex, strindex, hdr,
secstrings, &stroffs, strmap);

/* Do the allocs. */
ptr = module_alloc_update_bounds(mod->core_size);
@@ -2442,10 +2424,12 @@ static noinline struct module *load_module(void __user *umod,
percpu_modcopy(mod->percpu, (void *)sechdrs[pcpuindex].sh_addr,

add_kallsyms(mod, sechdrs, hdr->e_shnum, symindex, strindex,
symoffs, stroffs, secstrings, strmap);
strmap = NULL;

if (!mod->taints) {
struct _ddebug *debug;
@@ -2535,7 +2519,9 @@ static noinline struct module *load_module(void __user *umod,
return ERR_PTR(err);

 \ /
  Last update: 2009-10-01 12:59    [W:0.044 / U:4.916 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site