Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2389929pxp; Mon, 21 Mar 2022 18:52:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8LGLDcBTbZRpYkIB1Za4WfPr0zGO790ePwNymEbfQjg7wMzR5+Yt/sYJsrHsUpwdEXUND X-Received: by 2002:a17:90a:af88:b0:1bd:6b5d:4251 with SMTP id w8-20020a17090aaf8800b001bd6b5d4251mr2220714pjq.134.1647913957701; Mon, 21 Mar 2022 18:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647913957; cv=none; d=google.com; s=arc-20160816; b=GonwFjBewMI6Eupx6UAICeMipAOD09l/dEfCG+MjHS8+JNrWh27LMmmdb/h83msKaE BtnZgJGIFP8XSqfVXt4A0+grOjASwsTBBGrvi7wlWqYIbhiy450VK72LcdBsip1U0MDi wmwJ/ziAU0mZcFvCA6DDTk0gimp74J51n80OMoIl05Brqeq5fnTWlKXvVLdN15Rkmi+N 8tbgAKPBGx1GceOvFZ0PHXfAILGBU/8X4hHnHygPdyz6cayHY+WivO+77dq3QG82AqAI MmqXcpZ6N/u24xG6qXWWKqQ4L02aChtr56a3KGl1sbkb9kb6YkETK3Ej3eIBBcb5Qhbx Hvqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=Zcfus1hr4rL4+XSk7ZeSMnR2CKTg6P0EKLP3F7c9nb8=; b=RQTXHrpcZspCIyAy2wm+hu9Al5LRzRScwj76Aa3vXzph9pG8Gj8ojligC4C+Zeiv24 EuC1UE9/hz/y1jvbec5EsB2pqKGhlcB6UHR9JOaj3ipjGO5mi3S2vjLBnSgxsyoFFiPT 5yVe3HfVE4B/zu63nlC9ifB076DQOpMjn1zj2VtOu8JG9u/r/tobTHxsJ/clUEQufP/u wsEEBjd5kgD+I+sekoKjgEFv2RFq+NjP07hkAm6Wc5ZtjowEhkG7B4x+nJmPzDV7a3hH wm3Rghh8B+yLB2wT4nVkf0/98bLJw9LEjuai80V2zhoE1HG8RfcFkRPogaM9fyDPn4nM bGwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=i8x6bw63; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f23-20020a637557000000b003823e1bfe39si9711317pgn.650.2022.03.21.18.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 18:52:37 -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=@google.com header.s=20210112 header.b=i8x6bw63; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9885D38182; Mon, 21 Mar 2022 18:26:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234607AbiCVB1t (ORCPT + 99 others); Mon, 21 Mar 2022 21:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234503AbiCVB1s (ORCPT ); Mon, 21 Mar 2022 21:27:48 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A66A3633C for ; Mon, 21 Mar 2022 18:26:21 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2e5a3c1384cso133885627b3.4 for ; Mon, 21 Mar 2022 18:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Zcfus1hr4rL4+XSk7ZeSMnR2CKTg6P0EKLP3F7c9nb8=; b=i8x6bw63C8CnBwNWToBn1ejwhs1I5sT+Qt9rGn8CdzD2q5bI6ajCe3oOQ78/3FZGIs qmXDGKtcf8+1xdLslk9ffOSueyPzSySWMSsk5Yq8Ly0Wd5PeXu0lxN1YBt84AS2iny0Q A0fzfbjqIHB/yamvOOvVSOO6Nx+KjZdAEe39VS4o1cjeZId+2Y0ZnFkqrcKqcS99Xlrs Y79QpCoATrBt4sBO6s619f0NsNV3loVUEwp9wTNb0aPu41sSSH+jhAKIOjE1W9ELy2l3 Adh+H7EmKMo9H0/LyE/2qeSEKHxHjskBU9fCJeJ1yYdC3WyJDhOm4FnonjpV0MsT/W3m vaXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Zcfus1hr4rL4+XSk7ZeSMnR2CKTg6P0EKLP3F7c9nb8=; b=c0Nx79ogrPTaq/y3amO9ffUVThATznGqe2Y6m0LzKamrUesV5yznNpInQXTp1GK2lO ATNn1T2kq1r8rpcccjx4y0bP+tZFqnLP9w5wwtyz9pNUKA7DjtG56cQsdEII5P/IdTQj i9cDb9X/GFTddqwQcOV4GlKnkhSktWHOUJUP+c6wjpq0oaecjhyMDG7Ue6zAHULkUT2O lvHHd8jqmum7n3nYXhYLgYlEe/q69seCfQceSIpDXWJ5vgDL3JLiZzVuDeMEPSjP066n SSIg5HMJIdkXnv6BqKnPTafDcVoLGKkYwjIVoyT1GZdHVkySFPjA6l3zNKKMJD3/eqVe Fb0Q== X-Gm-Message-State: AOAM530Nt/qFTBWHQYlpWC0dKPEhOGYn6t2qlY4fSWNGzA1q5foVoTo2 GkwTNX4BUEBoJDIMilkiF/P5rOpD0t8c X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:b489:622a:ba50:950a]) (user=maskray job=sendgmr) by 2002:a25:dd87:0:b0:628:e822:bd with SMTP id u129-20020a25dd87000000b00628e82200bdmr24014508ybg.505.1647912380832; Mon, 21 Mar 2022 18:26:20 -0700 (PDT) Date: Mon, 21 Mar 2022 18:26:17 -0700 In-Reply-To: Message-Id: <20220322012617.3517297-1-maskray@google.com> Mime-Version: 1.0 References: Subject: [PATCH v2] riscv module: remove (NOLOAD) From: Fangrui Song To: Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org Cc: Nathan Chancellor , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Fangrui Song Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 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 --- 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