summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-10-10 09:56:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-10-10 09:56:19 -0700
commit65f109e19976a833c18820e3950c8f2bb8bd19b4 (patch)
treecd43551eb1136c0074edf3bedc8e299cd6e851c0 /tools
parent3e71f0167b3db4e4b3d0d8353c375f6587323052 (diff)
parent7a7621dfa417aa3715d2a3bd1bdd6cf5018274d0 (diff)
downloadlinux-stable-65f109e19976a833c18820e3950c8f2bb8bd19b4.tar.gz
linux-stable-65f109e19976a833c18820e3950c8f2bb8bd19b4.tar.bz2
linux-stable-65f109e19976a833c18820e3950c8f2bb8bd19b4.zip
Merge tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool updates from Ingo Molnar: - Remove the "ANNOTATE_NOENDBR on ENDBR" warning: it's not really useful and only found a non-bug false positive so far. - Properly decode LOOP/LOOPE/LOOPNE, which were missing from the x86 decoder. Because these instructions are rather ineffective, they never showed up in compiler output, but they are simple enough to support, so add them for completeness. - A bit more cross-arch preparatory work. * tag 'objtool-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool,x86: Teach decode about LOOP* instructions objtool: Remove "ANNOTATE_NOENDBR on ENDBR" warning objtool: Use arch_jump_destination() in read_intra_function_calls()
Diffstat (limited to 'tools')
-rw-r--r--tools/objtool/arch/x86/decode.c6
-rw-r--r--tools/objtool/check.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index c260006106be..1c253b4b7ce0 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -635,6 +635,12 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
*type = INSN_CONTEXT_SWITCH;
break;
+ case 0xe0: /* loopne */
+ case 0xe1: /* loope */
+ case 0xe2: /* loop */
+ *type = INSN_JUMP_CONDITIONAL;
+ break;
+
case 0xe8:
*type = INSN_CALL;
/*
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index a8cf38639fe8..715f35a8cc00 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2107,9 +2107,6 @@ static int read_noendbr_hints(struct objtool_file *file)
return -1;
}
- if (insn->type == INSN_ENDBR)
- WARN_FUNC("ANNOTATE_NOENDBR on ENDBR", insn->sec, insn->offset);
-
insn->noendbr = 1;
}
@@ -2238,7 +2235,7 @@ static int read_intra_function_calls(struct objtool_file *file)
*/
insn->type = INSN_JUMP_UNCONDITIONAL;
- dest_off = insn->offset + insn->len + insn->immediate;
+ dest_off = arch_jump_destination(insn);
insn->jump_dest = find_insn(file, insn->sec, dest_off);
if (!insn->jump_dest) {
WARN_FUNC("can't find call dest at %s+0x%lx",