linux-stable/tools/objtool
Nicholas Piggin cad90e5381 objtool: Tolerate STT_NOTYPE symbols at end of section
Hand-written asm often contains non-function symbols in executable
sections. _end symbols for finding the size of instruction blocks
for runtime processing is one such usage.

optprobe_template_end is one example that causes the warning:

  objtool: optprobe_template_end(): can't find starting instruction

This is because the symbol happens to be at the end of the file (and
therefore end of a section in the object file).

So ignore end-of-section STT_NOTYPE symbols instead of bailing out
because an instruction can't be found. While we're here, add a more
descriptive warning for STT_FUNC symbols found at the end of a
section.

[ This also solves a PowerPC regression reported by Sathvika Vasireddy. ]

Reported-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reported-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Sathvika Vasireddy <sv@linux.ibm.com>
Link: https://lore.kernel.org/r/20221220101323.3119939-1-npiggin@gmail.com
2023-01-09 17:53:46 +01:00
..
Documentation objtool: Update documentation 2022-04-22 12:32:05 +02:00
arch powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
include/objtool powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
.gitignore objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
Build objtool: Ditch subcommands 2022-04-22 12:32:01 +02:00
Makefile Kbuild updates for v5.19 2022-05-26 12:09:50 -07:00
builtin-check.c powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
check.c objtool: Tolerate STT_NOTYPE symbols at end of section 2023-01-09 17:53:46 +01:00
elf.c powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
objtool.c objtool: Add .call_sites section 2022-10-17 16:41:07 +02:00
orc_dump.c objtool: Use target file endianness instead of a compiled constant 2022-11-18 19:00:15 +11:00
orc_gen.c objtool: Use target file endianness instead of a compiled constant 2022-11-18 19:00:15 +11:00
special.c objtool: Use target file endianness instead of a compiled constant 2022-11-18 19:00:15 +11:00
sync-check.sh Merge branch 'x86/cpu' into WIP.x86/core, to merge the NOP changes & resolve a semantic conflict 2021-04-02 12:36:30 +02:00
weak.c objtool: Ditch subcommands 2022-04-22 12:32:01 +02:00