diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2024-11-28 10:38:53 +0100 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2024-12-02 12:01:41 +0100 |
| commit | 22c3d58079688b697f36d670616e463cbb14d058 (patch) | |
| tree | 440a0240b639a34d121659291ae96b9cf22445d9 /tools/objtool | |
| parent | 2116b349e29a2e9ba17ea2e45b31234e4b350793 (diff) | |
objtool: Convert ANNOTATE_NOENDBR to ANNOTATE
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20241128094311.042140333@infradead.org
Diffstat (limited to 'tools/objtool')
| -rw-r--r-- | tools/objtool/check.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index b0efc8ee16d6..a74ff26860f7 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2412,32 +2412,12 @@ static int read_annotate(struct objtool_file *file, void (*func)(int type, struc return 0; } -static void __annotate_nop(int type, struct instruction *insn) +static void __annotate_noendbr(int type, struct instruction *insn) { -} - -static int read_noendbr_hints(struct objtool_file *file) -{ - struct instruction *insn; - struct section *rsec; - struct reloc *reloc; - - rsec = find_section_by_name(file->elf, ".rela.discard.noendbr"); - if (!rsec) - return 0; - - for_each_reloc(rsec, reloc) { - insn = find_insn(file, reloc->sym->sec, - reloc->sym->offset + reloc_addend(reloc)); - if (!insn) { - WARN("bad .discard.noendbr entry"); - return -1; - } - - insn->noendbr = 1; - } + if (type != ANNOTYPE_NOENDBR) + return; - return 0; + insn->noendbr = 1; } static int read_retpoline_hints(struct objtool_file *file) @@ -2713,12 +2693,10 @@ static int decode_sections(struct objtool_file *file) if (ret) return ret; - read_annotate(file, __annotate_nop); - /* * Must be before read_unwind_hints() since that needs insn->noendbr. */ - ret = read_noendbr_hints(file); + ret = read_annotate(file, __annotate_noendbr); if (ret) return ret; |
