linux-stable/tools/objtool
Josh Poimboeuf 2b02985bf8 objtool: Fix seg fault with Clang non-section symbols
commit 44f6a7c075 upstream.

The Clang assembler likes to strip section symbols, which means objtool
can't reference some text code by its section.  This confuses objtool
greatly, causing it to seg fault.

The fix is similar to what was done before, for ORC reloc generation:

  e81e072443 ("objtool: Support Clang non-section symbols in ORC generation")

Factor out that code into a common helper and use it for static call
reloc generation as well.

Reported-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Link: https://github.com/ClangBuiltLinux/linux/issues/1207
Link: https://lkml.kernel.org/r/ba6b6c0f0dd5acbba66e403955a967d9fdd1726a.1607983452.git.jpoimboe@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 11:02:20 +01:00
..
arch/x86 objtool: Decode unwind hint register depending on architecture 2020-09-10 10:43:13 -05:00
Documentation objtool: Add support for intra-function calls 2020-04-30 20:14:33 +02:00
.gitignore
arch.h objtool: Decode unwind hint register depending on architecture 2020-09-10 10:43:13 -05:00
Build objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin-check.c objtool: Move ORC logic out of check() 2020-09-01 17:19:11 -05:00
builtin-orc.c objtool: Move ORC logic out of check() 2020-09-01 17:19:11 -05:00
builtin.h objtool: Implement noinstr validation 2020-04-22 10:53:50 +02:00
cfi.h objtool: Fix !CFI insn_state propagation 2020-04-22 10:53:50 +02:00
check.c objtool: Fix seg fault with Clang non-section symbols 2021-02-17 11:02:20 +01:00
check.h objtool: Refactor jump table code to support other architectures 2020-09-10 10:43:13 -05:00
elf.c objtool: Fix seg fault with Clang non-section symbols 2021-02-17 11:02:20 +01:00
elf.h objtool: Fix seg fault with Clang non-section symbols 2021-02-17 11:02:20 +01:00
Makefile tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:55:19 +01:00
objtool.c objtool: Move object file loading out of check() 2020-09-01 17:19:07 -05:00
objtool.h objtool: Abstract alternative special case handling 2020-09-10 10:43:13 -05:00
orc_dump.c objtool: Make unwind hint definitions available to other architectures 2020-09-10 10:43:13 -05:00
orc_gen.c objtool: Fix seg fault with Clang non-section symbols 2021-02-17 11:02:20 +01:00
special.c objtool: Abstract alternative special case handling 2020-09-10 10:43:13 -05:00
special.h objtool: Refactor jump table code to support other architectures 2020-09-10 10:43:13 -05:00
sync-check.sh objtool: Make unwind hint definitions available to other architectures 2020-09-10 10:43:13 -05:00
warn.h objtool: Rename find_containing_func() 2020-03-25 18:28:29 +01:00
weak.c objtool: Abstract alternative special case handling 2020-09-10 10:43:13 -05:00