]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Fix seg fault with Clang non-section symbols
authorJosh Poimboeuf <jpoimboe@redhat.com>
Mon, 14 Dec 2020 22:04:20 +0000 (16:04 -0600)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 16 Dec 2020 13:35:46 +0000 (14:35 +0100)
commit07da7eedcbf6b19c7d75fe86126a4135a25812ce
treecd4c8503c23c827428d30337e9427cdb64d36b26
parent7c22cdbcb753579a90a24b1dee4b784c8a72a71b
objtool: Fix seg fault with Clang non-section symbols

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:

  0b7865394765 ("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
tools/objtool/check.c
tools/objtool/elf.c
tools/objtool/elf.h
tools/objtool/orc_gen.c