Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp538531pxp; Sat, 19 Mar 2022 09:16:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4DlTFHUePAvnhGvmimXfFdaLC73pp7IHHLLebMxucIihglgNvjh16cYnBsQFZKFUmuFE6 X-Received: by 2002:a17:906:c102:b0:6df:e34c:9923 with SMTP id do2-20020a170906c10200b006dfe34c9923mr2088658ejc.667.1647706596398; Sat, 19 Mar 2022 09:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647706596; cv=none; d=google.com; s=arc-20160816; b=O7d7BCk02QKclM8CezrCSZEaqvBHSl/Hd2uYMmwi1d+lepCZ+UQ9z4rhB/1ix4L23V qqQ9gxbg+uggyLqbg1kAEkYokiuUYdZw9gPm7drqjRT4x+1eUnfBwQvCGIxaU3N/QU5O X9CCmPDNZcpjr2rC1K//ZVeJqY34By2PfWWV3XkuNDO39mqx4TtQWppAcr4/4xq6tQMR mkWkSCryUQB1HaCB1kPpfkjxIAQgtBC3W48V8mN7cmnStrtfmab8bASeQ/4hMLnhGQ5Y EFoVomYdvLDghgC+ylkc8wSBzKop7mujOW//1lmhVSYqjomuEmhw04J1Cxe3QjKvN/dD P2BQ== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=IVcHCcBYklMVp4ZyFJpnqeq2akbdktOMbyQu0M7lWkM=; b=RuLCBDAYpFL6yaFndcDW9+mzKKWiplEu4guFN6/bf6UVXXhezvZ+Ik4VX5EutpvEK4 wBAby3uY9qJ/78wRgGzWgdBKvomNsuiCH3uA3p9H8lqDCa4ze6EXso6/Th+HvJ31qCk1 QCmu5sah59KrLQibnrF6lQLMxkG+W6sn1E9IjrQBNwEx67DGaS6jlq/x+xksSUlYiriU r/6Scf8Z0WcbQqa6mZHO/OxMjSHeYTrlxcTAw4N9GI4W+CD1OYlNXAAUYZ81PBRiNFit xCLOxf+NF6uIwi0EiuvT8Lq/orxQb7igmLVJqLQw7ZPSadRBduO6ChxeXkw3/lqelhG4 YnCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=i6IuYY1b; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a17090664d500b006dfa01988c2si3319302ejn.188.2022.03.19.09.16.06; Sat, 19 Mar 2022 09:16:36 -0700 (PDT) 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=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=i6IuYY1b; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241482AbiCRXTi (ORCPT + 99 others); Fri, 18 Mar 2022 19:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238224AbiCRXTh (ORCPT ); Fri, 18 Mar 2022 19:19:37 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB80017F3C9 for ; Fri, 18 Mar 2022 16:18:15 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id i11so7569982plr.1 for ; Fri, 18 Mar 2022 16:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=IVcHCcBYklMVp4ZyFJpnqeq2akbdktOMbyQu0M7lWkM=; b=i6IuYY1bVJG39GO25gWKj5fXg0j0g3I1ecz1VrdlDqj3a1wuctE1U+LTJku3FqmExS hYoE0JspcExfIyvNBOQqVMKx/OJZAk+UrfOqDU34OjVg4ar9ahcpI90IRKK9TTATJyKo sYFPP+CrvR84SvMKeF17KtvCFS41Z8E1by0bBhZbwRaY2S4OzULATWkDBmzy+zm7+C6h 4CbQMWoZGcn0rcnx+n8PiNK5h2UUO8Vpa8QvtHafxxmqGIiMNfDrAS6V6raO6EFhgIkX RmTzJ8+dtkMGdIQYTzz3OWpTXOd92HJS0/XWxD/chrQaICXkM0ThqSqoPBvCB2X9pDGS 0wBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=IVcHCcBYklMVp4ZyFJpnqeq2akbdktOMbyQu0M7lWkM=; b=FGHB0luKtPP/o2qKnkSPkA9Qvz3c01OEUtwT7axBsbAl9MlK7aLNMDYt57+EJ0EJog gx7opzeNMw7bGj0WkuChyfjD9jzlm5JwfHGMgcRMJ7CoEPo5w5N2J/HF4ujXJsiRc1Px I1kAtsuiNuflsyi2xPkeLfcF9Pg4MlVym7Og96ITq2LJ2hdDb+EtgMzrf9z4z6TW598i UQAl5pvaWwmapt0ubbwhmij/EfZ8W7pyVZwLFxoC5egLuqczsXt/HFlFTHkDGqkquQMZ 3IL63BHxiunzmVZQBn5awi+Ufnz7EUMaPRrhPWAXWQO9zgJa1PU0IAnK7/uuIp8werAg gTvw== X-Gm-Message-State: AOAM531zreliZBJ2kjlm7cz8f1TMm+taiKfOnG/ompfAO/8Hq+4LWzmK +AdzavZJ9xxhbfrjCOdQRPmjQQ== X-Received: by 2002:a17:90a:4a06:b0:1c6:d786:10a8 with SMTP id e6-20020a17090a4a0600b001c6d78610a8mr14591pjh.207.1647645495306; Fri, 18 Mar 2022 16:18:15 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id cd20-20020a056a00421400b004fa7d1b35b6sm562516pfb.80.2022.03.18.16.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Mar 2022 16:18:14 -0700 (PDT) Date: Fri, 18 Mar 2022 16:18:14 -0700 (PDT) X-Google-Original-Date: Fri, 18 Mar 2022 16:18:09 PDT (-0700) Subject: Re: [PATCH] riscv module: remove (NOLOAD) In-Reply-To: CC: Paul Walmsley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev From: Palmer Dabbelt To: maskray@google.com, nathan@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Sat, 19 Feb 2022 08:45:10 PST (-0800), nathan@kernel.org wrote: > 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. Yep, just checking on that SOB line. A Fixes: 596b0474d3d9 ("kbuild: preprocess module linker script") seems appropriate as well. Thanks! > >> --- >> 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 >> >>