From patchwork Sun Oct 22 17:06:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432006 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 B55C3CDB474 for ; Sun, 22 Oct 2023 17:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbjJVRGU (ORCPT ); Sun, 22 Oct 2023 13:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjJVRGT (ORCPT ); Sun, 22 Oct 2023 13:06:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E49C1FB; Sun, 22 Oct 2023 10:06:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 743BDC433C7; Sun, 22 Oct 2023 17:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994377; bh=aafAL1hrhWdQi1r3hDDC/LTfTORpY13U/ijFZlOIkXo=; h=From:To:Cc:Subject:Date:From; b=GGsSETCiO1sWlJyEge9UTMZajZsjLRU7NUc/l1QFzTfJ0jg/mS+fPr39UsZ7bTQ2B 9cCxIY38FI/JruLFAx/wKsGVOh10xsjjZ6jEH0p3rd06B/cHCJSfNJ1mD0klFYcXYn hsT5ascr+XOHofPof3/7XC7tNPfjlrBKx833mnD40YRCfgmC9XgR7/dGo8nSKe2wZL arKNosxPadGHPAXWkdq8VlZ0LfxjybPyBBZUo1IHl9GjzS0vqxTQIoCIpIVJfr0ObU g0oPJpgDN0vd+LksDTLyZmC4Cv4YvPlEUJ+JO0ZDQcKFTKLYFc7L7V/h/QjJk27YKI J3eYnwmKMG83Q== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 01/10] modpost: remove ALL_EXIT_DATA_SECTIONS macro Date: Mon, 23 Oct 2023 02:06:04 +0900 Message-Id: <20231022170613.2072838-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org This is unused. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index f1f658122ad8..d936fa5fbbb1 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -794,8 +794,6 @@ static void check_section(const char *modname, struct elf_info *elf, #define ALL_INIT_DATA_SECTIONS \ ".init.setup", ".init.rodata", ".meminit.rodata", \ ".init.data", ".meminit.data" -#define ALL_EXIT_DATA_SECTIONS \ - ".exit.data", ".memexit.data" #define ALL_INIT_TEXT_SECTIONS \ ".init.text", ".meminit.text" From patchwork Sun Oct 22 17:06:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432007 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 B356DC25B42 for ; Sun, 22 Oct 2023 17:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbjJVRGW (ORCPT ); Sun, 22 Oct 2023 13:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231945AbjJVRGV (ORCPT ); Sun, 22 Oct 2023 13:06:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2120FB; Sun, 22 Oct 2023 10:06:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1E73C433C9; Sun, 22 Oct 2023 17:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994379; bh=klj6Dt1O3IFnuEbVBaMKnEH5PHbcOOc8u9BRgE9Xcvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hyw36vLefLqO0h3tmBg7UjEL82jIdgaEdY5OErb/6CXJJExzrMvD4wUDCUixHNPwz olKshjs26T7uvDiORT8cgyKRqKgBCQdjG3CswB3qiOl0/AERGoYRwo35biBXbH+wqD GB0Cw0OGIaW9uCz5IaDLwbMf1LJHUXob4BuG+J2+97fcX0v7xt2DDoxBGLJopQN8Rs +pnG2Hn9juUA7/BUAEk7rt7jg/+/hHUWuX/cm2EeEjTHJv2ivMjEszJRmvWu9CrDfh HhFPdz0qa41rrFsEYDmaOTDc6pD/E+ESaYsUe17WKo89jX93o+ND4Ylmh4A6mHz3IW HuPLsUXuBsteA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-arch@vger.kernel.org Subject: [PATCH 02/10] linux/init: remove __memexit* annotations Date: Mon, 23 Oct 2023 02:06:05 +0900 Message-Id: <20231022170613.2072838-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org We have never used __memexit, __memexitdata, or __memexitconst. These were unneeded. Signed-off-by: Masahiro Yamada Acked-by: Arnd Bergmann --- include/asm-generic/vmlinux.lds.h | 6 ------ include/linux/init.h | 3 --- scripts/mod/modpost.c | 15 +++------------ 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 67d8dd2f1bde..bae0fe4d499b 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -356,7 +356,6 @@ *(.ref.data) \ *(.data..shared_aligned) /* percpu related */ \ MEM_KEEP(init.data*) \ - MEM_KEEP(exit.data*) \ *(.data.unlikely) \ __start_once = .; \ *(.data.once) \ @@ -521,7 +520,6 @@ __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ *(.ref.rodata) \ MEM_KEEP(init.rodata) \ - MEM_KEEP(exit.rodata) \ } \ \ /* Built-in module parameters. */ \ @@ -574,7 +572,6 @@ *(.ref.text) \ *(.text.asan.* .text.tsan.*) \ MEM_KEEP(init.text*) \ - MEM_KEEP(exit.text*) \ /* sched.text is aling to function alignment to secure we have same @@ -714,13 +711,10 @@ *(.exit.data .exit.data.*) \ *(.fini_array .fini_array.*) \ *(.dtors .dtors.*) \ - MEM_DISCARD(exit.data*) \ - MEM_DISCARD(exit.rodata*) #define EXIT_TEXT \ *(.exit.text) \ *(.text.exit) \ - MEM_DISCARD(exit.text) #define EXIT_CALL \ *(.exitcall.exit) diff --git a/include/linux/init.h b/include/linux/init.h index 266c3e1640d4..01b52c9c7526 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -89,9 +89,6 @@ __latent_entropy #define __meminitdata __section(".meminit.data") #define __meminitconst __section(".meminit.rodata") -#define __memexit __section(".memexit.text") __exitused __cold notrace -#define __memexitdata __section(".memexit.data") -#define __memexitconst __section(".memexit.rodata") /* For assembly routines */ #define __HEAD .section ".head.text","ax" diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index d936fa5fbbb1..bcc334b28a2c 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -798,7 +798,7 @@ static void check_section(const char *modname, struct elf_info *elf, #define ALL_INIT_TEXT_SECTIONS \ ".init.text", ".meminit.text" #define ALL_EXIT_TEXT_SECTIONS \ - ".exit.text", ".memexit.text" + ".exit.text" #define ALL_PCI_INIT_SECTIONS \ ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \ @@ -806,10 +806,9 @@ static void check_section(const char *modname, struct elf_info *elf, ".pci_fixup_resume_early", ".pci_fixup_suspend" #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS -#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS -#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS +#define ALL_EXIT_SECTIONS EXIT_SECTIONS #define DATA_SECTIONS ".data", ".data.rel" #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ @@ -822,7 +821,6 @@ static void check_section(const char *modname, struct elf_info *elf, #define MEM_INIT_SECTIONS ".meminit.*" #define EXIT_SECTIONS ".exit.*" -#define MEM_EXIT_SECTIONS ".memexit.*" #define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \ TEXT_SECTIONS, OTHER_TEXT_SECTIONS @@ -832,7 +830,6 @@ enum mismatch { DATA_TO_ANY_INIT, TEXTDATA_TO_ANY_EXIT, XXXINIT_TO_SOME_INIT, - XXXEXIT_TO_SOME_EXIT, ANY_INIT_TO_ANY_EXIT, ANY_EXIT_TO_ANY_INIT, EXTABLE_TO_NON_TEXT, @@ -883,12 +880,6 @@ static const struct sectioncheck sectioncheck[] = { .bad_tosec = { INIT_SECTIONS, NULL }, .mismatch = XXXINIT_TO_SOME_INIT, }, -/* Do not reference exit code/data from memexit code/data */ -{ - .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, - .bad_tosec = { EXIT_SECTIONS, NULL }, - .mismatch = XXXEXIT_TO_SOME_EXIT, -}, /* Do not use exit code/data from init code */ { .fromsec = { ALL_INIT_SECTIONS, NULL }, @@ -1017,7 +1008,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, /* symbols in data sections that may refer to meminit sections */ if (match(fromsec, PATTERNS(DATA_SECTIONS)) && - match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) && + match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) && match(fromsym, PATTERNS("*driver"))) return 0; From patchwork Sun Oct 22 17:06:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432008 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 846BAC25B43 for ; Sun, 22 Oct 2023 17:06:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232440AbjJVRGX (ORCPT ); Sun, 22 Oct 2023 13:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbjJVRGW (ORCPT ); Sun, 22 Oct 2023 13:06:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E465EE; Sun, 22 Oct 2023 10:06:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B20DEC433C7; Sun, 22 Oct 2023 17:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994380; bh=aTiLuP4Ust/jrgVbBMYTU3kLN1U+pxnaKRT4WTs91Ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jg1DbiRh1IPvX12jNdpnak/QyZ5ZFyN8mhTCC/tRkLBZJ7Zl6krum94admfzOjbF2 03KncXSoHzbgA10LiuocV6c9uwjMhSDExdWQsjEfoLbjxpoyY124uLqdHvGA9dPRYi asL6tVM7itdGLLRG8DYxhibwXqk6VZ3bPaZyEnClc8ZGCoQn6PEm7I+6SMJxiZGL+f GKR0NpucI7AguDOxFi5AJeTc3MvY8FNKZvBbP3kZtw9nUO5K4+yMZejfCKsGMf4hsT LfdWazAAiQJ2YSdQh3a283unvXZ/W3xKEXfddBEFnm7E7XAsRfRXbTbXRdLxf85Olo vY7j18pTmyHyQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 03/10] modpost: disallow *driver to reference .meminit* sections Date: Mon, 23 Oct 2023 02:06:06 +0900 Message-Id: <20231022170613.2072838-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Drivers must not reference .meminit* sections, which are discarded when CONFIG_MEMORY_HOTPLUG=n. The reason for whitelisting "*driver" in the section mismatch check was to allow drivers to reference symbols annotated as __devinit or __devexit that existed in the past. Those annotations were removed by the following commits: - 54b956b90360 ("Remove __dev* markings from init.h") - 92e9e6d1f984 ("modpost.c: Stop checking __dev* section mismatches") Remove the wrong whitelist. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index bcc334b28a2c..792ba9da0f27 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1006,12 +1006,6 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, "*_console"))) return 0; - /* symbols in data sections that may refer to meminit sections */ - if (match(fromsec, PATTERNS(DATA_SECTIONS)) && - match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) && - match(fromsym, PATTERNS("*driver"))) - return 0; - /* * symbols in data sections must not refer to .exit.*, but there are * quite a few offenders, so hide these unless for W=1 builds until From patchwork Sun Oct 22 17:06:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432010 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 0DFEBC00A8F for ; Sun, 22 Oct 2023 17:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbjJVRG3 (ORCPT ); Sun, 22 Oct 2023 13:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbjJVRGY (ORCPT ); Sun, 22 Oct 2023 13:06:24 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94C12FB; Sun, 22 Oct 2023 10:06:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D821C433CA; Sun, 22 Oct 2023 17:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994382; bh=G00Dlt7/+9AAm/4d72vjWHQ0YOge50oj8FKlMUxA+RA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GWMI3dwTmlLB7pQ/P42Bade2Cuizg1E1JsnKsllyP+YlusoaBdNMxTIf4+KT2hTSY M8AeCjBuBgi0FPTSof1ueeF10hGXsrQNuThfa7J87WV5+rJVuedcGMmdxTdmrFcTs5 +ehh4WVj+Nj+ztahCwj7Xcug3DdBL+kMf28D3UMVx6EMV7CBF77i98ShHR9QWfLB0s 8ydkYvD+Gri8fdtulve0MmUJjWllsyXAF1bchNyDeeNS6j1gZRR9Wp7cQz9S7kYchX wPyQifBOfmnWbCIHa1lrINvzzMKQ4KsCzo3SyiFERH6czkg9Wos6tWCv5WAXCdvrvp e/+X4sX+xQ8Xg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 04/10] modpost: remove more symbol patterns from the section check whitelist Date: Mon, 23 Oct 2023 02:06:07 +0900 Message-Id: <20231022170613.2072838-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org These symbol patterns were whitelisted to allow them to reference to functions with the old __devinit and __devexit annotations. We stopped doing this a long time ago, for example, commit 6f039790510f ("Drivers: scsi: remove __dev* attributes.") remove those annotations from the scsi drivers. Keep *_ops and *_console, otherwise they will really cause section mismatch warnings. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 792ba9da0f27..19b138664f75 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -997,13 +997,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, /* symbols in data sections that may refer to any init/exit sections */ if (match(fromsec, PATTERNS(DATA_SECTIONS)) && match(tosec, PATTERNS(ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS)) && - match(fromsym, PATTERNS("*_template", // scsi uses *_template a lot - "*_timer", // arm uses ops structures named _timer a lot - "*_sht", // scsi also used *_sht to some extent - "*_ops", - "*_probe", - "*_probe_one", - "*_console"))) + match(fromsym, PATTERNS("*_ops", "*_console"))) return 0; /* From patchwork Sun Oct 22 17:06:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432009 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 6A42DC001DF for ; Sun, 22 Oct 2023 17:06:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232511AbjJVRG2 (ORCPT ); Sun, 22 Oct 2023 13:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232473AbjJVRGZ (ORCPT ); Sun, 22 Oct 2023 13:06:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185F9124; Sun, 22 Oct 2023 10:06:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D55CC433C7; Sun, 22 Oct 2023 17:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994383; bh=mnjPdsDS3enDm6WXK4/X4WMDdmcRPpl/JrVaMfXuHA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+votQPOQvger1N5hYN7MOnDeOx47VZpkOSweEfnd691hHxUNuOevb15IZhg0jsIO s4XfHcHt8+f+SIhUZ4nA08sTKbS/QaQ4S3SjMQsSYsZ3v8ACdJ5Yb/iZYf9w1ULBzj Q2c2PorpNQ1c2GOMo0hyAwi6ySlPBdUbkzM8JVnwNVtsxewBt+AVbJ4lgTw9q0QBFR gmMdOqVhZ40SSzwMQDziRAlDyP6qdtejWvWhWyIFMVhMrtmPIzUiN8r66zpRWtjfHE j98xRRzdrNfqEQ9Afsc3/O6VQIgiuoR3EQDSnJLCEXgUP9K6zN0pZFaD6FwSu0OGpG QM6ZLG3jZhqhA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 05/10] modpost: remove MEM_INIT_SECTIONS macro Date: Mon, 23 Oct 2023 02:06:08 +0900 Message-Id: <20231022170613.2072838-5-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org ALL_XXXINIT_SECTIONS and MEM_INIT_SECTIONS are the same. Remove the latter. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 19b138664f75..626ab599eea2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -805,7 +805,7 @@ static void check_section(const char *modname, struct elf_info *elf, ".pci_fixup_enable", ".pci_fixup_resume", \ ".pci_fixup_resume_early", ".pci_fixup_suspend" -#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS +#define ALL_XXXINIT_SECTIONS ".meminit.*" #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS #define ALL_EXIT_SECTIONS EXIT_SECTIONS @@ -818,7 +818,6 @@ static void check_section(const char *modname, struct elf_info *elf, ".coldtext", ".softirqentry.text" #define INIT_SECTIONS ".init.*" -#define MEM_INIT_SECTIONS ".meminit.*" #define EXIT_SECTIONS ".exit.*" From patchwork Sun Oct 22 17:06:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432011 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 D7E52C25B42 for ; Sun, 22 Oct 2023 17:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232531AbjJVRGa (ORCPT ); Sun, 22 Oct 2023 13:06:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjJVRG1 (ORCPT ); Sun, 22 Oct 2023 13:06:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E205119; Sun, 22 Oct 2023 10:06:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AE55C433BB; Sun, 22 Oct 2023 17:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994385; bh=JGaUnTUZE4/t01Gqe9nbznjUqklvDlxx4Gf2S+Ki0Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MTY/zbtuzdasxDR9cQ0LmqDv4FTLNY6HGgn4Qym261RFNer3DIcCMu2+SQzeJs717 KWBYy/Pc9bVNrOExQBVDa4r00WPBK2ZAotcvwSu2Z/QsbmNXADt4OZsQYxCaPntqNw GaFXuRIvcf5mmZkUXNCayIVzNxKdfuHga8qzf+XccbVoK1ebJUCa0M2af0zYRlqR7Z uVhCguL/iJL2T4n9f8v77c91IfGDob5oz46yRFDu5O+ych2/GjUpreMUQxZUGJehSs tJ1Avsz3VEMgMHwjSaRVZRVwBuBPcgk2dnepot1fmndkw0BRqEpQeXffvzGI34Hygt RNMYcKRUU2qiA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 06/10] modpost: remove EXIT_SECTIONS macro Date: Mon, 23 Oct 2023 02:06:09 +0900 Message-Id: <20231022170613.2072838-6-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org ALL_EXIT_SECTIONS and EXIT_SECTIONS are the same. Remove the latter. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 626ab599eea2..f73835b8f1f9 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -808,7 +808,7 @@ static void check_section(const char *modname, struct elf_info *elf, #define ALL_XXXINIT_SECTIONS ".meminit.*" #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS -#define ALL_EXIT_SECTIONS EXIT_SECTIONS +#define ALL_EXIT_SECTIONS ".exit.*" #define DATA_SECTIONS ".data", ".data.rel" #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ @@ -819,8 +819,6 @@ static void check_section(const char *modname, struct elf_info *elf, #define INIT_SECTIONS ".init.*" -#define EXIT_SECTIONS ".exit.*" - #define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \ TEXT_SECTIONS, OTHER_TEXT_SECTIONS @@ -1006,7 +1004,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, */ if (!extra_warn && match(fromsec, PATTERNS(DATA_SECTIONS)) && - match(tosec, PATTERNS(EXIT_SECTIONS)) && + match(tosec, PATTERNS(ALL_EXIT_SECTIONS)) && match(fromsym, PATTERNS("*driver"))) return 0; @@ -1169,7 +1167,7 @@ static void check_export_symbol(struct module *mod, struct elf_info *elf, if (match(secname, PATTERNS(INIT_SECTIONS))) warn("%s: %s: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.\n", mod->name, name); - else if (match(secname, PATTERNS(EXIT_SECTIONS))) + else if (match(secname, PATTERNS(ALL_EXIT_SECTIONS))) warn("%s: %s: EXPORT_SYMBOL used for exit symbol. Remove __exit or EXPORT_SYMBOL.\n", mod->name, name); } From patchwork Sun Oct 22 17:06:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432012 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 40615CDB474 for ; Sun, 22 Oct 2023 17:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232643AbjJVRGj (ORCPT ); Sun, 22 Oct 2023 13:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232575AbjJVRGf (ORCPT ); Sun, 22 Oct 2023 13:06:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24290124; Sun, 22 Oct 2023 10:06:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D8BBC433CB; Sun, 22 Oct 2023 17:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994386; bh=0RQilyl14YGAa058AYczk30yG3OUTMcYtlZHlUX70hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNFDAuiCn2GLpHPgqk2Ge5JuSaOfxg26Z+bkCMzZ63rmPLZHj6mC/hz0NC3fVYIlh IukOuF4yIOjYjxvQSRuz77rMkUBIA6mnCRjgkrWT+C1Gd2pGzWYnOuGNTzBRXVEaOU rQIPLtZIrj8zy1VLz3MHxTa0TUEldyksYYINhtBD9yUv5mQ3abWTxnxG8NQwHJC5wM G9RsctmxaRx6UhB7jf/gfJsHM9LaGCnssZXUUox2OX7qNnvaOgh0BAv6aWcU9WXp4H Zkrzfb5Iu6SHeJvOHiTik3R5+qeq1TFAuo4q2pvT8CmMHDWEgNERGJiGStBYYF8T2M cj5WoppkBuiaw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 07/10] modpost: disallow the combination of EXPORT_SYMBOL and __meminit* Date: Mon, 23 Oct 2023 02:06:10 +0900 Message-Id: <20231022170613.2072838-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Theoretically, we could export conditionally-discarded code sections, such as .meminit*, if all the users can become modular under a certain condition. However, that would be difficult to control and such a tricky case has never occurred. Signed-off-by: Masahiro Yamada --- 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 f73835b8f1f9..8f4bddbbc52b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1164,7 +1164,7 @@ static void check_export_symbol(struct module *mod, struct elf_info *elf, ELF_ST_TYPE(sym->st_info) == STT_LOPROC) s->is_func = true; - if (match(secname, PATTERNS(INIT_SECTIONS))) + if (match(secname, PATTERNS(ALL_INIT_SECTIONS))) warn("%s: %s: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.\n", mod->name, name); else if (match(secname, PATTERNS(ALL_EXIT_SECTIONS))) From patchwork Sun Oct 22 17:06:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432013 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 37D3BC001DF for ; Sun, 22 Oct 2023 17:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232655AbjJVRGk (ORCPT ); Sun, 22 Oct 2023 13:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232578AbjJVRGf (ORCPT ); Sun, 22 Oct 2023 13:06:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 863BCD63; Sun, 22 Oct 2023 10:06:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DBABC433C9; Sun, 22 Oct 2023 17:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994388; bh=hKI1zzwBL75rgCF5kVM4ODL5hDvv/GmFFgzS1g4lATI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/jr2zEZFapXEUeHrMZOfqTMdiWYVWdzESaIC4c6z+PBZgj/SIIBYofDuzXwSmfya aAqcO+ftepC6hG5fXKgra8RiS7+ePPvVuzvHqbxqFzv87RZQ/h6LB9O0EuyyGnzqZe NQpRqhASjAMJxQr5E4i2upCwumbwXfhWdoDvHZCRE+7FZMdnYhumprkpXWGXkrdfRO Ln/tQ/w2As4/n5Dfxzn2UG1KcD58lqDHS0kVzcU0PuaEnutMVvucGZYNcimDk8oKzs BPxJlAAYfp3BLS+iKrlG6CatIi3Mkr7M6Np0L9uVz43Xa/KBSopJuicVLAN6V77kL7 72Cr2xs/9Az1g== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 08/10] modpost: use ALL_INIT_SECTIONS for the section check from DATA_SECTIONS Date: Mon, 23 Oct 2023 02:06:11 +0900 Message-Id: <20231022170613.2072838-8-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org ALL_INIT_SECTIONS is defined as follows: #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS Signed-off-by: Masahiro Yamada --- 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 8f4bddbbc52b..c726383c1909 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -863,7 +863,7 @@ static const struct sectioncheck sectioncheck[] = { }, { .fromsec = { DATA_SECTIONS, NULL }, - .bad_tosec = { ALL_XXXINIT_SECTIONS, INIT_SECTIONS, NULL }, + .bad_tosec = { ALL_INIT_SECTIONS, NULL }, .mismatch = DATA_TO_ANY_INIT, }, { From patchwork Sun Oct 22 17:06:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432014 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 A4172CDB474 for ; Sun, 22 Oct 2023 17:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232618AbjJVRGt (ORCPT ); Sun, 22 Oct 2023 13:06:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbjJVRGi (ORCPT ); Sun, 22 Oct 2023 13:06:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C9DDD7E; Sun, 22 Oct 2023 10:06:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85D6FC433C7; Sun, 22 Oct 2023 17:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994389; bh=dd0s00G1J0MosUp3Ta0R979mrbMMhfnV4OD44YXCobg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q1M6lbudSRRO5CTdiGZgmQoSyR284yHS7vAlfGh09/tq9595IRjm1QSwaoHKGjmb+ HoBHbJLzmECxdfvmq/Hhb3SjB++UHtPtw/PpJxmnyu4AmMCQhqYAxWoaOGHv4F99Hg LGFTbRjGCWO+FUQLqJRcEHaK12SuQlpcqdoS6WGXcFS/kMuqujrm9P2TS7WsH9QiW0 FJWEK60fGwUnG4arnbCNyDsxsgYWUPc/GjotFRM/7v6fAcakl3aCFKm/bYU200IvGP Ntazo8jvxUYC5ktKxKsqnKL3G8/ID5AgAbK2aTxHxm0u3iJaCXpmyBelwDTpxXmBTa N13Cdxp+ag+EA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 09/10] modpost: merge sectioncheck table entries regarding init/exit sections Date: Mon, 23 Oct 2023 02:06:12 +0900 Message-Id: <20231022170613.2072838-9-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Check symbol references from normal sections to init/exit sections in a single entry. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index c726383c1909..e4eb989dc764 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -823,9 +823,7 @@ static void check_section(const char *modname, struct elf_info *elf, TEXT_SECTIONS, OTHER_TEXT_SECTIONS enum mismatch { - TEXT_TO_ANY_INIT, - DATA_TO_ANY_INIT, - TEXTDATA_TO_ANY_EXIT, + TEXTDATA_TO_ANY_INIT_EXIT, XXXINIT_TO_SOME_INIT, ANY_INIT_TO_ANY_EXIT, ANY_EXIT_TO_ANY_INIT, @@ -856,20 +854,10 @@ static const struct sectioncheck sectioncheck[] = { /* Do not reference init/exit code/data from * normal code and data */ -{ - .fromsec = { TEXT_SECTIONS, NULL }, - .bad_tosec = { ALL_INIT_SECTIONS, NULL }, - .mismatch = TEXT_TO_ANY_INIT, -}, -{ - .fromsec = { DATA_SECTIONS, NULL }, - .bad_tosec = { ALL_INIT_SECTIONS, NULL }, - .mismatch = DATA_TO_ANY_INIT, -}, { .fromsec = { TEXT_SECTIONS, DATA_SECTIONS, NULL }, - .bad_tosec = { ALL_EXIT_SECTIONS, NULL }, - .mismatch = TEXTDATA_TO_ANY_EXIT, + .bad_tosec = { ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL }, + .mismatch = TEXTDATA_TO_ANY_INIT_EXIT, }, /* Do not reference init code/data from meminit code/data */ { From patchwork Sun Oct 22 17:06:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13432015 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 107CBC001DF for ; Sun, 22 Oct 2023 17:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231623AbjJVRIA (ORCPT ); Sun, 22 Oct 2023 13:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbjJVRGi (ORCPT ); Sun, 22 Oct 2023 13:06:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A3EF10C6; Sun, 22 Oct 2023 10:06:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02796C433CB; Sun, 22 Oct 2023 17:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994391; bh=jurkImcIT4LPjZwhzZI7kbU4mAhyNYbhidKTnt+0gBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tH0rGjJC4uaKV5yrD8YmJwuh79Hzuz290OkCqRxKkySACmjziCEns+4wJpIsOdUvI vwU0tvUrp+68CmJwwioLWLvhco++yaxJaZIZMB7vn/ue6jGIykzDIZCNS7s2iqbPuk Df09konjcm4LHj3wJugH4ewZ9dk6FEBC8iltR239qnSeWx9ucIVJZeeaGHa2CmK728 4X8wPgGBChW9Zn9ZYbUSiiNrEzcGgqcr7U/rzs1osuW5jgLQLmPVoCwDtXdVrlhUhV 5/Q79oI5NOKo0+2MW7BKbAQausgbQkpLFh+WeRxT5y5cf0+J2HoInhhDgMIgTJmo3X Pt+M5EqoBao5w== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 10/10] modpost: squash ALL_{INIT,EXIT}_TEXT_SECTIONS to ALL_TEXT_SECTIONS Date: Mon, 23 Oct 2023 02:06:13 +0900 Message-Id: <20231022170613.2072838-10-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org ALL_INIT_TEXT_SECTIONS and ALL_EXIT_TEXT_SECTIONS are only used in the macro definition of ALL_TEXT_SECTIONS. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index e4eb989dc764..f27ea0b8531d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -795,11 +795,6 @@ static void check_section(const char *modname, struct elf_info *elf, ".init.setup", ".init.rodata", ".meminit.rodata", \ ".init.data", ".meminit.data" -#define ALL_INIT_TEXT_SECTIONS \ - ".init.text", ".meminit.text" -#define ALL_EXIT_TEXT_SECTIONS \ - ".exit.text" - #define ALL_PCI_INIT_SECTIONS \ ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \ ".pci_fixup_enable", ".pci_fixup_resume", \ @@ -819,7 +814,7 @@ static void check_section(const char *modname, struct elf_info *elf, #define INIT_SECTIONS ".init.*" -#define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \ +#define ALL_TEXT_SECTIONS ".init.text", ".meminit.text", ".exit.text", \ TEXT_SECTIONS, OTHER_TEXT_SECTIONS enum mismatch {