History

objtool: Reorganize cmdline options

Split the existing options into two groups: actions, which actually do something; and options, which modify the actions in some way. Also there's no need to have short flags for all the non-action options. Reserve short flags for the more important actions. While at it: - change a few of the short flags to be more intuitive - make option descriptions more consistently descriptive - sort options in the source like they are when printed - move options to a global struct

Josh Poimboeuf committed 4 years ago

Commit 2daf7fa1 parent aa3d60e9 files · +108 −78Browse files

Unified · Split

9 files
  1. scripts/Makefile.build +5 −5
  2. scripts/link-vmlinux.sh +19 −11
  3. tools/objtool/arch/x86/decode.c +1 −1
  4. tools/objtool/arch/x86/special.c +1 −1
  5. tools/objtool/builtin-check.c +21 −19
  6. tools/objtool/check.c +31 −31
  7. tools/objtool/elf.c +4 −4
  8. tools/objtool/include/objtool/builtin.h +23 −3
  9. tools/objtool/objtool.c +3 −3
scripts/Makefile.build+5−5
@@ -228,14 +228,14 @@ objtool := $(objtree)/tools/objtool/objtool · 227 unmodified lines
228228
229229 objtool_args = \
230230 $(if $(CONFIG_UNWINDER_ORC),orc generate,check) \
231− $(if $(part-of-module), --module) \
232231 $(if $(CONFIG_X86_KERNEL_IBT), --lto --ibt) \
233− $(if $(CONFIG_FRAME_POINTER),, --no-fp) \
234− $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) \
232+ $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \
235233 $(if $(CONFIG_RETPOLINE), --retpoline) \
234+ $(if $(CONFIG_SLS), --sls) \
236235 $(if $(CONFIG_X86_SMAP), --uaccess) \
237− $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \
238− $(if $(CONFIG_SLS), --sls)
236+ $(if $(part-of-module), --module) \
237+ $(if $(CONFIG_FRAME_POINTER),, --no-fp) \
238+ $(if $(CONFIG_GCOV_KERNEL), --no-unreachable)
239239
240240 cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@)
241241 cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd)
scripts/link-vmlinux.sh+19−11
@@ -117,8 +117,6 @@ objtool_link() · 116 unmodified lines
117117 objtoolcmd="orc generate"
118118 fi
119119
120− objtoolopt="${objtoolopt} --lto"
121−
122120 if is_enabled CONFIG_X86_KERNEL_IBT; then
123121 objtoolopt="${objtoolopt} --ibt"
124122 fi
@@ -126,6 +124,8 @@ objtool_link() · 1 unmodified line
126124 if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then
127125 objtoolopt="${objtoolopt} --mcount"
128126 fi
127+
128+ objtoolopt="${objtoolopt} --lto"
129129 fi
130130
131131 if is_enabled CONFIG_VMLINUX_VALIDATION; then
@@ -133,25 +133,33 @@ objtool_link() · 1 unmodified line
133133 fi
134134
135135 if [ -n "${objtoolopt}" ]; then
136+
136137 if [ -z "${objtoolcmd}" ]; then
137138 objtoolcmd="check"
138139 fi
139− objtoolopt="${objtoolopt} --vmlinux"
140− if ! is_enabled CONFIG_FRAME_POINTER; then
141− objtoolopt="${objtoolopt} --no-fp"
142− fi
143− if is_enabled CONFIG_GCOV_KERNEL; then
144− objtoolopt="${objtoolopt} --no-unreachable"
145− fi
140+
146141 if is_enabled CONFIG_RETPOLINE; then
147142 objtoolopt="${objtoolopt} --retpoline"
148143 fi
144+
145+ if is_enabled CONFIG_SLS; then
146+ objtoolopt="${objtoolopt} --sls"
147+ fi
148+
149149 if is_enabled CONFIG_X86_SMAP; then
150150 objtoolopt="${objtoolopt} --uaccess"
151151 fi
152− if is_enabled CONFIG_SLS; then
153− objtoolopt="${objtoolopt} --sls"
152+
153+ if ! is_enabled CONFIG_FRAME_POINTER; then
154+ objtoolopt="${objtoolopt} --no-fp"
154155 fi
156+
157+ if is_enabled CONFIG_GCOV_KERNEL; then
158+ objtoolopt="${objtoolopt} --no-unreachable"
159+ fi
160+
161+ objtoolopt="${objtoolopt} --vmlinux"
162+
155163 info OBJTOOL ${1}
156164 tools/objtool/objtool ${objtoolcmd} ${objtoolopt} ${1}
157165 fi
tools/objtool/arch/x86/decode.c+1−1
@@ -581,7 +581,7 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec · 580 unmodified lines
581581 break;
582582
583583 case 0xc7: /* mov imm, r/m */
584− if (!noinstr)
584+ if (!opts.noinstr)
585585 break;
586586
587587 if (insn.length == 3+4+4 && !strncmp(sec->name, ".init.text", 10)) {
tools/objtool/arch/x86/special.c+1−1
@@ -20,7 +20,7 @@ void arch_handle_alternative(unsigned short feature, struct special_alt *alt) · 19 unmodified lines
2020 * find paths that see the STAC but take the NOP instead of
2121 * CLAC and the other way around.
2222 */
23− if (uaccess)
23+ if (opts.uaccess)
2424 alt->skip_orig = true;
2525 else
2626 alt->skip_alt = true;
tools/objtool/builtin-check.c+21−19
@@ -19,12 +19,10 @@ · 18 unmodified lines
1919 #include <objtool/builtin.h>
2020 #include <objtool/objtool.h>
2121
22−bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats,
23− lto, vmlinux, mcount, noinstr, backup, sls, dryrun,
24− ibt;
22+struct opts opts;
2523
2624 static const char * const check_usage[] = {
27− "objtool check [<options>] file.o",
25+ "objtool check <actions> [<options>] file.o",
2826 NULL,
2927 };
3028
@@ -34,21 +32,25 @@ static const char * const env_usage[] = { · 3 unmodified lines
3432 };
3533
3634 const struct option check_options[] = {
37− OPT_BOOLEAN('f', "no-fp", &no_fp, "Skip frame pointer validation"),
38− OPT_BOOLEAN('u', "no-unreachable", &no_unreachable, "Skip 'unreachable instruction' warnings"),
39− OPT_BOOLEAN('r', "retpoline", &retpoline, "Validate retpoline assumptions"),
40− OPT_BOOLEAN('m', "module", &module, "Indicates the object will be part of a kernel module"),
41− OPT_BOOLEAN('b', "backtrace", &backtrace, "unwind on error"),
42− OPT_BOOLEAN('a', "uaccess", &uaccess, "enable uaccess checking"),
43− OPT_BOOLEAN('s', "stats", &stats, "print statistics"),
44− OPT_BOOLEAN(0, "lto", &lto, "whole-archive like runs"),
45− OPT_BOOLEAN('n', "noinstr", &noinstr, "noinstr validation for vmlinux.o"),
46− OPT_BOOLEAN('l', "vmlinux", &vmlinux, "vmlinux.o validation"),
47− OPT_BOOLEAN('M', "mcount", &mcount, "generate __mcount_loc"),
48− OPT_BOOLEAN('B', "backup", &backup, "create .orig files before modification"),
49− OPT_BOOLEAN('S', "sls", &sls, "validate straight-line-speculation"),
50− OPT_BOOLEAN(0, "dry-run", &dryrun, "don't write the modifications"),
51− OPT_BOOLEAN(0, "ibt", &ibt, "validate ENDBR placement"),
35+ OPT_GROUP("Actions:"),
36+ OPT_BOOLEAN('i', "ibt", &opts.ibt, "validate and annotate IBT"),
37+ OPT_BOOLEAN('m', "mcount", &opts.mcount, "annotate mcount/fentry calls for ftrace"),
38+ OPT_BOOLEAN('n', "noinstr", &opts.noinstr, "validate noinstr rules"),
39+ OPT_BOOLEAN('r', "retpoline", &opts.retpoline, "validate and annotate retpoline usage"),
40+ OPT_BOOLEAN('l', "sls", &opts.sls, "validate straight-line-speculation mitigations"),
41+ OPT_BOOLEAN('u', "uaccess", &opts.uaccess, "validate uaccess rules for SMAP"),
42+
43+ OPT_GROUP("Options:"),
44+ OPT_BOOLEAN(0, "backtrace", &opts.backtrace, "unwind on error"),
45+ OPT_BOOLEAN(0, "backup", &opts.backup, "create .orig files before modification"),
46+ OPT_BOOLEAN(0, "dry-run", &opts.dryrun, "don't write modifications"),
47+ OPT_BOOLEAN(0, "lto", &opts.lto, "whole-archive like runs"),
48+ OPT_BOOLEAN(0, "module", &opts.module, "object is part of a kernel module"),
49+ OPT_BOOLEAN(0, "no-fp", &opts.no_fp, "skip frame pointer validation"),
50+ OPT_BOOLEAN(0, "no-unreachable", &opts.no_unreachable, "skip 'unreachable instruction' warnings"),
51+ OPT_BOOLEAN(0, "stats", &opts.stats, "print statistics"),
52+ OPT_BOOLEAN(0, "vmlinux", &opts.vmlinux, "vmlinux.o validation"),
53+
5254 OPT_END(),
5355 };
5456
tools/objtool/check.c+31−31
@@ -273,7 +273,7 @@ static void init_insn_state(struct insn_state *state, struct section *sec) · 272 unmodified lines
273273 * not correctly determine insn->call_dest->sec (external symbols do
274274 * not have a section).
275275 */
276− if (vmlinux && noinstr && sec)
276+ if (opts.vmlinux && opts.noinstr && sec)
277277 state->noinstr = sec->noinstr;
278278 }
279279
@@ -339,7 +339,7 @@ static void *cfi_hash_alloc(unsigned long size) · 59 unmodified lines
339339 if (cfi_hash == (void *)-1L) {
340340 WARN("mmap fail cfi_hash");
341341 cfi_hash = NULL;
342− } else if (stats) {
342+ } else if (opts.stats) {
343343 printf("cfi_bits: %d\n", cfi_bits);
344344 }
345345
@@ -434,7 +434,7 @@ static int decode_instructions(struct objtool_file *file) · 88 unmodified lines
434434 }
435435 }
436436
437− if (stats)
437+ if (opts.stats)
438438 printf("nr_insns: %lu\n", nr_insns);
439439
440440 return 0;
@@ -497,7 +497,7 @@ static int init_pv_ops(struct objtool_file *file) · 56 unmodified lines
497497 struct symbol *sym;
498498 int idx, nr;
499499
500− if (!noinstr)
500+ if (!opts.noinstr)
501501 return 0;
502502
503503 file->pv_ops = NULL;
@@ -668,7 +668,7 @@ static int create_static_call_sections(struct objtool_file *file) · 164 unmodified lines
668668
669669 key_sym = find_symbol_by_name(file->elf, tmp);
670670 if (!key_sym) {
671− if (!module) {
671+ if (!opts.module) {
672672 WARN("static_call: can't find static_call_key symbol: %s", tmp);
673673 return -1;
674674 }
@@ -761,7 +761,7 @@ static int create_ibt_endbr_seal_sections(struct objtool_file *file) · 86 unmodified lines
761761 list_for_each_entry(insn, &file->endbr_list, call_node)
762762 idx++;
763763
764− if (stats) {
764+ if (opts.stats) {
765765 printf("ibt: ENDBR at function start: %d\n", file->nr_endbr);
766766 printf("ibt: ENDBR inside functions: %d\n", file->nr_endbr_int);
767767 printf("ibt: superfluous ENDBR: %d\n", idx);
@@ -1028,7 +1028,7 @@ static void add_uaccess_safe(struct objtool_file *file) · 260 unmodified lines
10281028 struct symbol *func;
10291029 const char **name;
10301030
1031− if (!uaccess)
1031+ if (!opts.uaccess)
10321032 return;
10331033
10341034 for (name = uaccess_safe_builtin; *name; name++) {
@@ -1170,7 +1170,7 @@ static void annotate_call_site(struct objtool_file *file, · 135 unmodified lines
11701170 return;
11711171 }
11721172
1173− if (mcount && sym->fentry) {
1173+ if (opts.mcount && sym->fentry) {
11741174 if (sibling)
11751175 WARN_FUNC("Tail call to __fentry__ !?!?", insn->sec, insn->offset);
11761176
@@ -1256,7 +1256,7 @@ static bool is_first_func_insn(struct objtool_file *file, struct instruction *in · 79 unmodified lines
12561256 if (insn->offset == insn->func->offset)
12571257 return true;
12581258
1259− if (ibt) {
1259+ if (opts.ibt) {
12601260 struct instruction *prev = prev_insn_same_sym(file, insn);
12611261
12621262 if (prev && prev->type == INSN_ENDBR &&
@@ -1699,7 +1699,7 @@ static int add_special_section_alts(struct objtool_file *file) · 436 unmodified lines
16991699 free(special_alt);
17001700 }
17011701
1702− if (stats) {
1702+ if (opts.stats) {
17031703 printf("jl\\\tNOP\tJMP\n");
17041704 printf("short:\t%ld\t%ld\n", file->jl_nop_short, file->jl_short);
17051705 printf("long:\t%ld\t%ld\n", file->jl_nop_long, file->jl_long);
@@ -1945,7 +1945,7 @@ static int read_unwind_hints(struct objtool_file *file) · 239 unmodified lines
19451945
19461946 insn->hint = true;
19471947
1948− if (ibt && hint->type == UNWIND_HINT_TYPE_REGS_PARTIAL) {
1948+ if (opts.ibt && hint->type == UNWIND_HINT_TYPE_REGS_PARTIAL) {
19491949 struct symbol *sym = find_symbol_by_offset(insn->sec, insn->offset);
19501950
19511951 if (sym && sym->bind == STB_GLOBAL &&
@@ -2806,7 +2806,7 @@ static int update_cfi_state(struct instruction *insn, · 854 unmodified lines
28062806 }
28072807
28082808 /* detect when asm code uses rbp as a scratch register */
2809− if (!no_fp && insn->func && op->src.reg == CFI_BP &&
2809+ if (!opts.no_fp && insn->func && op->src.reg == CFI_BP &&
28102810 cfa->base != CFI_BP)
28112811 cfi->bp_scratch = true;
28122812 break;
@@ -3363,7 +3363,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 550 unmodified lines
33633363
33643364 ret = validate_branch(file, func, alt->insn, state);
33653365 if (ret) {
3366− if (backtrace)
3366+ if (opts.backtrace)
33673367 BT_FUNC("(alt)", insn);
33683368 return ret;
33693369 }
@@ -3379,7 +3379,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 9 unmodified lines
33793379 switch (insn->type) {
33803380
33813381 case INSN_RETURN:
3382− if (sls && !insn->retpoline_safe &&
3382+ if (opts.sls && !insn->retpoline_safe &&
33833383 next_insn && next_insn->type != INSN_TRAP) {
33843384 WARN_FUNC("missing int3 after ret",
33853385 insn->sec, insn->offset);
@@ -3392,7 +3392,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 6 unmodified lines
33923392 if (ret)
33933393 return ret;
33943394
3395− if (!no_fp && func && !is_fentry_call(insn) &&
3395+ if (!opts.no_fp && func && !is_fentry_call(insn) &&
33963396 !has_valid_stack_frame(&state)) {
33973397 WARN_FUNC("call without frame pointer save/setup",
33983398 sec, insn->offset);
@@ -3415,7 +3415,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 16 unmodified lines
34153415 ret = validate_branch(file, func,
34163416 insn->jump_dest, state);
34173417 if (ret) {
3418− if (backtrace)
3418+ if (opts.backtrace)
34193419 BT_FUNC("(branch)", insn);
34203420 return ret;
34213421 }
@@ -3427,7 +3427,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 5 unmodified lines
34273427 break;
34283428
34293429 case INSN_JUMP_DYNAMIC:
3430− if (sls && !insn->retpoline_safe &&
3430+ if (opts.sls && !insn->retpoline_safe &&
34313431 next_insn && next_insn->type != INSN_TRAP) {
34323432 WARN_FUNC("missing int3 after indirect jump",
34333433 insn->sec, insn->offset);
@@ -3499,7 +3499,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, · 65 unmodified lines
34993499 break;
35003500 }
35013501
3502− if (ibt)
3502+ if (opts.ibt)
35033503 validate_ibt_insn(file, insn);
35043504
35053505 if (insn->dead_end)
@@ -3541,7 +3541,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec) · 35 unmodified lines
35413541 while (&insn->list != &file->insn_list && (!sec || insn->sec == sec)) {
35423542 if (insn->hint && !insn->visited && !insn->ignore) {
35433543 ret = validate_branch(file, insn->func, insn, state);
3544− if (ret && backtrace)
3544+ if (ret && opts.backtrace)
35453545 BT_FUNC("<=== (hint)", insn);
35463546 warnings += ret;
35473547 }
@@ -3571,7 +3571,7 @@ static int validate_retpoline(struct objtool_file *file) · 23 unmodified lines
35713571 * loaded late, they very much do need retpoline in their
35723572 * .init.text
35733573 */
3574− if (!strcmp(insn->sec->name, ".init.text") && !module)
3574+ if (!strcmp(insn->sec->name, ".init.text") && !opts.module)
35753575 continue;
35763576
35773577 WARN_FUNC("indirect %s found in RETPOLINE build",
@@ -3621,7 +3621,7 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio · 43 unmodified lines
36213621 * In this case we'll find a piece of code (whole function) that is not
36223622 * covered by a !section symbol. Ignore them.
36233623 */
3624− if (!insn->func && lto) {
3624+ if (!insn->func && opts.lto) {
36253625 int size = find_symbol_hole_containing(insn->sec, insn->offset);
36263626 unsigned long end = insn->offset + size;
36273627
@@ -3728,7 +3728,7 @@ static int validate_symbol(struct objtool_file *file, struct section *sec, · 100 unmodified lines
37283728 state->uaccess = sym->uaccess_safe;
37293729
37303730 ret = validate_branch(file, insn->func, insn, *state);
3731− if (ret && backtrace)
3731+ if (ret && opts.backtrace)
37323732 BT_FUNC("<=== (sym)", insn);
37333733 return ret;
37343734 }
@@ -3853,12 +3853,12 @@ int check(struct objtool_file *file) · 118 unmodified lines
38533853 {
38543854 int ret, warnings = 0;
38553855
3856− if (lto && !(vmlinux || module)) {
3856+ if (opts.lto && !(opts.vmlinux || opts.module)) {
38573857 fprintf(stderr, "--lto requires: --vmlinux or --module\n");
38583858 return 1;
38593859 }
38603860
3861− if (ibt && !lto) {
3861+ if (opts.ibt && !opts.lto) {
38623862 fprintf(stderr, "--ibt requires: --lto\n");
38633863 return 1;
38643864 }
@@ -3883,7 +3883,7 @@ int check(struct objtool_file *file) · 18 unmodified lines
38833883 if (list_empty(&file->insn_list))
38843884 goto out;
38853885
3886− if (vmlinux && !lto) {
3886+ if (opts.vmlinux && !opts.lto) {
38873887 ret = validate_vmlinux_functions(file);
38883888 if (ret < 0)
38893889 goto out;
@@ -3892,7 +3892,7 @@ int check(struct objtool_file *file) · 2 unmodified lines
38923892 goto out;
38933893 }
38943894
3895− if (retpoline) {
3895+ if (opts.retpoline) {
38963896 ret = validate_retpoline(file);
38973897 if (ret < 0)
38983898 return ret;
@@ -3909,7 +3909,7 @@ int check(struct objtool_file *file) · 10 unmodified lines
39093909 goto out;
39103910 warnings += ret;
39113911
3912− if (ibt) {
3912+ if (opts.ibt) {
39133913 ret = validate_ibt(file);
39143914 if (ret < 0)
39153915 goto out;
@@ -3928,28 +3928,28 @@ int check(struct objtool_file *file) · 12 unmodified lines
39283928 goto out;
39293929 warnings += ret;
39303930
3931− if (retpoline) {
3931+ if (opts.retpoline) {
39323932 ret = create_retpoline_sites_sections(file);
39333933 if (ret < 0)
39343934 goto out;
39353935 warnings += ret;
39363936 }
39373937
3938− if (mcount) {
3938+ if (opts.mcount) {
39393939 ret = create_mcount_loc_sections(file);
39403940 if (ret < 0)
39413941 goto out;
39423942 warnings += ret;
39433943 }
39443944
3945− if (ibt) {
3945+ if (opts.ibt) {
39463946 ret = create_ibt_endbr_seal_sections(file);
39473947 if (ret < 0)
39483948 goto out;
39493949 warnings += ret;
39503950 }
39513951
3952− if (stats) {
3952+ if (opts.stats) {
39533953 printf("nr_insns_visited: %ld\n", nr_insns_visited);
39543954 printf("nr_cfi: %ld\n", nr_cfi);
39553955 printf("nr_cfi_reused: %ld\n", nr_cfi_reused);
tools/objtool/elf.c+4−4
@@ -355,7 +355,7 @@ static int read_sections(struct elf *elf) · 354 unmodified lines
355355 elf_hash_add(section_name, &sec->name_hash, str_hash(sec->name));
356356 }
357357
358− if (stats) {
358+ if (opts.stats) {
359359 printf("nr_sections: %lu\n", (unsigned long)sections_nr);
360360 printf("section_bits: %d\n", elf->section_bits);
361361 }
@@ -475,7 +475,7 @@ static int read_symbols(struct elf *elf) · 113 unmodified lines
475475 elf_add_symbol(elf, sym);
476476 }
477477
478− if (stats) {
478+ if (opts.stats) {
479479 printf("nr_symbols: %lu\n", (unsigned long)symbols_nr);
480480 printf("symbol_bits: %d\n", elf->symbol_bits);
481481 }
@@ -843,7 +843,7 @@ static int read_relocs(struct elf *elf) · 361 unmodified lines
843843 tot_reloc += nr_reloc;
844844 }
845845
846− if (stats) {
846+ if (opts.stats) {
847847 printf("max_reloc: %lu\n", max_reloc);
848848 printf("tot_reloc: %lu\n", tot_reloc);
849849 printf("reloc_bits: %d\n", elf->reloc_bits);
@@ -1222,7 +1222,7 @@ int elf_write(struct elf *elf) · 372 unmodified lines
12221222 struct section *sec;
12231223 Elf_Scn *s;
12241224
1225− if (dryrun)
1225+ if (opts.dryrun)
12261226 return 0;
12271227
12281228 /* Update changed relocation sections and section headers: */
tools/objtool/include/objtool/builtin.h+23−3
@@ -8,9 +8,29 @@ · 7 unmodified lines
88 #include <subcmd/parse-options.h>
99
1010 extern const struct option check_options[];
11−extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats,
12− lto, vmlinux, mcount, noinstr, backup, sls, dryrun,
13− ibt;
11+
12+struct opts {
13+ /* actions: */
14+ bool ibt;
15+ bool mcount;
16+ bool noinstr;
17+ bool retpoline;
18+ bool sls;
19+ bool uaccess;
20+
21+ /* options: */
22+ bool backtrace;
23+ bool backup;
24+ bool dryrun;
25+ bool lto;
26+ bool module;
27+ bool no_fp;
28+ bool no_unreachable;
29+ bool stats;
30+ bool vmlinux;
31+};
32+
33+extern struct opts opts;
1434
1535 extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]);
1636
tools/objtool/objtool.c+3−3
@@ -118,7 +118,7 @@ struct objtool_file *objtool_open_read(const char *_objname) · 117 unmodified lines
118118 if (!file.elf)
119119 return NULL;
120120
121− if (backup && !objtool_create_backup(objname)) {
121+ if (opts.backup && !objtool_create_backup(objname)) {
122122 WARN("can't create backup file");
123123 return NULL;
124124 }
@@ -129,7 +129,7 @@ struct objtool_file *objtool_open_read(const char *_objname) · 4 unmodified lines
129129 INIT_LIST_HEAD(&file.static_call_list);
130130 INIT_LIST_HEAD(&file.mcount_loc_list);
131131 INIT_LIST_HEAD(&file.endbr_list);
132− file.ignore_unreachables = no_unreachable;
132+ file.ignore_unreachables = opts.no_unreachable;
133133 file.hints = false;
134134
135135 return &file;
@@ -137,7 +137,7 @@ struct objtool_file *objtool_open_read(const char *_objname) · 1 unmodified line
137137
138138 void objtool_pv_add(struct objtool_file *f, int idx, struct symbol *func)
139139 {
140− if (!noinstr)
140+ if (!opts.noinstr)
141141 return;
142142
143143 if (!f->pv_ops) {