]> www.infradead.org Git - nvme.git/commit
modpost: distinguish same module paths from different dump files
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 12 Dec 2024 15:46:15 +0000 (00:46 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 21 Dec 2024 03:42:10 +0000 (12:42 +0900)
commit9435dc77a33fa20afec7cd35ceaae5f7f42dbbe2
tree5accec61e47581deaf44034f77d5be31e5eccf29
parent54956567a055345d17438f08c895c68aff3f4cf2
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>
scripts/mod/modpost.c
scripts/mod/modpost.h