]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 22 Jun 2020 20:22:44 +0000 (17:22 -0300)
commita2f638295f55674d923318906daa54fc978ade56
treea4fc9c4d89474020220eb1c21d723d1d7e04e6f9
parent5c69616d60fea24909469a64f725c3427a9f5c33
kbuild: Remove debug info from kallsyms linking

BugLink: https://bugs.launchpad.net/bugs/1881178
[ Upstream commit af73d78bd384aa9b8789aa6e7ddbb165f971276f ]

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
8959e39272d6 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
scripts/link-vmlinux.sh