[PATCH 2/3] Mark internal nss symbols with attribute_hidden [BZ #18822]
H.J. Lu
hjl.tools@gmail.com
Sun Aug 20 17:18:00 GMT 2017
On Sun, Aug 20, 2017 at 1:08 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * H. J. Lu:
>
>> extern service_user *__nss_group_database attribute_hidden;
>> -service_user *__nss_initgroups_database;
>> +service_user *__nss_initgroups_database attribute_hidden;
>> static bool use_initgroups_entry;
>
> Please use DEFINE_DATABASE in nsswitch.h instead to generate all
> __nss_*_database declarations (and remove the declaration from
> nss/XXX-lookup.c).
Done.
>> diff --git a/nss/getXXent.c b/nss/getXXent.c
>> index aad374197f..31bd24b924 100644
>> --- a/nss/getXXent.c
>> +++ b/nss/getXXent.c
>> @@ -56,7 +56,7 @@
>> /* Prototype of the reentrant version. */
>> extern int INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer,
>> size_t buflen, LOOKUP_TYPE **result
>> - H_ERRNO_PARM);
>> + H_ERRNO_PARM) attribute_hidden;
>
> Ideally, we should have a full complement of prototypes in include/,
> so that we get some type safety here. But until that, this part looks
> fine.
>
>> /* Flags whether custom rules for database is set. */
>> -extern bool __nss_database_custom[NSS_DBSIDX_max];
>> +extern bool __nss_database_custom[NSS_DBSIDX_max] attribute_hidden;
>
> The entire declaration should probably be guarded with #ifndef
> USE_NSCD because if the symbol is used from nscd, it would give wrong
> results.
Done.
Here is the updated patch. Tested on x86-64 with and without --disable-nscd.
OK for master?
Thanks.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Mark-internal-nss-symbols-with-attribute_hidden-BZ-1.patch
Type: text/x-patch
Size: 5622 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170820/ef615337/attachment.bin>
More information about the Libc-alpha
mailing list