mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] Add REL_COPY size change detection
Date: Fri, 17 Apr 2020 12:58:35 +0200	[thread overview]
Message-ID: <873692crac.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20200226224820.GD11469@brightrain.aerifal.cx> (Rich Felker's message of "Wed, 26 Feb 2020 17:48:20 -0500")

* Rich Felker:

>> If I recall correctly, the optimization was a factor when rolling out
>> PIE-by-default in Fedora.  I do not know if we can revert it without
>> switching back to fixed-address builds.
>
> I think this is almost surely premature optimization. In almost all
> cases, if there's software where the performance impact makes a
> difference it can be avoided by giving the affected global data
> objects visibility of hidden (if it's not used outside the main
> program anyway) or protected (if it needs to be externally visible).
> But on x86_64 and aarch64, and to some extent on 32-bit arm as well,
> the performance difference of accessing globals via the got vs
> pc-relative is negligible.

I think the main obstacle is that we do not have the required
annotations in the header files.

LTO only for deciding whether calls are local or not could perhaps
solve this.

>> There is also a similar truncation issue for TLS variables, I think.
>
> TLS variables never use copy relocations, except for a short period of
> time on riscv64, where thankfully it was realized to be a mistake and
> reverted. So I don't think this issue applies to TLS.

You are right, the optimization I feared is not actually implemented.

  parent reply	other threads:[~2020-04-17 10:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  5:24 Markus Wichmann
2020-02-26 17:36 ` Rich Felker
2020-02-26 18:38   ` Florian Weimer
2020-02-26 19:00     ` Rich Felker
2020-02-26 19:53       ` Florian Weimer
2020-02-26 22:48         ` Rich Felker
2020-02-27  5:00           ` Fangrui Song
2020-04-17 10:58           ` Florian Weimer [this message]
2020-02-26 20:12   ` Markus Wichmann
2020-02-26 22:02     ` Rich Felker

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=873692crac.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).