This is the mail archive of the
mailing list for the binutils project.
Re: RFC: PATCHES: Properly handle reference to protected data on x86
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, GNU C Library <libc-alpha at sourceware dot org>, Binutils <binutils at sourceware dot org>
- Date: Fri, 6 Mar 2015 17:03:21 -0800
- Subject: Re: RFC: PATCHES: Properly handle reference to protected data on x86
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOoKS4BwBSd2T+bcchYOykZ7Gzh2jCMC5J6r0qyEX1u0_Q at mail dot gmail dot com> <20150306041931 dot GE25172 at bubble dot grove dot modra dot org> <CAMe9rOqjWSWgiaGKrQjkAMymFFETF-uSwnWUWOxwJpS58arzEg at mail dot gmail dot com> <20150307001549 dot GA11451 at bubble dot grove dot modra dot org>
On Fri, Mar 6, 2015 at 4:15 PM, Alan Modra <email@example.com> wrote:
> On Fri, Mar 06, 2015 at 05:04:56AM -0800, H.J. Lu wrote:
>> On Thu, Mar 5, 2015 at 8:19 PM, Alan Modra <firstname.lastname@example.org> wrote:
>> > On Wed, Mar 04, 2015 at 03:26:10PM -0800, H.J. Lu wrote:
>> >> Protected symbol means that it can't be pre-emptied. It
>> >> doesn't mean its address won't be external. This is true
>> >> for pointer to protected function. With copy relocation,
>> >> address of protected data defined in the shared library may
>> >> also be external. We only know that for sure at run-time.
>> >> Here are patches for glibc, binutils and GCC to handle it
>> >> properly.
>> >> Any comments?
>> > I'd like to see this pass some more tests. For example
>> > reference in non-PIC exe to var x
>> > protected visibility definition of x in libA
>> > protected visibility definition of x in libB
>> > I suspect you don't have this case correct, but congratulations if you
>> > do! Assuming libA is first on the breadth first search for libraries,
>> > then exe and libA ought to use the same x, but libB have its own x.
>> I believe my new testcases on hjl/pr17711 branch at
>> covers those and they work correctly.
> The test that I see in commit 9ea148bb does not. Please notice that
> I'm asking you about two protected definitions in the libraries, not
> one protected and one with default visibility.
My patch extends my work for protected function pointer to
cover protected data. There is no reason why it shouldn't work.
I updated the testcase to
Please check it out.