[49/58] Hide internal __nis_hash function [BZ #18822]
Commit Message
Hide internal __nis_hash function to allow direct access within libc.so
and libc.a without using GOT nor PLT.
[BZ #18822]
* nscd/nscd_helper.c (__nis_hash): New prototype.
---
nscd/nscd_helper.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __nis_hash function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> [BZ #18822]
> * nscd/nscd_helper.c (__nis_hash): New prototype.
Tested with build-many-glibcs.py. I am checking it in.
H.J.
@@ -443,6 +443,11 @@ __nscd_get_map_ref (request_type type, const char *name,
#define MINIMUM_HASHENTRY_SIZE \
(offsetof (struct hashentry, dellist) + sizeof (int32_t))
+/* __nis_hash is defined in nis_hash.c which is included both libnsl
+ and libc. Since the one in libnsl is exported and the one in libc
+ is hidden, __nis_hash is marked as hidden where it is referenced,
+ not where it is defined. */
+extern __typeof (__nis_hash) __nis_hash attribute_hidden;
/* Don't return const struct datahead *, as eventhough the record
is normally constant, it can change arbitrarily during nscd