diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-08-06 15:14:09 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2021-02-23 12:46:56 -0800 |
commit | 99d0021569c71c325f41a7dd0a08a380010ce95c (patch) | |
tree | 95d3a5bbeb4923e1aa67c06f30115882ecc8ed3b /tools/objtool/builtin-check.c | |
parent | 2b8689520520175075ca97bc4eaf51ff3f7253aa (diff) | |
download | linux-99d0021569c71c325f41a7dd0a08a380010ce95c.tar.gz linux-99d0021569c71c325f41a7dd0a08a380010ce95c.tar.bz2 linux-99d0021569c71c325f41a7dd0a08a380010ce95c.zip |
objtool: Add a pass for generating __mcount_loc
Add the --mcount option for generating __mcount_loc sections
needed for dynamic ftrace. Using this pass requires the kernel to
be compiled with -mfentry and CC_USING_NOP_MCOUNT to be defined
in Makefile.
Link: https://lore.kernel.org/lkml/20200625200235.GQ4781@hirez.programming.kicks-ass.net/
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
[Sami: rebased, dropped config changes, fixed to actually use --mcount,
and wrote a commit message.]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'tools/objtool/builtin-check.c')
-rw-r--r-- | tools/objtool/builtin-check.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index c6d199bfd0ae..e92e76f69176 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -18,7 +18,7 @@ #include "builtin.h" #include "objtool.h" -bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux; +bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux, mcount; static const char * const check_usage[] = { "objtool check [<options>] file.o", @@ -35,6 +35,7 @@ const struct option check_options[] = { OPT_BOOLEAN('s', "stats", &stats, "print statistics"), OPT_BOOLEAN('d', "duplicate", &validate_dup, "duplicate validation for vmlinux.o"), OPT_BOOLEAN('l', "vmlinux", &vmlinux, "vmlinux.o validation"), + OPT_BOOLEAN('M', "mcount", &mcount, "generate __mcount_loc"), OPT_END(), }; |