diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.9.21/0077-objtool-Fix-retpoline-support-for-pre-ORC-objtool.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.9.21/0077-objtool-Fix-retpoline-support-for-pre-ORC-objtool.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.9.21/0077-objtool-Fix-retpoline-support-for-pre-ORC-objtool.patch b/common/recipes-kernel/linux/linux-yocto-4.9.21/0077-objtool-Fix-retpoline-support-for-pre-ORC-objtool.patch new file mode 100644 index 00000000..3334f65c --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.9.21/0077-objtool-Fix-retpoline-support-for-pre-ORC-objtool.patch @@ -0,0 +1,44 @@ +From 2a4405e938734d966dc7693f93c93af899f7b4be Mon Sep 17 00:00:00 2001 +From: Josh Poimboeuf <jpoimboe@redhat.com> +Date: Mon, 15 Jan 2018 11:00:54 -0600 +Subject: [PATCH 077/103] 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> +--- + tools/objtool/builtin-check.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c +index ee71d4c..377bff0 100644 +--- a/tools/objtool/builtin-check.c ++++ b/tools/objtool/builtin-check.c +@@ -1221,6 +1221,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++; +-- +2.7.4 + |