From patchwork Fri Aug 18 20:30:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 22234 Received: (qmail 79147 invoked by alias); 18 Aug 2017 20:31:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 78790 invoked by uid 89); 18 Aug 2017 20:30:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=protect X-HELO: mga14.intel.com X-ExtLoop1: 1 Date: Fri, 18 Aug 2017 13:30:44 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH 2/3] Mark internal nss symbols with attribute_hidden [BZ #18822] Message-ID: <20170818203044.GB15188@gmail.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) Mark internal nss symbols with attribute_hidden to allow direct access within libc.so and libc.a without using GOT. OK for master? H.J. --- [BZ #18822] * grp/initgroups.c (__nss_initgroups_database): Add attribute_hidden. * nss/getXXent.c (INTERNAL (REENTRANT_GETNAME)): Likewise. * nss/nsswitch.h (__nss_database_custom): Likewise. --- grp/initgroups.c | 2 +- nss/getXXent.c | 2 +- nss/nsswitch.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grp/initgroups.c b/grp/initgroups.c index 0d5b841796..39fb29f43f 100644 --- a/grp/initgroups.c +++ b/grp/initgroups.c @@ -37,7 +37,7 @@ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t, gid_t **, long int, int *); 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; 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; /* We need to protect the dynamic buffer handling. */ __libc_lock_define_initialized (static, lock); diff --git a/nss/nsswitch.h b/nss/nsswitch.h index 2b86d63ddb..342f6f75d2 100644 --- a/nss/nsswitch.h +++ b/nss/nsswitch.h @@ -106,7 +106,7 @@ enum }; /* 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; /* Warning for NSS functions, which don't require dlopen if glibc was built with --enable-static-nss. */