This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: PATCHES: Properly handle reference to protected data on x86


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]