]> www.infradead.org Git - users/jedix/linux-maple.git/commit
objtool: Fix detection of consecutive jump tables on Clang 20
authorJosh Poimboeuf <jpoimboe@kernel.org>
Mon, 24 Mar 2025 21:55:51 +0000 (14:55 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 08:20:25 +0000 (09:20 +0100)
commitef753d66051ca03bee1982ce047f9eaf90f81ab4
treee241dbeca401808633b521949bc7c40d2a9369de
parent2df0c02dab829dd89360d98a8a1abaa026ef5798
objtool: Fix detection of consecutive jump tables on Clang 20

The jump table detection code assumes jump tables are in the same order
as their corresponding indirect branches.  That's apparently not always
true with Clang 20.

Fix that by changing how multiple jump tables are detected.  In the
first detection pass, mark the beginning of each jump table so the
second pass can tell where one ends and the next one begins.

Fixes the following warnings:

  vmlinux.o: warning: objtool: SiS_GetCRT2Ptr+0x1ad: stack state mismatch: cfa1=4+8 cfa2=5+16
  sound/core/seq/snd-seq.o: warning: objtool: cc_ev_to_ump_midi2+0x589: return with modified stack frame

Fixes: be2f0b1e1264 ("objtool: Get rid of reloc->jump_table_start")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/141752fff614eab962dba6bdfaa54aa67ff03bba.1742852846.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503171547.LlCTJLQL-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202503200535.J3hAvcjw-lkp@intel.com/
tools/objtool/check.c
tools/objtool/elf.c
tools/objtool/include/objtool/elf.h