This is the mail archive of the
mailing list for the binutils project.
Re: Preventing preemption of 'protected' symbols in GNU ld 2.26
- From: Jeff Law <law at redhat dot com>
- To: Cary Coutant <ccoutant at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Joe Groff <jgroff at apple dot com>, Alan Modra <amodra at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 29 Mar 2016 22:04:49 -0600
- Subject: Re: Preventing preemption of 'protected' symbols in GNU ld 2.26
- Authentication-results: sourceware.org; auth=none
- References: <AB592ABD-D6D7-4D2F-A0D6-45738F168DC4 at apple dot com> <BEDD88C6-7F80-45DA-9021-10587244AAE5 at apple dot com> <CAMe9rOq6rmvH458nufzfZnnU_=_n1yysbLzERNy-LWvEmjmN1A at mail dot gmail dot com> <983472E1-A1BC-4970-9CF9-0138A6BAD16D at apple dot com> <CAMe9rOqTTwirymAY6ORp6D_GnCsMc_hYEdy1NbZpG6x5vQc5DQ at mail dot gmail dot com> <6AAD87D2-90F9-4AD7-A195-AC91B76EA6AE at apple dot com> <CAMe9rOqNcYnm1YocG-m7XNDE0g68YQAGe=ULP-G98gaatpxSeA at mail dot gmail dot com> <CAJimCsHfT=cfb4kZysB2W_1HFfOq==TpP=wa47XPGB41MHmGyQ at mail dot gmail dot com>
On 03/29/2016 07:46 PM, Cary Coutant wrote:
And FWIW, there are some folks on the GCC side of things that think that
HJ's change for 65248 is broken and needs to be reverted before gcc-6
However, protected doesn't work this way in older binutils, or with alternative tools like llvm or gold, and it sounds like protected was never intended to work this way either. Rather If gcc is interested in pursuing this optimization, it seems more responsible to me they could investigate introducing language-level annotations that let libraries opt into the optimization, instead of unilaterally breaking things for other binutils clients and introducing new complexity to get back to the original behavior.
Protected symbol never worked correctly on x86 before. My
change closed a few long-standing bugs. There is no going-back.
You keep countering my arguments with assertions like, "it was a bug
and I fixed it," but you present no arguments of your own to support
your position. I'm not sure what long-standing bugs you're referring
to -- the only one I can find, PR target/65248 , was filed by you
yourself, so you can't really use that as support. In fact, PR
ld/15228 , was filed against ld for *not* refusing to make a COPY
relocation to a protected symbol, and Alan fixed that. Gold has the
same bug, and I intend to fix it there, too.
I'm not familiar enough with all the issues, but I am familiar enough
with the work of HJ, Alan and yourself that if you & Alan say HJ's GCC
change is wrong, then, well, it's wrong and needs to be reverted.
It would help me immensely on the GCC side if things if you and Alan
could easily summarize correct behavior and the impact if we were to
just revert HJ's change. A testcase would be amazingly helpful too.
I'm sure I could extract the relevant info out of the thread, but I'm
just buried right now.