diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-08-07 00:14:09 +0200 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2021-02-23 21:46:56 +0100 |
commit | 99d0021569c71c325f41a7dd0a08a380010ce95c (patch) | |
tree | 95d3a5bbeb4923e1aa67c06f30115882ecc8ed3b /tools/objtool/objtool.c | |
parent | kbuild: prevent CC_FLAGS_LTO self-bloating on recursive rebuilds (diff) | |
download | linux-99d0021569c71c325f41a7dd0a08a380010ce95c.tar.xz 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/objtool.c')
-rw-r--r-- | tools/objtool/objtool.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c index 9df0cd86d310..c1819a6f2a18 100644 --- a/tools/objtool/objtool.c +++ b/tools/objtool/objtool.c @@ -62,6 +62,7 @@ struct objtool_file *objtool_open_read(const char *_objname) INIT_LIST_HEAD(&file.insn_list); hash_init(file.insn_hash); INIT_LIST_HEAD(&file.static_call_list); + INIT_LIST_HEAD(&file.mcount_loc_list); file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment"); file.ignore_unreachables = no_unreachable; file.hints = false; |