This is the mail archive of the
binutils@sourceware.org
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: Rich Felker <dalias at libc dot org>
- Cc: 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: Thu, 5 Mar 2015 09:56:30 -0800
- Subject: Re: RFC: PATCHES: Properly handle reference to protected data on x86
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOr3ScyMRZwEkdOtOWV7Y+3Aj-e2GtU7Rnba64rr6kgA8Q at mail dot gmail dot com> <20150305173247 dot GO23507 at brightrain dot aerifal dot cx>
On Thu, Mar 5, 2015 at 9:32 AM, Rich Felker <dalias@libc.org> wrote:
> On Thu, Mar 05, 2015 at 06:39:10AM -0800, H.J. Lu wrote:
>> On Wed, Mar 4, 2015 at 3:26 PM, H.J. Lu <hjl.tools@gmail.com> 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?
>>
>> This is the binutils patch I checked in. It basically reverted
>> the change for
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=15228
>>
>> on x86. Copy relocations against protected symbols should
>> work.
>
> Does it actually work now though? Last I checked gcc was generating
> wrong code too -- GOT-relative accesses rather than accessing them
> through the GOT. If that's the case, ld has no way to fix the problem.
>
You need to apply both my GCC and glibc patches in
https://gcc.gnu.org/ml/gcc-patches/2015-03/msg00257.html
--
H.J.