Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3017521pxb; Sun, 20 Feb 2022 07:05:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZFF+cUgJjHyN99uHlQknOUim08WS/ZVzTgGWuk/FYRMwsffN3gslq5z2AJ6GdE0jXsgpq X-Received: by 2002:a05:6402:3492:b0:412:e174:856d with SMTP id v18-20020a056402349200b00412e174856dmr6507893edc.355.1645369550193; Sun, 20 Feb 2022 07:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645369550; cv=none; d=google.com; s=arc-20160816; b=dtkwIlI1zM6T184k1KUMzwqDRGJ8DxPtfH6+1GYwT2ETZ7XJcP0C/pwfSRFQ3LEYdI SzicXWAi9Vh8U/UReVUFPA4IGbNLGPfDswWROi0ZG1bydUQ5WjBJVRrqbIIojTEtZFEO rSc7bnYXXH16ZyFm/PFLfoS3owAMPoFgj+7SOgvwXxs5XrkOhssvMhsOB32dFxUeCYOg TRYtAnn2sx4lKZcLJticSOOktOnJ6WKOyD86Wr0NR5+YKy4vC+5tI9ji1KBQA7JbhlbJ CnlC+fWsb5C4UXm/637Z6f7ovjmM71yzJ3oMNztZVdmpoy65n7dki8NIThrnWwcT6igH ob2w== 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=1ZLcvIrpae+ksjckej/mpwN1frK+cMBYjlYzNQM6JkY=; b=ksiQZJGo6hcGDLwLevy+pIRCG+RTjbs2Bw5o3P5eMZTH8IVNOohw0I8L9O5CRA21EC qbLla2dKrljQRZF2RcD/0wtvtNLM47fzOhjOeXk0j3MJjTiZ8pu/NPAsxRiWRp4n0+pc AQWygtMFInT4Uo2GHbobY3Ssl+yculunl12GWW1ew4h83dkwq1ReIdnUSHyh9FSYw1u2 swQlB56AeR36mirfIMhOGlUGbOdYv1dsDnNtD047nOrfJINsSWS3is7qXRgU375B72CL G4RurmQ9bk787wDavRxYLzJuz5Tdul7x8AY15SiOInFze70A4TOoUMTVUsqzWKXkmpg7 FXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SY1E+ESk; 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 i15si8946157edq.484.2022.02.20.07.05.26; Sun, 20 Feb 2022 07:05:50 -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=@kernel.org header.s=k20201202 header.b=SY1E+ESk; 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 S242681AbiBSQpg (ORCPT + 99 others); Sat, 19 Feb 2022 11:45:36 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242682AbiBSQpe (ORCPT ); Sat, 19 Feb 2022 11:45:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82751654A9 for ; Sat, 19 Feb 2022 08:45:15 -0800 (PST) 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 1EC1760AFA for ; Sat, 19 Feb 2022 16:45:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3589AC004E1; Sat, 19 Feb 2022 16:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645289114; bh=fFFD3oN5cDl0TnwcVvL6+V1rI+rC3W6wYV3VSS5WoTI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SY1E+ESkV+fUwtZzdZf7bHMG4LTNlMvATCd4VfhdPp6PfnmGFEokz24snDZ7vK7ZN 69Iw+9pl3NtRQ18pzh3kqsuAe+s3A3W/qBAOw/kHJU2XBpsNVvYtOl9Jci8P1S0+rP A9pnP7BX2Rw767poeN69xONghRMuaRgjn4dxWgSADCdFH3LVK7sCKzzJbTnC1tqvzy ORy0Z7AmR5HVZJlbyw3MZssIoSIoRr9RcOw5Cxm5KTtNBVbPqzqzsznKJa2Aqnwqq4 hINwwg9iBLIquncP5kuk0nsS3EZiSAu3TRgF8FeiBeNGY6R+uSGI2fBHGxDwN2K2EK zARiwFZLUbNHQ== Date: Sat, 19 Feb 2022 09:45:10 -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] riscv module: remove (NOLOAD) Message-ID: References: <20220218082611.396353-1-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220218082611.396353-1-maskray@google.com> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Feb 18, 2022 at 12:26:11AM -0800, 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. Just remove (NOLOAD) to fix the error. > > [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. Thank you for the patch! As mentioned on the arm64 patch, this needs your Signed-off-by tag. With that provided: Cc: stable@vger.kernel.org Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor This needs to go to stable so that older trees with a newer toolchain do not warn. > --- > 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.265.g69c8d7142f-goog > >