Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp797400rda; Sun, 22 Oct 2023 10:07:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc8T+i1z4mjZLbHtsg+Erh2mNgjSIkgTRjUguW+E0R+h1ReRwceNCin3M9sAAkjC+olQbO X-Received: by 2002:a92:cc43:0:b0:357:61d7:200f with SMTP id t3-20020a92cc43000000b0035761d7200fmr7754738ilq.12.1697994431990; Sun, 22 Oct 2023 10:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697994431; cv=none; d=google.com; s=arc-20160816; b=GP5nr/ILc2GTyflVTkTmyMerB4Fo/kMoMPEO0Hjn+qguFHyJn/qOP7pV12z/qiWHYo EORwKxWXN2zwR8y1ruAZ78r8R52wYTlKwM+hCATlv96odcMZPTMUt/tayNsBwpigCLsp YJeFKTBRNIMieD6rUpWxeKPZOVK1RR7gH0rolcjQZ6arowWSSYEkx/B43z+A0TvdhOdg k34kUhZtrBbPymVjbOehHary3JFqZKQd58O47YIIzpBu/S9rnY+y2SPjjByryt3BB8o+ INP870+5S3hi8hhe8bZVhTjz+U7LpATExQ20xp1asU+JisfN6xISpNW1TXXwJtkgy7Mf IOIQ== 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=hrJ+nAmMkITo63t/6pJPCL9eKrT46SByvvlcNGH7png=; fh=wKrPioF+0wPaktGqmf0aQvlk8PY4Pc32rTAsBSAiP8I=; b=MkUjX9JJc2v5UX5vudNXSrR4xGnjebhB2NJKq3SPWlRv/0S7IGN3Wmjq0akcljYdLD 1hL0hond0cONp3iHZhRtAkBysXyoc4bQOwKJDHfzagH6mHybv1mh0m251VlXoZS9daeU qDflZd/nmhN0DYKmW1N6RsBuSBLXuRYn4JmCEZe6DRpUgBudLjhmXoZJpMOUCE3nDg65 pQpW+tO2o6+JkNfA8DylNComYEgNcFAPxlwX7OAX9M47q0nW29TtK0VsvYSoK0Sg+4No 00P8wru+QLTFT69CRjmpOcVcibB+mN3kcShpkd1xu3G0pAcGRcP40wPXnTQkfduga4fR T36w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DNFDAuiC; 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 i30-20020a63585e000000b005b8857bb156si3853650pgm.463.2023.10.22.10.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 10:07:11 -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=DNFDAuiC; 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 BF076805119C; Sun, 22 Oct 2023 10:07:00 -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 S232646AbjJVRGj (ORCPT + 99 others); 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 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:01 -0700 (PDT) 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))) -- 2.40.1