remarkable-linux/tools
Josh Poimboeuf 7e578441a4 objtool: Add workaround for GCC switch jump table bug
GCC has a rare quirk, currently only seen in three driver functions in
the kernel, and only with certain obscure non-distro configs, which can
cause objtool to produce "unreachable instruction" false positive
warnings.

As part of an optimization, GCC makes a copy of an existing switch jump
table, modifies it, and then hard-codes the jump (albeit with an
indirect jump) to use a single entry in the table.  The rest of the jump
table and some of its jump targets remain as dead code.

In such a case we can just crudely ignore all unreachable instruction
warnings for the entire object file.  Ideally we would just ignore them
for the function, but that would require redesigning the code quite a
bit.  And honestly that's just not worth doing: unreachable instruction
warnings are of questionable value anyway, and this is a very rare
issue.

kbuild reports:

  https://lkml.kernel.org/r/201603231906.LWcVUpxm%25fengguang.wu@intel.com
  https://lkml.kernel.org/r/201603271114.K9i45biy%25fengguang.wu@intel.com
  https://lkml.kernel.org/r/201603291058.zuJ6ben1%25fengguang.wu@intel.com

GCC bug:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70604

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/700fa029bbb0feff34f03ffc69d666a3c3b57a61.1460663532.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-04-15 11:42:13 +02:00
..
arch
build tools build: Use .s extension for preprocessed assembler code 2016-03-03 11:10:37 -03:00
cgroup
firewire
gpio
hv
iio
include Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-24 10:02:14 -07:00
laptop/freefall
lguest
lib tools/lib/lockdep: Fix unsupported 'basename -s' in run_tests.sh 2016-03-30 12:45:56 +02:00
net
nfsd
objtool objtool: Add workaround for GCC switch jump table bug 2016-04-15 11:42:13 +02:00
perf Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-04-03 07:22:12 -05:00
power Merge branches 'pm-core', 'powercap' and 'pm-tools' 2016-04-08 21:46:56 +02:00
scripts tools: Move utilities.mak from perf to tools/scripts/ 2016-03-18 13:57:20 -03:00
spi
testing selftest/seccomp: Fix the seccomp(2) signature 2016-03-29 13:01:36 -06:00
thermal/tmon
time
usb
virtio virtio_ring: Support DMA APIs 2016-03-02 17:01:57 +02:00
vm tools/vm/page-types.c: avoid memset() in walk_pfn() when count == 1 2016-03-17 15:09:34 -07:00
Makefile Merge branch 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 18:23:21 -07:00