linux/tools/objtool
Josh Poimboeuf 8133fbb424 objtool: Fix false positive warnings for functions with multiple switch statements
Ingo reported [1] some false positive objtool warnings:

  drivers/net/wireless/realtek/rtlwifi/base.o: warning: objtool: rtlwifi_rate_mapping()+0x2e7: frame pointer state mismatch
  drivers/net/wireless/realtek/rtlwifi/base.o: warning: objtool: rtlwifi_rate_mapping()+0x2f3: frame pointer state mismatch
  ...

And so did the 0-day bot [2]:

  drivers/gpu/drm/radeon/cik.o: warning: objtool: cik_tiling_mode_table_init()+0x6ce: call without frame pointer save/setup
  drivers/gpu/drm/radeon/cik.o: warning: objtool: cik_tiling_mode_table_init()+0x72b: call without frame pointer save/setup
  ...

Both sets of warnings involve functions which have multiple switch
statements.  When there's more than one switch statement in a function,
objtool interprets all the switch jump tables as a single table.  If the
targets of one jump table assume a stack frame and the targets of
another one don't, it prints false positive warnings.

Fix the bug by detecting the size of each switch jump table.  For
multiple tables, each one ends where the next one begins.

[1] https://lkml.kernel.org/r/20160308103716.GA9618@gmail.com
[2] https://lists.01.org/pipermail/kbuild-all/2016-March/018124.html

Reported-by: Ingo Molnar <mingo@kernel.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Chris J Arges <chris.j.arges@canonical.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/2d7eecc6bc52d301f494b80f5fd62c2b6c895658.1457502970.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-03-09 10:48:09 +01:00
..
arch/x86 x86/asm/decoder: Use explicitly signed chars 2016-03-03 16:13:00 +01:00
Documentation objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
.gitignore objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
arch.h objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
Build objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
builtin-check.c objtool: Fix false positive warnings for functions with multiple switch statements 2016-03-09 10:48:09 +01:00
builtin.h objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
elf.c objtool: Rename some variables and functions 2016-03-09 10:48:09 +01:00
elf.h objtool: Rename some variables and functions 2016-03-09 10:48:09 +01:00
Makefile objtool: Compile with debugging symbols 2016-03-09 10:48:08 +01:00
objtool.c objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
special.c objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
special.h objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
warn.h objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00