From patchwork Fri Sep 1 17:59:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 22525 Received: (qmail 86054 invoked by alias); 1 Sep 2017 18:00:55 -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 85994 invoked by uid 89); 1 Sep 2017 18:00:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=H*m:gmail X-HELO: mga02.intel.com X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 11/58] Mark internal nscd functions with attribute_hidden [BZ #18822] Date: Fri, 1 Sep 2017 10:59:42 -0700 Message-Id: <20170901180029.9527-12-hjl.tools@gmail.com> In-Reply-To: <20170901180029.9527-1-hjl.tools@gmail.com> References: <20170901180029.9527-1-hjl.tools@gmail.com> Mark internal nscd functions with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * nscd/nscd-client.h (__nscd_get_map_ref): Add attribute_hidden. (__nscd_unmap): Likewise. (__nscd_cache_search): Likewise. (__nscd_get_nl_timestamp): Likewise. (__nscd_getpwnam_r): Likewise. (__nscd_getpwuid_r): Likewise. (__nscd_getgrnam_r): Likewise. (__nscd_getgrgid_r): Likewise. (__nscd_gethostbyname_r): Likewise. (__nscd_gethostbyname2_r): Likewise. (__nscd_gethostbyaddr_r): Likewise. (__nscd_getai): Likewise. (__nscd_getgrouplist): Likewise. (__nscd_getservbyname_r): Likewise. (__nscd_getservbyport_r): Likewise. (__nscd_innetgr): Likewise. (__nscd_setnetgrent): Likewise. --- nscd/nscd-client.h | 12 ++++++++---- nscd/nscd_proto.h | 34 +++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/nscd/nscd-client.h b/nscd/nscd-client.h index 96170bff1b..9155218e1b 100644 --- a/nscd/nscd-client.h +++ b/nscd/nscd-client.h @@ -400,10 +400,12 @@ extern struct mapped_database *__nscd_get_mapping (request_type type, extern struct mapped_database *__nscd_get_map_ref (request_type type, const char *name, volatile struct locked_map_ptr *mapptr, - int *gc_cyclep); + int *gc_cyclep) + attribute_hidden; /* Unmap database. */ -extern void __nscd_unmap (struct mapped_database *mapped); +extern void __nscd_unmap (struct mapped_database *mapped) + attribute_hidden; /* Drop reference of mapping. */ static int @@ -433,7 +435,8 @@ extern struct datahead *__nscd_cache_search (request_type type, const char *key, size_t keylen, const struct mapped_database *mapped, - size_t datalen); + size_t datalen) + attribute_hidden; /* Wrappers around read, readv and write that only read/write less than LEN bytes on error or EOF. */ @@ -447,6 +450,7 @@ extern ssize_t sendfileall (int tofd, int fromfd, off_t off, size_t len) attribute_hidden; /* Get netlink timestamp counter from mapped area or zero. */ -extern uint32_t __nscd_get_nl_timestamp (void); +extern uint32_t __nscd_get_nl_timestamp (void) + attribute_hidden; #endif /* nscd.h */ diff --git a/nscd/nscd_proto.h b/nscd/nscd_proto.h index 7c61821e74..2ec0885349 100644 --- a/nscd/nscd_proto.h +++ b/nscd/nscd_proto.h @@ -39,41 +39,49 @@ extern int __nss_not_use_nscd_netgroup attribute_hidden; extern int __nscd_getpwnam_r (const char *name, struct passwd *resultbuf, char *buffer, size_t buflen, - struct passwd **result); + struct passwd **result) attribute_hidden; extern int __nscd_getpwuid_r (uid_t uid, struct passwd *resultbuf, char *buffer, size_t buflen, - struct passwd **result); + struct passwd **result) attribute_hidden; extern int __nscd_getgrnam_r (const char *name, struct group *resultbuf, char *buffer, size_t buflen, - struct group **result); + struct group **result) attribute_hidden; extern int __nscd_getgrgid_r (gid_t gid, struct group *resultbuf, char *buffer, size_t buflen, - struct group **result); + struct group **result) attribute_hidden; extern int __nscd_gethostbyname_r (const char *name, struct hostent *resultbuf, char *buffer, size_t buflen, - struct hostent **result, int *h_errnop); + struct hostent **result, int *h_errnop) + attribute_hidden; extern int __nscd_gethostbyname2_r (const char *name, int af, struct hostent *resultbuf, char *buffer, size_t buflen, - struct hostent **result, int *h_errnop); + struct hostent **result, int *h_errnop) + attribute_hidden; extern int __nscd_gethostbyaddr_r (const void *addr, socklen_t len, int type, struct hostent *resultbuf, char *buffer, size_t buflen, - struct hostent **result, int *h_errnop); + struct hostent **result, int *h_errnop) + attribute_hidden; extern int __nscd_getai (const char *key, struct nscd_ai_result **result, - int *h_errnop); + int *h_errnop) attribute_hidden; extern int __nscd_getgrouplist (const char *user, gid_t group, long int *size, - gid_t **groupsp, long int limit); + gid_t **groupsp, long int limit) + attribute_hidden; extern int __nscd_getservbyname_r (const char *name, const char *proto, struct servent *result_buf, char *buf, - size_t buflen, struct servent **result); + size_t buflen, struct servent **result) + attribute_hidden; extern int __nscd_getservbyport_r (int port, const char *proto, struct servent *result_buf, char *buf, - size_t buflen, struct servent **result); + size_t buflen, struct servent **result) + attribute_hidden; extern int __nscd_innetgr (const char *netgroup, const char *host, - const char *user, const char *domain); -extern int __nscd_setnetgrent (const char *group, struct __netgrent *datap); + const char *user, const char *domain) + attribute_hidden; +extern int __nscd_setnetgrent (const char *group, struct __netgrent *datap) + attribute_hidden; #endif /* _NSCD_PROTO_H */