modpost: Produce extended MODVERSIONS information

Generate both the existing modversions format and the new extended one
when running modpost. Presence of this metadata in the final .ko is
guarded by CONFIG_EXTENDED_MODVERSIONS.

We no longer generate an error on long symbols in modpost if
CONFIG_EXTENDED_MODVERSIONS is set, as they can now be appropriately
encoded in the extended section. These symbols will be skipped in the
previous encoding. An error will still be generated if
CONFIG_EXTENDED_MODVERSIONS is not set.

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Matthew Maurer <mmaurer@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
Matthew Maurer
2025-01-03 17:37:02 +00:00
committed by Masahiro Yamada
parent 54ac1ac8ed
commit fc7d5e3210
3 changed files with 69 additions and 4 deletions

View File

@@ -207,6 +207,16 @@ config ASM_MODVERSIONS
assembly. This can be enabled only when the target architecture
supports it.
config EXTENDED_MODVERSIONS
bool "Extended Module Versioning Support"
depends on MODVERSIONS
help
This enables extended MODVERSIONs support, allowing long symbol
names to be versioned.
The most likely reason you would enable this is to enable Rust
support. If unsure, say N.
config MODULE_SRCVERSION_ALL
bool "Source checksum for all modules"
help