diff options
Diffstat (limited to 'tools/objtool/elf.c')
-rw-r--r-- | tools/objtool/elf.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index edba4745f25a..cc4601c879ce 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -62,8 +62,18 @@ struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset) struct symbol *sym; list_for_each_entry(sym, &sec->symbol_list, list) - if (sym->type != STT_SECTION && - sym->offset == offset) + if (sym->type != STT_SECTION && sym->offset == offset) + return sym; + + return NULL; +} + +struct symbol *find_func_by_offset(struct section *sec, unsigned long offset) +{ + struct symbol *sym; + + list_for_each_entry(sym, &sec->symbol_list, list) + if (sym->type == STT_FUNC && sym->offset == offset) return sym; return NULL; |