From: Nathan Chancellor <natechancellor@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Dan Rue <dan.rue@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
Michal Marek <michal.lkml@markovi.net>,
Fangrui Song <maskray@google.com>, Arnd Bergmann <arnd@arndb.de>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Alan Modra <amodra@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Jian Cai <jiancai@google.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Mark Brown <broonie@kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Abbott Liu <liuwenliang@huawei.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
Mike Rapoport <rppt@linux.ibm.com>, Will Deacon <will@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kbuild: Always link with '-z norelro'
Date: Thu, 19 Nov 2020 12:33:55 -0700 [thread overview]
Message-ID: <20201119193355.GA3235069@ubuntu-m3-large-x86> (raw)
In-Reply-To: <CAKwvOdnNzd6wZoDJEgwjnEuTusU8jUcsLDiYoKipkcTubQ+t5g@mail.gmail.com>
On Wed, Nov 18, 2020 at 03:24:04PM -0800, Nick Desaulniers wrote:
> On Wed, Nov 18, 2020 at 3:07 PM Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > On Thu, 19 Nov 2020 at 00:05, Nick Desaulniers <ndesaulniers@google.com> wrote:
> > >
> > > > > > > > To avoid playing whack-a-mole with different architectures over time,
> > > > > > > > hoist '-z norelro' into the main Makefile. This does not affect ld.bfd
> > > > > > > > because '-z norelro' is the default for it.
> > >
> > > Fangrui pointed out off list that this might need an ld-option wrapper
> > > for older versions of GNU binutils. Dan was showing me some build
> > > logs today, and I thought I spotted such warnings about `-z norelro
> > > will be ignored`.
> >
> > Does ld-option catch options that cause warnings but no errors?
>
> $ ld.bfd -z foo /dev/null
> ld.bfd: warning: -z foo ignored
> ld.bfd: warning: cannot find entry symbol _start; not setting start address
> ➜ echo $?
> 0
>
> Probably not. Can be a version check then (yuck); next is to find when
> ld.bfd supported `-z norelro`.
>
> commit 8c37241be3b1 in binutils looks like it.
> Date: Tue May 11 17:08:38 2004 +0000
>
> which looks like either
> 2004-05-17 19:46:23 +0000 (tag: binutils-2_15)
> or
> 2005-05-02 22:04:18 +0000 (tag: binutils-2_16)
>
> So I think that would be fine then, since the kernel only supports 2.23+.
>
> Though maybe it's
> commit 5fd104addfddb68844fb8df67be832ee98ad9888
> Emit a warning when -z relro is unsupported
>
> ld silently accepts -z relro and -z norelro for targets that lack the
> necessary GNU_RELRO support. This patch makes those targets emit a
> warning instead, and adds testsuite infrastructure to detect when
> relro is unsupported.
>
> So maybe then alpha and xtensa are getting new warnings (IIUC). If
> that's the case, then we might not be able to set `-z norelro`
> globally, and instead have to play whack a mole per architecture.
Sure, I can just submit the arch/arm patch that I had before this for
now and we can always revisit something like this later, if you feel it
is best.
Cheers,
Nathan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-11-19 19:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 18:38 [PATCH] kbuild: Always link with '-z norelro' Nathan Chancellor
2020-11-13 0:44 ` Nick Desaulniers
2020-11-13 0:53 ` Nathan Chancellor
2020-11-13 6:06 ` Ard Biesheuvel
2020-11-13 19:34 ` Nick Desaulniers
2020-11-18 23:05 ` Nick Desaulniers
2020-11-18 23:06 ` Ard Biesheuvel
2020-11-18 23:24 ` Nick Desaulniers
2020-11-19 19:33 ` Nathan Chancellor [this message]
2020-11-16 12:31 ` Catalin Marinas
2020-11-17 21:17 ` Linus Walleij
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=20201119193355.GA3235069@ubuntu-m3-large-x86 \
--to=natechancellor@gmail.com \
--cc=amodra@gmail.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=aryabinin@virtuozzo.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=dan.rue@linaro.org \
--cc=f.fainelli@gmail.com \
--cc=jiancai@google.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liuwenliang@huawei.com \
--cc=masahiroy@kernel.org \
--cc=maskray@google.com \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=rppt@linux.ibm.com \
--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;
as well as URLs for NNTP newsgroup(s).