From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78255C2B9F4 for ; Fri, 25 Jun 2021 10:25:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E7D661439 for ; Fri, 25 Jun 2021 10:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbhFYK1b (ORCPT ); Fri, 25 Jun 2021 06:27:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:45588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbhFYK1b (ORCPT ); Fri, 25 Jun 2021 06:27:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2F0816143B; Fri, 25 Jun 2021 10:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624616710; bh=TGl+u/K4kLcFuQqnyAw0NqWtSoPlfqgjogOfJjHSWDo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F59eeZxfNtCO+tzIAZPWLa4PERUQa1yai7VvvnJ+9b6S8mVLW1sB9cHDUH/kmZtnx hBbOXJXWHIhFZJyBQd6NAi5tiuxXkFSdkYJEmz/8uJ/pxevFm+6o//rJGrRktjVHfz 8UjqpjNVGTeinraCllTK43iDh4zqzJvSW7U/fz/U= Date: Fri, 25 Jun 2021 12:25:08 +0200 From: Greg Kroah-Hartman To: Jisheng Zhang Cc: stable@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Ard Biesheuvel , Catalin Marinas , Will Deacon , Alan Modra , =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Quentin Perret Subject: Re: [PATCH stable v5.4] arm64: link with -z norelro for LLD or aarch64-elf Message-ID: References: <20210624170919.3d018a1a@xhacker.debian> <20210625181230.7e0b02c9@xhacker.debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210625181230.7e0b02c9@xhacker.debian> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Jun 25, 2021 at 06:12:30PM +0800, Jisheng Zhang wrote: > Hi Greg, > > On Fri, 25 Jun 2021 12:09:33 +0200 > Greg Kroah-Hartman wrote: > > > > > > On Thu, Jun 24, 2021 at 05:09:19PM +0800, Jisheng Zhang wrote: > > > From: Nick Desaulniers > > > > > > commit 311bea3cb9ee20ef150ca76fc60a592bf6b159f5 upstream. > > > > > > With GNU binutils 2.35+, linking with BFD produces warnings for vmlinux: > > > aarch64-linux-gnu-ld: warning: -z norelro ignored > > > > > > BFD can produce this warning when the target emulation mode does not > > > support RELRO program headers, and -z relro or -z norelro is passed. > > > > > > Alan Modra clarifies: > > > The default linker emulation for an aarch64-linux ld.bfd is > > > -maarch64linux, the default for an aarch64-elf linker is > > > -maarch64elf. They are not equivalent. If you choose -maarch64elf > > > you get an emulation that doesn't support -z relro. > > > > > > The ARCH=arm64 kernel prefers -maarch64elf, but may fall back to > > > -maarch64linux based on the toolchain configuration. > > > > > > LLD will always create RELRO program header regardless of target > > > emulation. > > > > > > To avoid the above warning when linking with BFD, pass -z norelro only > > > when linking with LLD or with -maarch64linux. > > > > > > Fixes: 3b92fa7485eb ("arm64: link with -z norelro regardless of CONFIG_RELOCATABLE") > > > Fixes: 3bbd3db86470 ("arm64: relocatable: fix inconsistencies in linker script and options") > > > Cc: # 5.0.x- > > > Reported-by: kernelci.org bot > > > Reported-by: Quentin Perret > > > Signed-off-by: Nick Desaulniers > > > Reviewed-by: Nathan Chancellor > > > Acked-by: Ard Biesheuvel > > > Cc: Alan Modra > > > Cc: Fāng-ruì Sòng > > > > Signed-off-by: Catalin Marinas > > > --- > > > arch/arm64/Makefile | 10 +++++++--- > > > 1 file changed, 7 insertions(+), 3 deletions(-) > > > > Now queued up, thanks. > > > > I assume the two patches in v2 series are queued up. Nick pointed out > applying only this patch can break kernel building with lld. Yes, I now took those instead, thanks. greg k-h