Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp797496rda; Sun, 22 Oct 2023 10:07:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGWVNRvOeO0Ft6JPkx2jdF8JIzv08sy3PXkK8lA+q6B7HYBK6GKRaDgz2BmgdqPcnyItzB X-Received: by 2002:a05:6a00:188c:b0:6bf:5131:884a with SMTP id x12-20020a056a00188c00b006bf5131884amr5104044pfh.6.1697994442688; Sun, 22 Oct 2023 10:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697994442; cv=none; d=google.com; s=arc-20160816; b=Wr9A99UskTC7CbENYGgZIt6AJPlRSTioYV76OGzxuh1Jyj7LAuE/JP3QusNHmudocD zO98BRUYsP5yEIt5ArC6zhhAaTrAA1KoDC4Ks3RHu9aqbw32RJI2dLQEN8V1FT+P1Ruk IBJxfe79lZi2QyopIWwGADNqQ8GODBs11DERj/NW4TZKlRjXy5EmWp5MdcCmkMcGCJQB kfM7V9iH5cUcwMwMviil7JiB++2iALzSkQPNYTISvs9qClOT7r/TY6w5J6j7DiZCWTSa 702j5ItXPt3NNoxy89LrS+BvLhjLiZQ2aRorQnFMjmbJCwHFyIEmYXaI+b+TiScje7sC azWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/5EhtnpNRryx6a+qxG0AFfN5+6jROdUhlBfjSaDN8BU=; fh=wKrPioF+0wPaktGqmf0aQvlk8PY4Pc32rTAsBSAiP8I=; b=zgQ0lh+qpQLiVeiPweguYlsD5Kt9xE2c2Tow53dNy8fG6HxGtPqYQy83umoVBx0PIp WCvSlMl9afnQHo4805mEBBjtVAkyo9ZNHkhJTFrmQSCRmYA7bfhCaEfqfxbvRZjGFCSu taO8rsCPjEM46vVzvhkp19wm2HfvQck46/DbgRyAYR5vqxCqxOphz/dIHD+BXAEvq951 W7ArIe5iyXFkgDh4AC//PshzbqdiRkEPh00SuFhxppZIGfqutM/E6H94mVHtopwYdNW0 /QXXp9AfVRklF0D3pzQNiZAHfxzS4sHN9w56HLuPHuEciugamFDx4nlFK07L07yTljmQ z+Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q1M6lbud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u63-20020a638542000000b005b8afa325b8si1214796pgd.410.2023.10.22.10.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 10:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q1M6lbud; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 851D780511AF; Sun, 22 Oct 2023 10:07:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbjJVRGu (ORCPT + 99 others); Sun, 22 Oct 2023 13:06:50 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 22 Oct 2023 10:07:12 -0700 (PDT) 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 */ { -- 2.40.1