Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1115344pxb; Fri, 18 Feb 2022 00:41:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyp1kWZD6PMbDzLZ1XSOGDEMwn0jz0aRVB85h+j9szyvlEPnhLK1++w3986kTXRwHioFbJ X-Received: by 2002:a63:f606:0:b0:363:c24:1576 with SMTP id m6-20020a63f606000000b003630c241576mr5549567pgh.388.1645173661833; Fri, 18 Feb 2022 00:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645173661; cv=none; d=google.com; s=arc-20160816; b=E0jGW7HNZqI9Xm33cPfx6GU7UQ7XlN0BxbEz1IhZHitfZdRkUB/Hzaa9MuD3K3c9C2 NB0TeDiP9jKFNUBe8vEhn+APgjpD2dNzPGod5BnYnijvVpnQGsOdyQE1zKVOF8oIRrKA ZXEpU23D6SHpC3HYUMQLuLQxnq4RfG4bnM2WJPTzvwaFU04upf/3+/Gm+eLAnM53eU5E Au90uj4t1UVq8JpD/DvW5ZsU2ZjHMsHmCi3cqzYgEOAVg5gMURNhQvjBBMdfIvfLvWkO oEX0xItxxnh1VVN7odvSeO6dcMl4UtAtS2bwIkaKSxCH8sX7TOFoOxKd45OizlmL2yvm mjgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AcH+BFA+PJm0DCekaco6X13aRDGlUIP5oi+Lx3c68Oo=; b=WZEt/UkHVOfWr5gi+XikTFrMzYWw0BnQCKJJZB0IC63rzZ/HIi0P22AgQdM+VXm3FI GDrinXdYqrCubD8paY76GdaM5ZdJtvSTymAei7F7IgyqL6uX5asCixrhm2RCzHr4tJZa 5I784H6SLSEU71ox9zd4Qy3Skm6x2NX8f7a3xpxLWARJQQrkfc5Neq4nzKye7uL2ujoV x7u6wwKLsiDX9u/xAn8sYEpiPMjiUyvLv7LL9N2NyZLqIhkgxaDraxg/1x/fAUa525V2 FBHZs0dV1B/cmzSsIIHC9dHjDAme4D246moV1Pb+RUgh7V7iSJmm6lhHvgkfQvrwqYs8 yQcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDpS5aQd; 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 g4si10736502pgg.81.2022.02.18.00.40.47; Fri, 18 Feb 2022 00:41: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=@kernel.org header.s=k20201202 header.b=GDpS5aQd; 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 S232034AbiBRISR (ORCPT + 99 others); Fri, 18 Feb 2022 03:18:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbiBRISQ (ORCPT ); Fri, 18 Feb 2022 03:18:16 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFD051B7620 for ; Fri, 18 Feb 2022 00:18:00 -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 682A9616B0 for ; Fri, 18 Feb 2022 08:18:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8916C340F1 for ; Fri, 18 Feb 2022 08:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645172279; bh=985JkUSSqBbFVhxRLYWrMBKJNtQrzXhfGYWAxKvGD2k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GDpS5aQdX0+PcjsMR4nWvYjgomG6SvCv9AXeneV0V1gKIEZcY2WolYPn/OxaP/742 IR6oQBAKYLZ0D4YJjsZqZmlKq8dwzwK/baLUVs1aVeUUJhS6xj3bunSx9zKyJF2hVR KkcLK2tUdWC1VmEgA21X7gJEnoQ1gtuscU7m+5cfdljAyNrJKmw5QjWqHYf+W1+zG1 wkWPYI9xglKLY6dolJe1VPCfSV/x2lQVSOt60Mgv9P6nlt7P7UwmOt5FrSjjvdr38A n/PNxEn+ROeKgeHxAd9w6Md4sF1XfbOWoRP2/58b260NtxcKOYTYKik6dXALB5SXpp FdbWZS0JlEmAw== Received: by mail-wm1-f54.google.com with SMTP id x3-20020a05600c21c300b0037c01ad715bso5795263wmj.2 for ; Fri, 18 Feb 2022 00:17:59 -0800 (PST) X-Gm-Message-State: AOAM532EjMUndTpToz8E2y3Xd/blpFSsEuH54pibCEQ73qOW7YDNqgNQ /SQ32QSrm8Z6Z4aQsCl1lsqPu0niC5eJf62NRLA= X-Received: by 2002:a1c:2742:0:b0:37b:b481:321f with SMTP id n63-20020a1c2742000000b0037bb481321fmr6035958wmn.56.1645172278148; Fri, 18 Feb 2022 00:17:58 -0800 (PST) MIME-Version: 1.0 References: <20220218081209.354383-1-maskray@google.com> In-Reply-To: <20220218081209.354383-1-maskray@google.com> From: Ard Biesheuvel Date: Fri, 18 Feb 2022 09:17:46 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64 module: remove (NOLOAD) To: Fangrui Song Cc: Catalin Marinas , Will Deacon , Linux ARM , Nathan Chancellor , Linux Kernel Mailing List , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" 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, 18 Feb 2022 at 09:12, Fangrui Song wrote: > > On ELF, (NOLOAD) sets the section type to SHT_NOBITS[1]. It is conceptually > inappropriate for .plt and .text.* 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. This patch lacks a SOB line. With one added, Acked-by: Ard Biesheuvel > --- > arch/arm64/include/asm/module.lds.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h > index a11ccadd47d2..094701ec5500 100644 > --- a/arch/arm64/include/asm/module.lds.h > +++ b/arch/arm64/include/asm/module.lds.h > @@ -1,8 +1,8 @@ > SECTIONS { > #ifdef CONFIG_ARM64_MODULE_PLTS > - .plt 0 (NOLOAD) : { BYTE(0) } > - .init.plt 0 (NOLOAD) : { BYTE(0) } > - .text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) } > + .plt 0 : { BYTE(0) } > + .init.plt 0 : { BYTE(0) } > + .text.ftrace_trampoline 0 : { BYTE(0) } > #endif > > #ifdef CONFIG_KASAN_SW_TAGS > -- > 2.35.1.265.g69c8d7142f-goog >