Skip to content

Commit 4e50192

Browse files
committed
objtool: Fix Clang jump table detection
With Clang, there can be a conditional forward jump between the load of the jump table address and the indirect branch. Fixes the following warning: vmlinux.o: warning: objtool: ___bpf_prog_run+0x1c5: sibling call from callable instruction with modified stack frame Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/a426d669-58bb-4be1-9eaa-6f3d83109e2d@app.fastmail.com Link: https://patch.msgid.link/7d8600caed08901b6679767488acd639f6df9688.1773071992.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
1 parent 6f93f7b commit 4e50192

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tools/objtool/check.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,12 +2184,11 @@ static void mark_func_jump_tables(struct objtool_file *file,
21842184
last = insn;
21852185

21862186
/*
2187-
* Store back-pointers for unconditional forward jumps such
2187+
* Store back-pointers for forward jumps such
21882188
* that find_jump_table() can back-track using those and
21892189
* avoid some potentially confusing code.
21902190
*/
2191-
if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->jump_dest &&
2192-
insn->offset > last->offset &&
2191+
if (insn->jump_dest &&
21932192
insn->jump_dest->offset > insn->offset &&
21942193
!insn->jump_dest->first_jump_src) {
21952194

0 commit comments

Comments
 (0)