diff options
| author | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-03-09 19:03:05 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-11 15:19:17 +0300 |
| commit | e9126544fd7798aa509a0397ebb0bb783b47cb89 (patch) | |
| tree | 4b9975443c851283bda72348cb9757ff4f7748f6 /tools/objtool | |
| parent | 960159a9f84686fc2280a8c4637255fe110f9286 (diff) | |
| download | linux-e9126544fd7798aa509a0397ebb0bb783b47cb89.tar.xz | |
objtool: Fix Clang jump table detection
[ Upstream commit 4e5019216402ad0b4a84cff457b662d26803f103 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/objtool')
| -rw-r--r-- | tools/objtool/check.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 6497c80fd6f7..2c7b09c8415f 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2136,12 +2136,11 @@ static void mark_func_jump_tables(struct objtool_file *file, last = insn; /* - * Store back-pointers for unconditional forward jumps such + * Store back-pointers for forward jumps such * that find_jump_table() can back-track using those and * avoid some potentially confusing code. */ - if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->jump_dest && - insn->offset > last->offset && + if (insn->jump_dest && insn->jump_dest->offset > insn->offset && !insn->jump_dest->first_jump_src) { |
