]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kbuild: compile constant module information only once
authorThomas Weißschuh <linux@weissschuh.net>
Sun, 1 Sep 2024 17:55:21 +0000 (19:55 +0200)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 Sep 2024 08:24:08 +0000 (17:24 +0900)
commitfdf94e4403ece60b29ef9e2da95e2fcefe50817f
treee3f2d66b1af83d665ee838b3fc045cd7d01eb6cd
parentcd615d7fcc7958107d1506c6eb5be50f4e920312
kbuild: compile constant module information only once

Various information about modules is compiled into the info sections.
For that a dedicated .mod.c file is generated by modpost for each module
and then linked into the module.
However most of the information in the .mod.c is the same for all
modules, internal and external.
Split the shared information into a dedicated source file that is
compiled once and then linked into all modules.

This avoids frequent rebuilds for all .mod.c files when using
CONFIG_LOCALVERSION_AUTO because the local version ends up in .mod.c
through UTS_RELEASE and VERMAGIC_STRING.
The modules are still relinked in this case.

The code is also easier to maintain as it's now in a proper source file
instead of an inline string literal.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/Makefile.modfinal
scripts/mod/modpost.c
scripts/module-common.c [new file with mode: 0644]