Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6794464rwb; Mon, 12 Dec 2022 06:33:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf5b3vOsESUjblJX5rECbkWKLAhnvrKth7hT1t12Mkndv/DoBvZmYJobfXp+ZjlaBSmqet4p X-Received: by 2002:a05:6402:3642:b0:45c:835c:1ecc with SMTP id em2-20020a056402364200b0045c835c1eccmr15333732edb.26.1670855587376; Mon, 12 Dec 2022 06:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670855587; cv=none; d=google.com; s=arc-20160816; b=XbMp/B3AjXa8EJ5CZKqq+zAgGYJ6ABOPlLasTtpqdXFjGQnGKZFfoh6v+z2pqQ+fm+ QzaetizPTeMK8mpWo5/kIAWqtkljLiiXWuXxrqH2pQNX6euaeT5K0iPhDktMlxq+1tJp 5LbPzO+kp00Y6fsv8AxzGP9Zf/dxaSyrlqjQypDz53UTW6O5lkVnWjGAvNxfKeaZjZ0H Ar3y065YRTPejEJUWTMXKv7r3tl3MTxmwDKKuWVud86i+IilfIh2d2Z+qPMM+3kNj9qB HBE0lzAUnDPgGztXT7WtoD4yCVHsCC141xgAElYgTWG5RBRR0EokFf2KqjfzNVWLr+Lw T8gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=Qyvr5aZkM+wmdhHKW6aw9JveC938iEMrNt3NYpNMYho=; b=EdPemzi/bebpXMFiwdFAaETcossrse59DCa31t7QbZ1DpvPwT29cF9vZ1vP8d9bD/M Or58RnvSEes919YvYshewHuoFaZtAnzjsPdbahpVsOjCyK+Z3P4Ag/jjokrQiefnwd02 C/Qg9fEn6IAxNjoqW07C/ZQql1RBwzZtdUefJjwhwbjadR21zc55fLEV7v+hj4KCVplB x9k8Idf+BX/56HVb15DKOZ/saiEM7jgwdfjqLPwRtGwnHzmhnh5tAxXFy8EORnWFc7VD yKt6kpa549V1+aegukKccmXd1xLedhWwsLiyf3LAFyeiSpUfXRYe38ptd7J/bKyYGeuA LaDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=b5+lBzaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a50e603000000b0046a84b922a2si7354577edm.499.2022.12.12.06.32.49; Mon, 12 Dec 2022 06:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=b5+lBzaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232585AbiLLNOe (ORCPT + 75 others); Mon, 12 Dec 2022 08:14:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232582AbiLLNOO (ORCPT ); Mon, 12 Dec 2022 08:14:14 -0500 Received: from conssluserg-04.nifty.com (conssluserg-04.nifty.com [210.131.2.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B6EA101C7; Mon, 12 Dec 2022 05:14:13 -0800 (PST) Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 2BCDDvE2032515; Mon, 12 Dec 2022 22:13:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 2BCDDvE2032515 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1670850838; bh=Qyvr5aZkM+wmdhHKW6aw9JveC938iEMrNt3NYpNMYho=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=b5+lBzaQFXLoYKeSphoB86Oodwyjy3b9I8NHzJQNVZFS+/itGfmkNfo+6WSyINJXf qOxsZm/dxLZS7ebxowc1YLekgFybdLtdHsbpR9HBMVw7xln5QsZBqYR0ioRthhzo9Q 8m6TILZSxsQORWoE0wtaelTgDrHHT2W9hiwu8PunxSWhtHf5vngzVFDh6bWl7eZ8H0 XUL7sSsoyJh2Vp39ZpHt9uxGQMhZfFe3rVvavOwpizOYgPlSeV8nimuzM+S5UTiYqz yJU8M9BQxsrE6XBFgwxDPpbksm8eWxibVXpUM6XHZip6VmNSkNGQTQv9cFWGBh16+e U7Qbgz3noIu8w== X-Nifty-SrcIP: [209.85.167.180] Received: by mail-oi1-f180.google.com with SMTP id r11so11121028oie.13; Mon, 12 Dec 2022 05:13:57 -0800 (PST) X-Gm-Message-State: ANoB5pkhNFi8K/zWXvLZeyVDJVZBLrG3zJpDv8B7ZjaD8WJqptaWkQlK 2hqMkONd++DkhCvn6mQG/1Q2hemG4tPkZBqffJA= X-Received: by 2002:a05:6808:3009:b0:354:94a6:a721 with SMTP id ay9-20020a056808300900b0035494a6a721mr37705245oib.194.1670850836790; Mon, 12 Dec 2022 05:13:56 -0800 (PST) MIME-Version: 1.0 References: <20221207191657.2852229-1-nathan@kernel.org> <20221207191657.2852229-3-nathan@kernel.org> In-Reply-To: <20221207191657.2852229-3-nathan@kernel.org> From: Masahiro Yamada Date: Mon, 12 Dec 2022 22:13:20 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] modpost: Include '.text.*' in TEXT_SECTIONS To: Nathan Chancellor Cc: Nick Desaulniers , Tom Rix , Nicolas Schier , Sami Tolvanen , Vincent Donnefort , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Alexander Lobakin Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 8, 2022 at 4:17 AM Nathan Chancellor wrote: > > Commit 6c730bfc894f ("modpost: handle -ffunction-sections") added > ".text.*" to the OTHER_TEXT_SECTIONS macro to fix certain section > mismatch warnings. Unfortunately, this makes it impossible for modpost > to warn about section mismatchs with LTO, which implies "mismatches" Other than the typo, this patch looks good to me. It was just 1/2 was difficult for me to understand. > '-ffunction-sections', as all functions are put in their own > '.text.' sections, which may still reference functions in > sections they are not supposed to, such as __init. > > Fix this by moving ".text.*" into TEXT_SECTIONS, so that configurations > with '-ffunction-sections' will see warnings about mismatched sections. > > Link: https://lore.kernel.org/Y39kI3MOtVI5BAnV@google.com/ > Reported-by: Vincent Donnefort > Reviewed-and-tested-by: Alexander Lobakin > Reviewed-by: Sami Tolvanen > Tested-by: Vincent Donnefort > Signed-off-by: Nathan Chancellor > --- > scripts/mod/modpost.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index 2c80da0220c3..c861beabc128 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -823,10 +823,10 @@ static void check_section(const char *modname, struct elf_info *elf, > #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS > > #define DATA_SECTIONS ".data", ".data.rel" > -#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \ > +#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ > ".kprobes.text", ".cpuidle.text", ".noinstr.text" > #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ > - ".fixup", ".entry.text", ".exception.text", ".text.*", \ > + ".fixup", ".entry.text", ".exception.text", \ > ".coldtext", ".softirqentry.text" > > #define INIT_SECTIONS ".init.*" > -- > 2.38.1 > -- Best Regards Masahiro Yamada