From patchwork Fri Jun 10 18:32:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12877911 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 2CE55C433EF for ; Fri, 10 Jun 2022 18:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346713AbiFJSeu (ORCPT ); Fri, 10 Jun 2022 14:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349791AbiFJSeh (ORCPT ); Fri, 10 Jun 2022 14:34:37 -0400 Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3FF3A1A3; Fri, 10 Jun 2022 11:34:35 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-12.nifty.com with ESMTP id 25AIX5TM020882; Sat, 11 Jun 2022 03:33:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com 25AIX5TM020882 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654885987; bh=dWrkbZ/zCsAQbt1ylsfirph76FCDu7eUxy+/dh5/pjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EKhRJEaK3gX99ziov/rjxAhmo76ZnId9lzn3GpSIVc9AK8OtHMiqQlPqRY40Pll4s wPGEtZv/GV70FNdJiqwh3lmynNvSm0E9xw0JWIqYuZ5G/Nitx5ImpaWkpMy/SNwCuu fgIptFOsTMpS7zg0mm5qo19VSDSOLLICqmTAz6eJ/TKufDm1ReBHEh4Ks4qMtgfRKb +lVoSCyxyjesKMHD760+vQ7DQ8tz4LkG5iQsoUaCcPn4vSIfndOU3RN9u/kLRy9R/3 NsCKJl97GxHzhgDQF7Sv3Oj9zAW8OtcQVEieSvGoP32j2EOJs9sFsE8tYvwF4zgWDY N7ouJ1/AOlGFg== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Al Viro , Nicolas Pitre , Luis Chamberlain , linux-modules@vger.kernel.org, Ard Biesheuvel , Masahiro Yamada , Nick Desaulniers , Alessio Igor Bogani , Michal Marek , Rusty Russell , linux-kernel@vger.kernel.org Subject: [PATCH 1/7] modpost: fix section mismatch check for exported init/exit sections Date: Sat, 11 Jun 2022 03:32:30 +0900 Message-Id: <20220610183236.1272216-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220610183236.1272216-1-masahiroy@kernel.org> References: <20220610183236.1272216-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: Since commit f02e8a6596b7 ("module: Sort exported symbols"), EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+ (3 leading underscores instead of 2). Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL and __init/__exit. Fix the .fromsec field. 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[] = { }, /* Do not export init/exit functions or data */ { - .fromsec = { "__ksymtab*", NULL }, + .fromsec = { "___ksymtab*", NULL }, .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL }, .mismatch = EXPORT_TO_INIT_EXIT, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },