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: [PATCH] Enable hidden visibility in libc.a compiled with PIE


On Mon, Aug 21, 2017 at 9:31 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 08/08/17 17:40, H.J. Lu wrote:
>> When building libc.a with PIE, enable hidden visibility to allow direct
>> access to definitions within libc.a without using GOT.
> ...
>> -#if defined SHARED || defined LIBC_NONSHARED
>> +#if defined SHARED || defined LIBC_NONSHARED \
>> +  || (BUILD_PIE_DEFAULT && IS_IN (libc))
>>  # define attribute_hidden __attribute__ ((visibility ("hidden")))
>
> btw what happens if this is enabled for non-pie libc.a ?

It makes those symbols in libc.a hidden.

> i'd expect that to work too (it prevents some symbol
> interpositions?)
>

You can't interpose any symbols in libc.a, PIE or non-PIE.
What my patch does is to avoid GOT/PLT in PIE libc.a when
accessing them within libc.a.


-- 
H.J.


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