This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libc.so: Replace nscd_hash.os with libc-nscd_hash.os [BZ #22459]
On Mon, Nov 20, 2017 at 5:06 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 11/20/2017 02:02 PM, H.J. Lu wrote:
>>
>> On Mon, Nov 20, 2017 at 1:02 AM, Florian Weimer <fweimer@redhat.com>
>> wrote:
>>>
>>> On 11/19/2017 08:44 PM, H.J. Lu wrote:
>>>>
>>>>
>>>> nscd_hash.os is needed both libc.so as well as nscd. Since nscd_hash.os
>>>> is compiled as the part of nscd, when -fstack-protector-all is used,
>>>> nscd_hash.os calls __stack_chk_fail via PLT, which leads to
>>>>
>>>> FAIL: elf/check-localplt
>>>> Extra PLT reference: libc.so: __stack_chk_fail
>>>>
>>>> This patch replaces nscd_hash.os with libc-nscd_hash.os in libc_pic.a
>>>> to avoid calling __stack_chk_fail via PLT inside of libc.so.
>>>>
>>>> Any comments?
>>>
>>>
>>>
>>> Considering that nscd/nscd_hash.c is itself another #include wrapper, I
>>> think it is time to clean this up.
>>>
>>> The hash function algorithm is already part of the public ABI because the
>>> nscd mappings require it, so we might as well export it, which is
>>> implemented in the attached patch.
>>
>>
>> Do we need to export it in GLIBC_2.27 space? I prefer GLIBC_PRIVATE.
>
>> Otherwise, it looks good to me.
>
> The libnsl symbol isn't GLIBC_PRIVATE, but perhaps should have been.
You added __nss_hash to libc.abilist. Shouldn't it be in libc.so?
> I'm somewhat in favor of exporting this because independent nscd
> implementations will need to implement the exact same hash function.
Do we support independent nscd implementation? I think we should avoid
exporting non-standard internal functions in public name space. But this is
my personal opinion. If others believe it is OK, it is fine with me.
--
H.J.