From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Cc: stable@vger.kernel.org,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Nathan Chancellor" <natechancellor@gmail.com>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>, "Alan Modra" <amodra@gmail.com>,
"Fāng-ruì Sòng" <maskray@google.com>,
"Quentin Perret" <qperret@google.com>
Subject: Re: [PATCH stable v5.4] arm64: link with -z norelro for LLD or aarch64-elf
Date: Fri, 25 Jun 2021 12:25:08 +0200 [thread overview]
Message-ID: <YNWvBOEwkYu5Hiju@kroah.com> (raw)
In-Reply-To: <20210625181230.7e0b02c9@xhacker.debian>
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 <gregkh@linuxfoundation.org> wrote:
>
>
> >
> > On Thu, Jun 24, 2021 at 05:09:19PM +0800, Jisheng Zhang wrote:
> > > From: Nick Desaulniers <ndesaulniers@google.com>
> > >
> > > 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: <stable@vger.kernel.org> # 5.0.x-
> > > Reported-by: kernelci.org bot <bot@kernelci.org>
> > > Reported-by: Quentin Perret <qperret@google.com>
> > > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> > > Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> > > Acked-by: Ard Biesheuvel <ardb@kernel.org>
> > > Cc: Alan Modra <amodra@gmail.com>
> > > Cc: Fāng-ruì Sòng <maskray@google.com>
>
> > > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > > ---
> > > 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
prev parent reply other threads:[~2021-06-25 10:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-24 9:09 [PATCH stable v5.4] arm64: link with -z norelro for LLD or aarch64-elf Jisheng Zhang
2021-06-24 19:14 ` Nick Desaulniers
2021-06-25 10:09 ` Greg Kroah-Hartman
2021-06-25 10:12 ` Jisheng Zhang
2021-06-25 10:25 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YNWvBOEwkYu5Hiju@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Jisheng.Zhang@synaptics.com \
--cc=amodra@gmail.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=maskray@google.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=qperret@google.com \
--cc=stable@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox