Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2402558pxp; Mon, 21 Mar 2022 19:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmuTssCC/dghhdbDx/KicVeg8JUkxi+4dlgg85JjfGz0Vc8YNoaedjzDG3sUKGNtlfw3qV X-Received: by 2002:a17:90b:4a89:b0:1c7:3933:d802 with SMTP id lp9-20020a17090b4a8900b001c73933d802mr2234861pjb.75.1647915388929; Mon, 21 Mar 2022 19:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647915388; cv=none; d=google.com; s=arc-20160816; b=Ai+58bNm0/2aItI6bD5WIE39t32KdaWh3zuFIWR4xTKHDqJ3O4+G5zxK/I6Cjs6rzN Nnj0THjBS4VLaDJjPf5VZyQTe05c09oBnuRoq1KDb0DXWM/bKMMxVX9l99RWS/rwG/Qj aCZUvpj/aYI3kk0hTL1b7uiHgitb9HbxAuUbCfKnqsus2fn02AR+O+596SZh0mJQKmdn 4d7HO9tFM9OoFpBLGPoaC80xdnB1erffoqSxL7OF6NR6+HtFQGeEPgdeDnE2ol0PQ7Jx i0P5DPyUsNmpMaqzmmuEH3FDu1JPZG2k/OXHvejjQEU3fG4cqoUNo7sqJ4tUhgCXq8Tq /PyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ty1ACkHccrmhf3ATH+PUTEae9+xWBnyGQAlbyv5zs9Q=; b=qgZzBdGcRFXh0e5DT07c+y7Y8Ovfa0JQy0hpX46V2Kmx/jF/pQKkIOOawe6ezPs4Ye qfu/6WomEo//3HKN5ORka/LxT1vxvuBDuJa9mDg1IjWQDZu9t87zVmxOT4fbBnFRB7JP boNleJcu3GuSYnOw8ZwlOfvmfGaj6G842OUvqqkEqKc5C4AcUDR8/OmbsrsavHuKFWrK bgacDh8qRh73VbIVgfCe2L0mMrz/OTcoGk+Vr8+yqIJHydNMn7WVCrI0exffR773JgJs HmFpQtaQ5+/GdkFNDbRgz+uGJJzf9XdZJhIr0gF/V/tZ2jD2t5xjTIcYg2yJkP4QsmvD pXiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vKS5FvHj; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w12-20020a1709027b8c00b00153b2d1663esi12081469pll.582.2022.03.21.19.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 19:16:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vKS5FvHj; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69A743B01E; Mon, 21 Mar 2022 18:49:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235166AbiCVBut (ORCPT + 99 others); Mon, 21 Mar 2022 21:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235123AbiCVBur (ORCPT ); Mon, 21 Mar 2022 21:50:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED61A2CC94 for ; Mon, 21 Mar 2022 18:49:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7A5F760A20 for ; Tue, 22 Mar 2022 01:49:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D7A3C340E8; Tue, 22 Mar 2022 01:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647913759; bh=ddTucoDObbko3r4dIUh3A+Wyax31f7BdaGshebkC8ak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vKS5FvHjypP7+oJU8VJ14xcilm7aYOXpmyBeLBmAH286j/eeSjrthKWCl25Zbex89 a6GKYtJXzFMK+KIUMk5ZBKMAFLpOa7+ti+XarxoocpWXsIV8ukU9iJykHePX9BveSk Ys1ebK1KcjmbhfykfeMYl3he4JrKtNQoeOxricTKyRMcGnab2jhXjS9VSxqR0v+Ldp pnsBMh5sH9axv+mpcDXKuwJ+vM08aYb2My7MVG2YXIcP3PJhXEwsxkaRrT0x9CwA+p XZjYSBBQmJTLbjJktpXLNbHAAbYDjNfRE5WtmoUZvKOTt+P3R3Lb6JkvESNOjQjWG9 L7HUDpcVyJJ3w== Date: Mon, 21 Mar 2022 18:49:12 -0700 From: Nathan Chancellor To: Fangrui Song Cc: Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2] riscv module: remove (NOLOAD) Message-ID: References: <20220322012617.3517297-1-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220322012617.3517297-1-maskray@google.com> X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, Mar 21, 2022 at 06:26:17PM -0700, Fangrui Song wrote: > On ELF, (NOLOAD) sets the section type to SHT_NOBITS[1]. It is conceptually > inappropriate for .plt, .got, and .got.plt sections which are always > SHT_PROGBITS. > > In GNU ld, if PLT entries are needed, .plt will be SHT_PROGBITS anyway > and (NOLOAD) will be essentially ignored. In ld.lld, since > https://reviews.llvm.org/D118840 ("[ELF] Support (TYPE=) to > customize the output section type"), ld.lld will report a `section type > mismatch` error (later changed to a warning). Just remove (NOLOAD) to > fix the warning. > > [1] https://lld.llvm.org/ELF/linker_script.html As of today, "The > section should be marked as not loadable" on > https://sourceware.org/binutils/docs/ld/Output-Section-Type.html is > outdated for ELF. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1597 > Fixes: ab1ef68e5401 ("RISC-V: Add sections of PLT and GOT for kernel module") > Reported-by: Nathan Chancellor > Signed-off-by: Fangrui Song Thank you for the resend! I think the Fixes: tag you chose is more accurate than Palmer's suggested one. Same tags as v1, if Palmer would not mind taking them while applying: Cc: stable@vger.kernel.org Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > arch/riscv/include/asm/module.lds.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/include/asm/module.lds.h b/arch/riscv/include/asm/module.lds.h > index 4254ff2ff049..1075beae1ac6 100644 > --- a/arch/riscv/include/asm/module.lds.h > +++ b/arch/riscv/include/asm/module.lds.h > @@ -2,8 +2,8 @@ > /* Copyright (C) 2017 Andes Technology Corporation */ > #ifdef CONFIG_MODULE_SECTIONS > SECTIONS { > - .plt (NOLOAD) : { BYTE(0) } > - .got (NOLOAD) : { BYTE(0) } > - .got.plt (NOLOAD) : { BYTE(0) } > + .plt : { BYTE(0) } > + .got : { BYTE(0) } > + .got.plt : { BYTE(0) } > } > #endif > -- > 2.35.1.894.gb6a874cedc-goog >