From patchwork Sun Apr 24 19:08:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12825054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B1AFC433EF for ; Sun, 24 Apr 2022 19:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237850AbiDXTNr (ORCPT ); Sun, 24 Apr 2022 15:13:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238020AbiDXTNn (ORCPT ); Sun, 24 Apr 2022 15:13:43 -0400 Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF0B45FAE; Sun, 24 Apr 2022 12:10:12 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-10.nifty.com with ESMTP id 23OJ8o6A019069; Mon, 25 Apr 2022 04:09:01 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 23OJ8o6A019069 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1650827341; bh=q+sI2WvI+q2i6npMbfWAUGCdZca075FjNBQd8rvxMKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yuf2lqYWKVrxOfsTQbDa1MGht18VKIAX93EkPFO8/RH2HayipBCbouFBwt7oPBDLh tVm7Gc3oCiSccuo8IxX1MWUqtFmU1NsnR5XFZ0yV2/zQvMXBzMlzRm59LpKSNLP+so UiDyVpSC0LfDybVmkmPD4cPLLwLJp9NWIOM0GaNyl9sK/Nay007hKEVK9nrpQCRCm4 ReJKoHMM4SWoG65JG0ChY6xRkqbgBX4bvz2QNv81lM+7t1hTZFubiwHcUA2JoyD6cz LE97/3tswoKrb9SIDUPuECB1lO982vslo+wjBOYW1cstQN/V1Wh7Lbx1cDkRP5xOUW IcXBzPuBBD3PQ== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Nick Desaulniers Subject: [PATCH 16/27] modpost: make multiple export error Date: Mon, 25 Apr 2022 04:08:00 +0900 Message-Id: <20220424190811.1678416-17-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220424190811.1678416-1-masahiroy@kernel.org> References: <20220424190811.1678416-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 14044cd94aaa..73f0b98e3b5a 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -411,9 +411,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; }