diff options
| author | Michael Ellerman <[email protected]> | 2022-12-08 12:57:47 +0000 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2022-12-08 12:57:47 +0000 |
| commit | f24f21c4122e837fa031cc512a7f20eb8c554c5e (patch) | |
| tree | b19acb396850fbfb36218329659b926446c24914 /tools/objtool/builtin-check.c | |
| parent | powerpc/prom: Fix 32-bit build (diff) | |
| parent | objtool/powerpc: Implement arch_pc_relative_reloc() (diff) | |
| download | kernel-f24f21c4122e837fa031cc512a7f20eb8c554c5e.tar.gz kernel-f24f21c4122e837fa031cc512a7f20eb8c554c5e.zip | |
Merge branch 'topic/objtool' into next
Merge the powerpc objtool support, which we were keeping in a topic
branch in case of any merge conflicts.
Diffstat (limited to 'tools/objtool/builtin-check.c')
| -rw-r--r-- | tools/objtool/builtin-check.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 24fbe803a0d3..9bd347d3c244 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -82,6 +82,7 @@ const struct option check_options[] = { OPT_BOOLEAN(0, "dry-run", &opts.dryrun, "don't write modifications"), OPT_BOOLEAN(0, "link", &opts.link, "object is a linked object"), OPT_BOOLEAN(0, "module", &opts.module, "object is part of a kernel module"), + OPT_BOOLEAN(0, "mnop", &opts.mnop, "nop out mcount call sites"), OPT_BOOLEAN(0, "no-unreachable", &opts.no_unreachable, "skip 'unreachable instruction' warnings"), OPT_BOOLEAN(0, "sec-address", &opts.sec_address, "print section addresses in warnings"), OPT_BOOLEAN(0, "stats", &opts.stats, "print statistics"), @@ -150,6 +151,16 @@ static bool opts_valid(void) return false; } +static bool mnop_opts_valid(void) +{ + if (opts.mnop && !opts.mcount) { + ERROR("--mnop requires --mcount"); + return false; + } + + return true; +} + static bool link_opts_valid(struct objtool_file *file) { if (opts.link) @@ -198,6 +209,9 @@ int objtool_run(int argc, const char **argv) if (!file) return 1; + if (!mnop_opts_valid()) + return 1; + if (!link_opts_valid(file)) return 1; |
