diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2018-01-15 11:00:54 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-17 09:39:00 +0100 |
commit | 92e8f204947484f642b77836c0ce9f710d83f836 (patch) | |
tree | 29148675c43a6717414f9fb454bfc0a027249776 /tools | |
parent | 44f1eae7fe6597381ce550027fdfa2e578a96ad8 (diff) |
objtool: Fix retpoline support for pre-ORC objtool
Objtool 1.0 (pre-ORC) produces the following warning when it encounters
a retpoline:
arch/x86/crypto/camellia-aesni-avx2-asm_64.o: warning: objtool: .altinstr_replacement+0xf: return instruction outside of a callable function
That warning is meant to catch GCC bugs and missing ENTRY/ENDPROC
annotations, neither of which are applicable to alternatives. Silence
the warning for alternative instructions, just like objtool 2.0 already
does.
Reported-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/builtin-check.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index f789621cbdba..a688a857a7ae 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -1230,6 +1230,14 @@ static int validate_uncallable_instructions(struct objtool_file *file) for_each_insn(file, insn) { if (!insn->visited && insn->type == INSN_RETURN) { + + /* + * Don't warn about call instructions in unvisited + * retpoline alternatives. + */ + if (!strcmp(insn->sec->name, ".altinstr_replacement")) + continue; + WARN_FUNC("return instruction outside of a callable function", insn->sec, insn->offset); warnings++; |