Skip to content

Commit 65f109e

Browse files
committed
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()
2 parents 3e71f01 + 7a7621d commit 65f109e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tools/objtool/arch/x86/decode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
635635
*type = INSN_CONTEXT_SWITCH;
636636
break;
637637

638+
case 0xe0: /* loopne */
639+
case 0xe1: /* loope */
640+
case 0xe2: /* loop */
641+
*type = INSN_JUMP_CONDITIONAL;
642+
break;
643+
638644
case 0xe8:
639645
*type = INSN_CALL;
640646
/*

tools/objtool/check.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,9 +2107,6 @@ static int read_noendbr_hints(struct objtool_file *file)
21072107
return -1;
21082108
}
21092109

2110-
if (insn->type == INSN_ENDBR)
2111-
WARN_FUNC("ANNOTATE_NOENDBR on ENDBR", insn->sec, insn->offset);
2112-
21132110
insn->noendbr = 1;
21142111
}
21152112

@@ -2238,7 +2235,7 @@ static int read_intra_function_calls(struct objtool_file *file)
22382235
*/
22392236
insn->type = INSN_JUMP_UNCONDITIONAL;
22402237

2241-
dest_off = insn->offset + insn->len + insn->immediate;
2238+
dest_off = arch_jump_destination(insn);
22422239
insn->jump_dest = find_insn(file, insn->sec, dest_off);
22432240
if (!insn->jump_dest) {
22442241
WARN_FUNC("can't find call dest at %s+0x%lx",

0 commit comments

Comments
 (0)