From 479488f5bf3a538fc2d558ead084e4fa0452816a Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Tue, 24 Nov 2020 14:40:13 +0000 Subject: [PATCH] ANDROID: modpost: Forbid double exports In the context of GKI we are exporting quite a few internal kernel symbols, some of which may be static functions (yes this is bad, but technically it works). As such, we need to be careful about conflicts and we really should not allow a symbol to be exported more than once. To ensure this is the case, turn the modpost check 'fatal' to bail out immediately when such a situation is detected. Bug: 174214891 Signed-off-by: Quentin Perret Change-Id: I674c9c9c327849503e94d79654e6288411a830af --- scripts/mod/modpost.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 70b0e825a139..c7501dcc6609 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -426,10 +426,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod, s = new_symbol(name, mod, export); } 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"); - return s; + fatal("%s: '%s' exported twice. Previous export was in %s%s\n", + mod->name, name, s->module->name, + s->module->is_vmlinux ? "" : ".ko"); } s->module = mod;