kallsyms: strip ThinLTO hashes from static functions
authorSami Tolvanen <samitolvanen@google.com>
Thu, 8 Apr 2021 18:28:32 +0000 (11:28 -0700)
committerKees Cook <keescook@chromium.org>
Thu, 8 Apr 2021 23:04:21 +0000 (16:04 -0700)
commit8b8e6b5d3b013b0bd849990af2cc0f1321850e19
tree23d1a7b49ecee44653278a2567f2ebf4ad382d45
parent0a5b412891dfdc72eb86fcd640fe1296a4cfa9ae
kallsyms: strip ThinLTO hashes from static functions

With CONFIG_CFI_CLANG and ThinLTO, Clang appends a hash to the names
of all static functions not marked __used. This can break userspace
tools that don't expect the function name to change, so strip out the
hash from the output.

Suggested-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210408182843.1754385-8-samitolvanen@google.com
kernel/kallsyms.c