Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp715460pxb; Tue, 5 Apr 2022 20:02:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXOYxnJDkpYB40e77B2fONviR22vWeGmuVg0GUUzRI/EauI66kLdZsOYIH2bzhB3Nvlcoo X-Received: by 2002:a17:903:41c2:b0:156:a033:a649 with SMTP id u2-20020a17090341c200b00156a033a649mr6766107ple.32.1649214145879; Tue, 05 Apr 2022 20:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649214145; cv=none; d=google.com; s=arc-20160816; b=pVs2wgao9jxmfMlyY6sDX0S0nTc3yD3uykbFg0DCaA4AUxGF/a7Vcy+hlaDO+nD7lb zazwNKpKISq5juFlpye8eabplOhdhtS6yVkFbuYUSADq0fGrp5uV0oBaj1lm9KTgsD/+ c5n7cl9aQbaE0UQkShZLOMfV3bHInuAXlsFUfJRO/mtMQDvMyxkPHQbcgULu+ZRoV/di oG129jSzq8iyv6xkQlpWdkvggkiSDWlyiOB30xrXQB2VGqXn4iMf4Ee3FlnQ9sz74cGH NR58NYyHkrWDQ7KdOLyIqWq4o77elK1PL7dZX1tQpRYmAxkx3CDY+VD3SksJJVjrPfRA bvAg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KWFwb0iqNzedsPofzHdLUEPImGgKaKSX4kNmv2eDiQo=; b=VBhUwuiss87N9Xlhq9/KoUBM3ahVGQp4GmoM3nxxa3QHltVx518NRn4EOiGFy2mGrb FuxITqyOSuJc4ANwxxYpFEVUUrnck4CbsXLRsZFmSERUSd8JumQu60l9fMrxyFNVHVNW gSYLTLyHZ9KXKUTs6n7tix7mjbexroyOjIVbHZc5rSo4zjnlMN7M7PCxgsgHTArrk+vD rfCn+7wI8ikxpA3YmvoAu1GCF0eeLZg1r0R1cEKNOSWgBbxcq9EeXY3F0WKkhiovvpsY 0khsayviaVnxKdxPCF9uhQXJQqyRBrbSuLQXPBZdSOt+c7z3gwoOQFqo6byzakmQMvfS IZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KOp7CGmH; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k16-20020a056a00169000b004fa9bb60b22si15144494pfc.120.2022.04.05.20.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:02:25 -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=@linuxfoundation.org header.s=korg header.b=KOp7CGmH; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 04D341E1109; Tue, 5 Apr 2022 19:47:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387422AbiDENPH (ORCPT + 99 others); Tue, 5 Apr 2022 09:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344254AbiDEJTB (ORCPT ); Tue, 5 Apr 2022 05:19:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 482A9496B5; Tue, 5 Apr 2022 02:06:18 -0700 (PDT) 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 D9E40614E4; Tue, 5 Apr 2022 09:06:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8F92C385A1; Tue, 5 Apr 2022 09:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149577; bh=YCzwUFyhUEJ/GM5eR1opJD1pGTH09ZAKXiiX9wurdYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KOp7CGmHBYzmVMQPgyitzbmnCFQYN+wvZqULDnHxgkET1PFFPQdNL+gs7+EbfMp+O VEXeZFVJ2GlqMUJ3NWVhM6K4n+RXpkzDM+WTVi+Ssp5sF696qqn8+OGHIGR9kwfzjy uWbhM5Vd+n70jv1A3xFXPX1Le0O7Vm6YPZaSvufs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Fangrui Song , Ard Biesheuvel , Will Deacon , Sasha Levin Subject: [PATCH 5.16 0766/1017] arm64: module: remove (NOLOAD) from linker script Date: Tue, 5 Apr 2022 09:27:59 +0200 Message-Id: <20220405070416.999216771@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 From: Fangrui Song [ Upstream commit 4013e26670c590944abdab56c4fa797527b74325 ] 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. Tested-by: Nathan Chancellor Reported-by: Nathan Chancellor Signed-off-by: Fangrui Song Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220218081209.354383-1-maskray@google.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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.34.1