Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp936385lfn; Fri, 18 Feb 2022 01:05:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOoIVYar/XkYy1qu/V2fKVqxZrUzM25Rld7TFrl+fkmnXo1CY8w5QECmISl/zqFcwSN1oX X-Received: by 2002:a17:906:a384:b0:6ce:c3f4:c59a with SMTP id k4-20020a170906a38400b006cec3f4c59amr5425605ejz.580.1645175101743; Fri, 18 Feb 2022 01:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645175101; cv=none; d=google.com; s=arc-20160816; b=m7FB6mrNZwAzHCimTbl8MPheSTGbYQtNyUWAoLkWbQeo6JkDlnYqS7phsoP45oXgxk fgxxHg8BHliutHgVfjnrgELuESvUPUX1gKeAACcGr/yyioEtPgEgKYlHAi6SbsdEKhKv C+VUJ/QBa7XqX0UMepmFI+FEVT6VHfC9tcUhdIaR1UsTzhRjrO9VvV7w7GQhhPvPgnMO ldwMa7z4QZ5lZ7y1FHt1SfAEuedKD6XPE1QzRJ4zceVh3gJfj05d2kUXNZtvK80X94Ht XmGRR9iaFYI/Asmyib+5nBwlCUZR20IkaHrVZEkat88mJ+C32peQXNDGJdPo3zUj+8BK xVnA== 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:mime-version:message-id:date :dkim-signature; bh=RZAu1RopNW0ZnAhNX12nSJphTGjmyvccd/3qHZblYXY=; b=xJRUYR4SIEX3vLU2X53EqLgckDTSEgDWvJI4iYwuQTD0ZJyUTqiptE6aKm+w4XLuK9 LLEv8dSEM1BffS9TE8ffnGBOFTYheNhRV1hUpkvfExP5cVpqCohRoNGGavGV8PtBPPJx fQ7eTsrARUH8Ze8/Kdt5vchIl6C8A4JdOBrh0SGGHXe4xz0078/GZ8cD6bFlmmtL7vzF 4ZsaBWljRI7hJrYNQ8mlsN01lsm1/2BRA+lLgOpc2O/FqrfMrd6mVEmKaRQkQICss2h8 +AllXMRr0CLQ7CoSQ5mIESTTNhm4+Wnuib9ip+wXCAAS3iA7Ad2YwYjGW9gcHwjU3pnb Oq/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rCB+yv0t; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz21si3254568edb.164.2022.02.18.01.04.38; Fri, 18 Feb 2022 01:05:01 -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=@google.com header.s=20210112 header.b=rCB+yv0t; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbiBRI0e (ORCPT + 99 others); Fri, 18 Feb 2022 03:26:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231165AbiBRI0c (ORCPT ); Fri, 18 Feb 2022 03:26:32 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD022221B7 for ; Fri, 18 Feb 2022 00:26:16 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id i6-20020a255406000000b006241e97e420so4943641ybb.5 for ; Fri, 18 Feb 2022 00:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=RZAu1RopNW0ZnAhNX12nSJphTGjmyvccd/3qHZblYXY=; b=rCB+yv0t3K2artQviTbyk/s1ERydB/bk4ZSc8CtHBGWDb960G5TEmbF7KVd59dToSl fbSTCa3ux/7+xckpeHEGWrupiuQ26paV6JUm7AiZ695TBD8MwKRpOXr1aAyblZxp4f5z wI6qmLnLkEgVobo9GzyV8cgaoN+kiaMeSqzgzciQz0swVMXroFwjHuW8iSJsYMwGUJ7T QwFy6SnNz0o9fQrZopD2msec3ba4QSNiuewF7551R5Uc+CXwz/pBlVURbYaCatjKNFW+ bVQIrlRO0drjc0DgrBs7NvA4cOLJLuyjnwhsN0Xe0nzTTlWeeZ/5uVnQvZsO1Ej2Aijn 1ifg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=RZAu1RopNW0ZnAhNX12nSJphTGjmyvccd/3qHZblYXY=; b=cuBo6OqWMitL35yIbByC269XpSbFZxBXn2v7YDleGrvAOPZznT4z8k6Tcih8Lvigqg v2xV+oCCFsYvH5VqtZeQVA8AdnXMn4DM0kEx32WUlx1kEKF01AKCn3Fc/TL97Y90fnGf fSj3ltydZUen+C38WlA5UFRpoYJZaF+Nfoim5xUd3VKv4qqEwokEROmsuCfo14PohNVD hF+Fici2XYqBll4RBrYHHK0hsQABpK5jtJn9cl1wjq2bKo4YJGFkvEqQqGlEv8kE/EDP Txg3/faaDdM5RcUchJhu42gl/tacZZI6WpZx4cemGmFyUnFifNxZd3apnjNJMDkfLhyS cAKA== X-Gm-Message-State: AOAM533s4Fs0cVTcvCJZn84fWvJyXbV8JYrXvHRntwC43z1DymmxlhTw 7z8/dFzeZ08lGOVs6NV6tdoCpWGMfGIB X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:bdb7:3728:9760:87c]) (user=maskray job=sendgmr) by 2002:a25:d6d3:0:b0:61d:aa5c:7e82 with SMTP id n202-20020a25d6d3000000b0061daa5c7e82mr6379447ybg.404.1645172775391; Fri, 18 Feb 2022 00:26:15 -0800 (PST) Date: Fri, 18 Feb 2022 00:26:11 -0800 Message-Id: <20220218082611.396353-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] 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.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 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. --- 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