diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2022-05-01 10:40:17 +0200 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2022-05-07 20:17:01 +0200 |
commit | b8422711080f57cdf9fb1c0cb8683a2112bed27c (patch) | |
tree | af47666603ca950d6e9fa5be4a96c296c77c6781 /scripts/mod | |
parent | modpost: dump Module.symvers in the same order of modules.order (diff) | |
download | linux-b8422711080f57cdf9fb1c0cb8683a2112bed27c.tar.xz linux-b8422711080f57cdf9fb1c0cb8683a2112bed27c.zip |
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>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/modpost.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index cdd9098b6035..841f69475247 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -417,9 +417,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod, list_add_tail(&s->list, &mod->exported_symbols); } else if (!external_module || s->module->is_vmlinux || s->module == mod) { - warn("%s: '%s' exported twice. Previous export was in %s%s\n", - mod->name, name, s->module->name, - s->module->is_vmlinux ? "" : ".ko"); + error("%s: '%s' exported twice. Previous export was in %s%s\n", + mod->name, name, s->module->name, + s->module->is_vmlinux ? "" : ".ko"); return s; } |