On Mon, Aug 18, 2025 at 06:55:00PM +0200, Alexey Gladkov wrote:
> At this point, if a symbol is compiled as part of the kernel,
> information about which module the symbol belongs to is lost.
>
> To save this it is possible to add the module name to the alias name.
> It's not very pretty, but it's possible for now.
>
> Cc: Miguel Ojeda <[email protected]>
> Cc: Andreas Hindborg <[email protected]>
> Cc: Danilo Krummrich <[email protected]>
> Cc: Alex Gaynor <[email protected]>
> Cc: [email protected]
> Signed-off-by: Alexey Gladkov <[email protected]>
> Acked-by: Danilo Krummrich <[email protected]>
> ---
> include/linux/module.h | 14 +++++++++++++-
> rust/kernel/device_id.rs | 8 ++++----
> scripts/mod/file2alias.c | 18 ++++++++++++++----
> 3 files changed, 31 insertions(+), 9 deletions(-)
>
...
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 00586119a25b7..13021266a18f8 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -1476,8 +1476,8 @@ void handle_moddevtable(struct module *mod, struct
> elf_info *info,
> {
> void *symval;
> char *zeros = NULL;
> - const char *type, *name;
> - size_t typelen;
> + const char *type, *name, *modname;
> + size_t typelen, modnamelen;
when applying the patch-set onto kbuild-next, gcc refuses to build this patch
(this possibly killing future bisecting):
../scripts/mod/file2alias.c: In function ‘handle_moddevtable’:
../scripts/mod/file2alias.c:1480:25: error: variable ‘modnamelen’ set but not
used [-Werror=unused-but-set-variable]
1480 | size_t typelen, modnamelen;
| ^~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [../scripts/Makefile.host:131: scripts/mod/file2alias.o] Error
(-Werror is on for userprogs, since commit
27758d8c2583d10472b745a43ff86fef96c11ef7)
Introduction of modnamelen has to be moved to the next patch.
Kind regards
Nicolas