linux/tools/objtool
Josh Poimboeuf b1547d3101 objtool: Detect falling through to the next function
There are several cases in compiled C code where a function may not
return at the end, and may instead fall through to the next function.

That may indicate a bug in the code, or a gcc bug, or even an objtool
bug.  But in each case, objtool reports an unhelpful warning, something
like:

  drivers/scsi/qla2xxx/qla_attr.o: warning: objtool: qla2x00_get_fc_host_stats()+0x0: duplicate frame pointer save
  drivers/scsi/qla2xxx/qla_attr.o: warning: objtool: qla2x00_get_fc_host_stats()+0x0: frame pointer state mismatch

Detect this situation and print a more useful error message:

  drivers/scsi/qla2xxx/qla_attr.o: warning: objtool: qla2x00_get_host_fabric_name() falls through to next function qla2x00_get_starget_node_name()

Also add some information about this warning and its potential causes to
the documentation.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@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/caa4ec6c687931db805e692d4e4bf06cd87d33e6.1460729697.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-04-16 11:14:17 +02:00
..
arch/x86 x86/asm/decoder: Use explicitly signed chars 2016-03-03 16:13:00 +01:00
Documentation objtool: Detect falling through to the next function 2016-04-16 11:14:17 +02: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: Detect falling through to the next function 2016-04-16 11:14:17 +02:00
builtin.h objtool: Add tool to perform compile-time stack metadata validation 2016-02-29 08:35:12 +01:00
elf.c objtool: Add several performance improvements 2016-03-09 10:48:10 +01:00
elf.h objtool: Add several performance improvements 2016-03-09 10:48:10 +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