mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
Ksplice: Add functions for walking kallsyms symbols
Impact: New API kallsyms_lookup_name only returns the first match that it finds. Ksplice needs information about all symbols with a given name in order to correctly resolve local symbols. kallsyms_on_each_symbol provides a generic mechanism for iterating over the kallsyms table. Cc: Jeff Arnold <[email protected]> Cc: Tim Abbott <[email protected]> Signed-off-by: Anders Kaseorg <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
parent
a6e6abd575
commit
75a66614db
4 changed files with 65 additions and 0 deletions
|
|
@ -161,6 +161,25 @@ unsigned long kallsyms_lookup_name(const char *name)
|
|||
return module_kallsyms_lookup_name(name);
|
||||
}
|
||||
|
||||
int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
|
||||
unsigned long),
|
||||
void *data)
|
||||
{
|
||||
char namebuf[KSYM_NAME_LEN];
|
||||
unsigned long i;
|
||||
unsigned int off;
|
||||
int ret;
|
||||
|
||||
for (i = 0, off = 0; i < kallsyms_num_syms; i++) {
|
||||
off = kallsyms_expand_symbol(off, namebuf);
|
||||
ret = fn(data, namebuf, NULL, kallsyms_addresses[i]);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
}
|
||||
return module_kallsyms_on_each_symbol(fn, data);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kallsyms_on_each_symbol);
|
||||
|
||||
static unsigned long get_symbol_pos(unsigned long addr,
|
||||
unsigned long *symbolsize,
|
||||
unsigned long *offset)
|
||||
|
|
|
|||
Loading…
Reference in a new issue