aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorKeith Owens <kaos@sgi.com>2006-02-03 06:03:53 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 11:32:02 -0500
commit54e8ce463a7e21dbe9dad57723ed47653ee5db15 (patch)
treefff09c6b173bfbf1657edad2bca53db9e2f2bb53 /kernel/module.c
parent501fe31df4bb94999fbe9bb42f05527df5525683 (diff)
[PATCH] Tell kallsyms_lookup_name() to ignore type U entries
When one module exports a function symbol and another module uses that symbol then kallsyms shows the symbol twice. Once from the consumer with a type of 'U' and once from the provider with a type of 't' or 'T'. On most architectures, both entries have the same address so it does not matter which one is returned by kallsyms_lookup_name(). But on architectures with function descriptors, the 'U' entry points to the descriptor, not to the code body, which is not what we want. IA64 # grep -w qla2x00_remove_one /proc/kallsyms a000000208c25ef8 U qla2x00_remove_one [qla2300] <= descriptor a000000208bf44c0 t qla2x00_remove_one [qla2xxx] <= function body Tell kallsyms_lookup_name() to ignore type U entries in modules. Signed-off-by: Keith Owens <kaos@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 618ed6e23ecc..e058aedf6b93 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2092,7 +2092,8 @@ static unsigned long mod_find_symname(struct module *mod, const char *name)
2092 unsigned int i; 2092 unsigned int i;
2093 2093
2094 for (i = 0; i < mod->num_symtab; i++) 2094 for (i = 0; i < mod->num_symtab; i++)
2095 if (strcmp(name, mod->strtab+mod->symtab[i].st_name) == 0) 2095 if (strcmp(name, mod->strtab+mod->symtab[i].st_name) == 0 &&
2096 mod->symtab[i].st_info != 'U')
2096 return mod->symtab[i].st_value; 2097 return mod->symtab[i].st_value;
2097 return 0; 2098 return 0;
2098} 2099}