diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index bf4dccadf7b8..3da76ad32d78 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2126,6 +2126,29 @@ const char *module_address_lookup(unsigned long addr, | |||
2126 | return NULL; | 2126 | return NULL; |
2127 | } | 2127 | } |
2128 | 2128 | ||
2129 | int lookup_module_symbol_name(unsigned long addr, char *symname) | ||
2130 | { | ||
2131 | struct module *mod; | ||
2132 | |||
2133 | mutex_lock(&module_mutex); | ||
2134 | list_for_each_entry(mod, &modules, list) { | ||
2135 | if (within(addr, mod->module_init, mod->init_size) || | ||
2136 | within(addr, mod->module_core, mod->core_size)) { | ||
2137 | const char *sym; | ||
2138 | |||
2139 | sym = get_ksymbol(mod, addr, NULL, NULL); | ||
2140 | if (!sym) | ||
2141 | goto out; | ||
2142 | strlcpy(symname, sym, KSYM_NAME_LEN + 1); | ||
2143 | mutex_unlock(&module_mutex); | ||
2144 | return 0; | ||
2145 | } | ||
2146 | } | ||
2147 | out: | ||
2148 | mutex_unlock(&module_mutex); | ||
2149 | return -ERANGE; | ||
2150 | } | ||
2151 | |||
2129 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | 2152 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, |
2130 | char *name, char *module_name, int *exported) | 2153 | char *name, char *module_name, int *exported) |
2131 | { | 2154 | { |