mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
Mark internal nss symbols with attribute_hidden [BZ #18822]
Mark internal nss symbols with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. Tested on x86-64 with and without --disable-nscd. [BZ #18822] * grp/initgroups.c (__nss_group_database): Removed. (__nss_initgroups_database): Likewise. * nscd/gai.c (__nss_hosts_database): Likewise. * nss/XXX-lookup.c (DATABASE_NAME_SYMBOL): Likewise. * posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise. * posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise. * posix/tst-rfc3484.c (__nss_hosts_database): Likewise. * sysdeps/posix/getaddrinfo.c (__nss_hosts_database): Likewise. * nss/getXXent.c (INTERNAL (REENTRANT_GETNAME)): Add attribute_hidden. * nss/nsswitch.c (__nss_database_custom): Define only if USE_NSCD is defined. (__nss_configure_lookup): Use __nss_database_custom only if USE_NSCD is defined. * nss/nsswitch.h (__nss_database_custom): Declare only if USE_NSCD is defined. Add attribute_hidden. (__nss_setent): Add attribute_hidden. (__nss_endent): Likewise. (__nss_getent_r): Likewise. (__nss_getent): Likewise. (DEFINE_DATABASE): Declare __nss_##arg##_database.
This commit is contained in:
@@ -73,8 +73,10 @@ static const struct
|
||||
};
|
||||
#define ndatabases (sizeof (databases) / sizeof (databases[0]))
|
||||
|
||||
#ifdef USE_NSCD
|
||||
/* Flags whether custom rules for database is set. */
|
||||
bool __nss_database_custom[NSS_DBSIDX_max];
|
||||
#endif
|
||||
|
||||
|
||||
__libc_lock_define_initialized (static, lock)
|
||||
@@ -304,7 +306,9 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
|
||||
|
||||
/* Install new rules. */
|
||||
*databases[cnt].dbp = new_db;
|
||||
#ifdef USE_NSCD
|
||||
__nss_database_custom[cnt] = true;
|
||||
#endif
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
|
Reference in New Issue
Block a user