From: Segher Boessenkool <segher@kernel.crashing.org>
To: Fangrui Song <maskray@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
clang-built-linux@googlegroups.com,
Paul Mackerras <paulus@samba.org>,
Bill Wendling <morbo@google.com>,
linuxppc-dev@lists.ozlabs.org, Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic
Date: Sat, 14 Aug 2021 07:58:12 -0500 [thread overview]
Message-ID: <20210814125812.GC1583@gate.crashing.org> (raw)
In-Reply-To: <20210813200508.7bqehxgd6ruerds5@google.com>
On Fri, Aug 13, 2021 at 01:05:08PM -0700, Fangrui Song wrote:
> Text relocations are considered very awful by linker developers.
By very few linker developers.
> binutils 2.35 added --enable-textrel-check={no,warn,error}
> https://sourceware.org/bugzilla/show_bug.cgi?id=20824
Yes, some people wanted the default to be configurable. So now we have
a default default that is sane, so most people get to reap the benefits
of having defaults at all, but we also allow other people to shoot
themselves (and people who have to deal with them) in the foot.
"Progress". Changing the defaults should be a one-time event, only done
when the benefits strongly outweigh the costs. Defaults should never be
configurable (by the user).
> I can imagine that in the future some Linux distributions (especially those
> focusing on security) will default their binutils to use
> --enable-textrel-check={no,warn,error}.
How would this be a benefit to security?
> In -no-pie links, R_PPC64_ADDR64 relocations are link-time constants.
Where "link" includes dynamic links as well. There are no constants.
> There are no text relocations, therefore no need for -z notext.
This is a choice by the compiler, nothing more. It saves some process
startup time, and allows slightly more maps to be shared by processes
that run the same images. But it is a tradeoff, so it might change; and
of course it is not an ABI requirement.
Segher
next prev parent reply other threads:[~2021-08-14 13:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 20:49 [PATCH] ppc: add "-z notext" flag to disable diagnostic Bill Wendling
2021-08-12 20:53 ` Nick Desaulniers
2021-08-13 14:13 ` Daniel Axtens
2021-08-13 18:24 ` Bill Wendling
2021-08-13 18:59 ` Nick Desaulniers
2021-08-14 11:01 ` Segher Boessenkool
2021-08-14 11:59 ` Michael Ellerman
2021-08-13 20:05 ` Fangrui Song
2021-08-14 12:58 ` Segher Boessenkool [this message]
2021-08-14 19:34 ` Fāng-ruì Sòng
2021-08-27 14:40 ` Segher Boessenkool
2021-08-13 20:05 ` [PATCH v2] " Bill Wendling
2021-08-27 13:15 ` Michael Ellerman
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=20210814125812.GC1583@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=clang-built-linux@googlegroups.com \
--cc=dja@axtens.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maskray@google.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=paulus@samba.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).