]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: lto: add a default list of used symbols
authorSami Tolvanen <samitolvanen@google.com>
Fri, 11 Dec 2020 18:46:23 +0000 (10:46 -0800)
committerKees Cook <keescook@chromium.org>
Thu, 14 Jan 2021 16:21:09 +0000 (08:21 -0800)
commitddbf5da454681dd1237884f53b1eb9e5f5511814
tree298965a7f44d326039861efb9a197839da21cc86
parent9e2110dc8a190bbe9bd4a6ea87d7e9771c3e2d44
kbuild: lto: add a default list of used symbols

With CONFIG_LTO_CLANG, LLVM bitcode has not yet been compiled into a
binary when the .mod files are generated, which means they don't yet
contain references to certain symbols that will be present in the final
binaries. This includes intrinsic functions, such as memcpy, memmove,
and memset [1], and stack protector symbols [2]. This change adds a
default symbol list to use with CONFIG_TRIM_UNUSED_KSYMS when Clang's
LTO is used.

[1] https://llvm.org/docs/LangRef.html#standard-c-c-library-intrinsics
[2] https://llvm.org/docs/LangRef.html#llvm-stackprotector-intrinsic

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20201211184633.3213045-7-samitolvanen@google.com
init/Kconfig
scripts/lto-used-symbollist.txt [new file with mode: 0644]