Date: Fri, 17 Apr 2020 12:58:35 +0200 From: Florian Weimer <fw@...eb.enyo.de> To: Rich Felker <dalias@...c.org> Cc: musl@...ts.openwall.com Subject: Re: [PATCH] Add REL_COPY size change detection * 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.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.