diff options
Diffstat (limited to 'tools/objtool/disas.c')
| -rw-r--r-- | tools/objtool/disas.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/objtool/disas.c b/tools/objtool/disas.c index b53be240825d..9cc952e03c35 100644 --- a/tools/objtool/disas.c +++ b/tools/objtool/disas.c @@ -4,6 +4,7 @@ */ #define _GNU_SOURCE +#include <fnmatch.h> #include <objtool/arch.h> #include <objtool/check.h> @@ -556,3 +557,29 @@ void disas_warned_funcs(struct disas_context *dctx) disas_func(dctx, sym); } } + +void disas_funcs(struct disas_context *dctx) +{ + bool disas_all = !strcmp(opts.disas, "*"); + struct section *sec; + struct symbol *sym; + + for_each_sec(dctx->file->elf, sec) { + + if (!(sec->sh.sh_flags & SHF_EXECINSTR)) + continue; + + sec_for_each_sym(sec, sym) { + /* + * If the function had a warning and the verbose + * option is used then the function was already + * disassemble. + */ + if (opts.verbose && sym->warned) + continue; + + if (disas_all || fnmatch(opts.disas, sym->name, 0) == 0) + disas_func(dctx, sym); + } + } +} |