diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-12-12 16:46:15 +0100 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-12-21 04:42:10 +0100 |
commit | 9435dc77a33fa20afec7cd35ceaae5f7f42dbbe2 (patch) | |
tree | 5accec61e47581deaf44034f77d5be31e5eccf29 /scripts/mod/modpost.h | |
parent | kbuild: deb-pkg: Do not install maint scripts for arch 'um' (diff) | |
download | linux-9435dc77a33fa20afec7cd35ceaae5f7f42dbbe2.tar.xz linux-9435dc77a33fa20afec7cd35ceaae5f7f42dbbe2.zip |
modpost: distinguish same module paths from different dump files
Since commit 13b25489b6f8 ("kbuild: change working directory to external
module directory with M="), module paths are always relative to the top
of the external module tree.
The module paths recorded in Module.symvers are no longer globally unique
when they are passed via KBUILD_EXTRA_SYMBOLS for building other external
modules, which may result in false-positive "exported twice" errors.
Such errors should not occur because external modules should be able to
override in-tree modules.
To address this, record the dump file path in struct module and check it
when searching for a module.
Fixes: 13b25489b6f8 ("kbuild: change working directory to external module directory with M=")
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Closes: https://lore.kernel.org/all/eb21a546-a19c-40df-b821-bbba80f19a3d@nvidia.com/
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Diffstat (limited to 'scripts/mod/modpost.h')
-rw-r--r-- | scripts/mod/modpost.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 49848fcbe2a1..8b72c227ebf4 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -95,14 +95,15 @@ struct module_alias { /** * struct module - represent a module (vmlinux or *.ko) * + * @dump_file: path to the .symvers file if loaded from a file * @aliases: list head for module_aliases */ struct module { struct list_head list; struct list_head exported_symbols; struct list_head unresolved_symbols; + const char *dump_file; bool is_gpl_compatible; - bool from_dump; /* true if module was loaded from *.symvers */ bool is_vmlinux; bool seen; bool has_init; |