]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: Remove debug info from kallsyms linking
authorKees Cook <keescook@chromium.org>
Wed, 4 Mar 2020 02:18:34 +0000 (18:18 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 4 Mar 2020 17:36:33 +0000 (18:36 +0100)
commit814af903206855540eca2ed9f486a2a71730258e
tree9fa6615db19920fb595e45cd9abdf69b53ee764f
parentde8a4872dacfc2bf46e95a48d65a7921882ded11
kbuild: Remove debug info from kallsyms linking

When CONFIG_DEBUG_INFO is enabled, the two kallsyms linking steps spend
time collecting and writing the dwarf sections to the temporary output
files. kallsyms does not need this information, and leaving it off
halves their linking time. This is especially noticeable without
CONFIG_DEBUG_INFO_REDUCED. The BTF linking stage, however, does still
need those details.

Refactor the BTF and kallsyms generation stages slightly for more
regularized temporary names. Skip debug during kallsyms links.
Additionally move "info BTF" to the correct place since commit
1272a900deb6 ("kbuild: Parameterize kallsyms generation and correct
reporting"), which added "info LD ..." to vmlinux_link calls.

For a full debug info build with BTF, my link time goes from 1m06s to
0m54s, saving about 12 seconds, or 18%.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/202003031814.4AEA3351@keescook
scripts/link-vmlinux.sh