From nobody Thu Apr 30 09:28:45 2026 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 B0D71C433EF for ; Mon, 30 May 2022 12:55:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236220AbiE3Mzc (ORCPT ); Mon, 30 May 2022 08:55:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234887AbiE3Mz0 (ORCPT ); Mon, 30 May 2022 08:55:26 -0400 Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 357B1814AE; Mon, 30 May 2022 05:55:25 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-07.nifty.com with ESMTP id 24UCs1Mo014963; Mon, 30 May 2022 21:54:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 24UCs1Mo014963 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1653915242; bh=nFbsi2wc8vRk4e83EcKIAfJNJNh7XZcOJOriZZ5YswY=; h=From:To:Cc:Subject:Date:From; b=WKHqdJC2YlZLG5PQK6TBY7pTdkefEp/44KaN2lxwhgRJVv/h2As7D6lQ9h2lFZDVg mekXWbWnQfgxacjwk3hx24M3QkIyqQkJSlHqHuL96QNW/oTcSBGaF9puMk7f35J3FE mSfqJ52XOMTrlfpddH+YuU797GBnNeNqpHEVDWt06NucHHTM1WrfFKjGNeSsdAnkVm faBZy/r1UX+ICaCJdzSfwKhu+8JxzcLK/BcRaGcWyfwr98rPT/5AhO5UqNktVdWpuO TkXVPT9f1KnTlXftcYxPamtk7D3sANxtpaLNYcxW5F2o4KgyTF+JN5C8VgDxesg6x3 D/8xbBwgk0V+g== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Alessio Igor Bogani , Michal Marek , Nick Desaulniers , Rusty Russell Subject: [PATCH] modpost: fix section mismatch check for exported init/exit sections Date: Mon, 30 May 2022 21:52:58 +0900 Message-Id: <20220530125258.3149370-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit f02e8a6596b7 ("module: Sort exported symbols"), EXPORT_SYMBOL is placed in the individual section ___ksymtab(_gpl)+ (3 leading underscores, not 2). Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL and __init/__exit. Fix the .fromsec to ___ksymtab*. Fixes: f02e8a6596b7 ("module: Sort exported symbols") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 29d5a841e215..620dc8c4c814 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -980,7 +980,7 @@ static const struct sectioncheck sectioncheck[] =3D { }, /* Do not export init/exit functions or data */ { - .fromsec =3D { "__ksymtab*", NULL }, + .fromsec =3D { "___ksymtab*", NULL }, .bad_tosec =3D { INIT_SECTIONS, EXIT_SECTIONS, NULL }, .mismatch =3D EXPORT_TO_INIT_EXIT, .symbol_white_list =3D { DEFAULT_SYMBOL_WHITE_LIST, NULL }, --=20 2.32.0