]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Fix __mcount_loc generation with Clang's assembler
authorSami Tolvanen <samitolvanen@google.com>
Wed, 28 Oct 2020 17:16:26 +0000 (10:16 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 23 Feb 2021 20:46:56 +0000 (12:46 -0800)
commit2403ca60f77dd71aadcb328bcddeb86a801a3247
treed7ea195c1f2189a7655ccb1755175eb05ea2dd71
parentee0181f5bbf6403669559871291501faf2249be7
objtool: Fix __mcount_loc generation with Clang's assembler

When objtool generates relocations for the __mcount_loc section, it
tries to reference __fentry__ calls by their section symbol offset.
However, this fails with Clang's integrated assembler as it may not
generate section symbols for every section. This patch looks up a
function symbol instead if the section symbol is missing, similarly
to commit 55bea6d0c39b ("objtool: Support Clang non-section symbols
in ORC generation").

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
tools/objtool/check.c