]> git.baikalelectronics.ru Git - kernel.git/commit
modpost: make multiple export error
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 1 May 2022 08:40:17 +0000 (17:40 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 May 2022 18:17:01 +0000 (03:17 +0900)
commitc2e6302106a95443b26f89e23141ddf463a26f2e
treeaf47666603ca950d6e9fa5be4a96c296c77c6781
parenta9d22c0ea73c6407a19719daaf7264b98dab6b0c
modpost: make multiple export error

This is currently a warning, but I think modpost should stop building
in this case.

If the same symbol is exported multiple times and we let it keep going,
the sanity check becomes difficult.

Only the legitimate case is that an external module overrides the
corresponding in-tree module to provide a different implementation
with the same interface.

Also, there exists an upstream example that exploits this feature.

  $ make M=tools/testing/nvdimm

... builds tools/testing/nvdimm/libnvdimm.ko. This is a mocked module
that overrides the symbols from drivers/nvdimm/libnvdimm.ko.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/mod/modpost.c