linux/tools/objtool
Josh Poimboeuf 5c51f4ae84 objtool: Fix another GCC jump table detection issue
Arnd Bergmann reported a (false positive) objtool warning:

  drivers/infiniband/sw/rxe/rxe_resp.o: warning: objtool: rxe_responder()+0xfe: sibling call from callable instruction with changed frame pointer

The issue is in find_switch_table().  It tries to find a switch
statement's jump table by walking backwards from an indirect jump
instruction, looking for a relocation to the .rodata section.  In this
case it stopped walking prematurely: the first .rodata relocation it
encountered was for a variable (resp_state_name) instead of a jump
table, so it just assumed there wasn't a jump table.

The fix is to ignore any .rodata relocation which refers to an ELF
object symbol.  This works because the jump tables are anonymous and
have no symbols associated with them.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 3732710ff6 ("objtool: Improve rare switch jump table pattern detection")
Link: http://lkml.kernel.org/r/20170302225723.3ndbsnl4hkqbne7a@treble
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-07 08:42:55 +01:00
..
arch/x86 objtool: Improve detection of BUG() and other dead ends 2017-02-24 09:10:52 +01:00
Documentation objtool: Detect falling through to the next function 2016-04-16 11:14:17 +02:00
.gitignore objtool: Add 'fixdep' to objtool/.gitignore 2016-07-27 11:07:11 +02:00
arch.h objtool: Improve detection of BUG() and other dead ends 2017-02-24 09:10:52 +01:00
Build tools build: Fix objtool build with ARCH=x86_64 2016-07-22 16:37:44 -03:00
builtin-check.c objtool: Fix another GCC jump table detection issue 2017-03-07 08:42:55 +01:00
builtin.h
elf.c objtool: Fix another GCC jump table detection issue 2017-03-07 08:42:55 +01:00
elf.h objtool: Fix another GCC jump table detection issue 2017-03-07 08:42:55 +01:00
Makefile make use of make variable CURDIR instead of calling pwd 2016-12-11 12:12:56 +01:00
objtool.c
special.c
special.h
warn.h