diff options
| author | Lorenzo Stoakes (ARM) <ljs@kernel.org> | 2026-09-23 18:17:55 +0100 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-09-26 00:16:35 +0100 |
| commit | 8050568e0a46f944117970c3969f9316125bc34d (patch) | |
| tree | 0d1dc08c1c279bf1a867aff6e4a2c3b77e9857a7 /tools/lib/python/kdoc/parse_data_structs.py | |
| parent | c2970d8b52d132bf5152fba592205a2204d7be5a (diff) | |
| download | linux-next-8050568e0a46f944117970c3969f9316125bc34d.tar.gz linux-next-8050568e0a46f944117970c3969f9316125bc34d.zip | |
kbuild: only emit vmlinux relocations when required
A kernel build consists of more than one linking pass on vmlinux.o and
vmlinux, at minimum two, and with CONFIG_KALLSYMS and BTF enabled on x86-64
for example there are 5 such stages.
For architectures that build their own relocation tables (x86, riscv, mips,
s390), vmlinux is linked with the --emit-relocs parameter specified.
However, this is only required on the final vmlinux link.
Symbol tables of trial links preceding it don't need it because they
already check that System.map matches kallsyms symbols on each build.
GNU ld is slow at emitting relocation tables, so this results in a
reduction in build time.
Whole build, 128-thread Threadripper 9980X, best of N runs:
before after delta
-------------------------------
x86 defconfig, touch mm/vma.c, gcc 9.5s 9.1s -0.42s (-4%)
x86 defconfig, clean, gcc 30.1s 29.5s -0.59s (-2%)
x86 allmodconfig, touch mm/vma.c, gcc 37.2s 35.8s -1.4s (-4%)
Note that this has little impact on LLVM ld which performs this operation
more efficiently.
Assisted-by: LLM
Reviewed-by: Nicolas Schier <n.schier@fritz.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Link: https://patch.msgid.link/20260923-build-speedup-v4-6-73128809a4a4@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/parse_data_structs.py')
0 files changed, 0 insertions, 0 deletions
