diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-10-01 15:51:44 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-10-01 15:51:56 -0700 |
commit | 59c04e67631d370738b80923d42d4d1539d8f95f (patch) | |
tree | f89921d970aa995215b7ae4740832f4b4f1702c4 | |
parent | 4587a421c54a8912b3e24913c7e1501293042b40 (diff) | |
download | glibc-59c04e67631d370738b80923d42d4d1539d8f95f.tar.gz |
Mark internal utmp functions with attribute_hidden [BZ #18822]
Mark internal utmp functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.
[BZ #18822]
* include/utmp.h (__updwtmp): Add libc_hidden_proto.
(__getutent): Likewise.
(__getutid): Likewise.
(__getutline): Likewise.
(__pututline): Likewise.
(__getutent_r): Likewise.
(__getutid_r): Likewise.
(__getutline_r): Likewise.
(__utmpname): Add attribute_hidden.
(__setutent): Likewise.
(__endutent): Likewise.
* login/getutent.c (__getutent): Add libc_hidden_def.
* login/getutent_r.c (__getutent_r): Likewise.
(__pututline): Likewise.
* login/getutid.c (__getutid): Likewise.
* login/getutid_r.c (__getutid_r): Likewise.
* login/getutline.c (__getutline): Likewise.
* login/getutline_r.c (__getutline_r): Likewise.
* login/updwtmp.c (__updwtmp): Likewise.
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | include/utmp.h | 14 | ||||
-rw-r--r-- | login/getutent.c | 1 | ||||
-rw-r--r-- | login/getutent_r.c | 2 | ||||
-rw-r--r-- | login/getutid.c | 1 | ||||
-rw-r--r-- | login/getutid_r.c | 1 | ||||
-rw-r--r-- | login/getutline.c | 1 | ||||
-rw-r--r-- | login/getutline_r.c | 1 | ||||
-rw-r--r-- | login/updwtmp.c | 1 |
9 files changed, 42 insertions, 3 deletions
@@ -1,6 +1,29 @@ 2017-10-01 H.J. Lu <hongjiu.lu@intel.com> [BZ #18822] + * include/utmp.h (__updwtmp): Add libc_hidden_proto. + (__getutent): Likewise. + (__getutid): Likewise. + (__getutline): Likewise. + (__pututline): Likewise. + (__getutent_r): Likewise. + (__getutid_r): Likewise. + (__getutline_r): Likewise. + (__utmpname): Add attribute_hidden. + (__setutent): Likewise. + (__endutent): Likewise. + * login/getutent.c (__getutent): Add libc_hidden_def. + * login/getutent_r.c (__getutent_r): Likewise. + (__pututline): Likewise. + * login/getutid.c (__getutid): Likewise. + * login/getutid_r.c (__getutid_r): Likewise. + * login/getutline.c (__getutline): Likewise. + * login/getutline_r.c (__getutline_r): Likewise. + * login/updwtmp.c (__updwtmp): Likewise. + +2017-10-01 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #18822] * include/dirent.h (__opendir): Always add attribute_hidden. (__fdopendir): Likewise. (__closedir): Likewise. diff --git a/include/utmp.h b/include/utmp.h index 6b2e262362..374184e9b2 100644 --- a/include/utmp.h +++ b/include/utmp.h @@ -5,18 +5,26 @@ /* Now define the internal interfaces. */ extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp); -extern int __utmpname (const char *__file); +libc_hidden_proto (__updwtmp) +extern int __utmpname (const char *__file) attribute_hidden; extern struct utmp *__getutent (void); -extern void __setutent (void); -extern void __endutent (void); +libc_hidden_proto (__getutent) +extern void __setutent (void) attribute_hidden; +extern void __endutent (void) attribute_hidden; extern struct utmp *__getutid (const struct utmp *__id); +libc_hidden_proto (__getutid) extern struct utmp *__getutline (const struct utmp *__line); +libc_hidden_proto (__getutline) extern struct utmp *__pututline (const struct utmp *__utmp_ptr); +libc_hidden_proto (__pututline) extern int __getutent_r (struct utmp *__buffer, struct utmp **__result); +libc_hidden_proto (__getutent_r) extern int __getutid_r (const struct utmp *__id, struct utmp *__buffer, struct utmp **__result); +libc_hidden_proto (__getutid_r) extern int __getutline_r (const struct utmp *__line, struct utmp *__buffer, struct utmp **__result); +libc_hidden_proto (__getutline_r) libutil_hidden_proto (login_tty) diff --git a/login/getutent.c b/login/getutent.c index 114f7dbbc7..2f6ccf0d3b 100644 --- a/login/getutent.c +++ b/login/getutent.c @@ -41,4 +41,5 @@ __getutent (void) return result; } +libc_hidden_def (__getutent) weak_alias (__getutent, getutent) diff --git a/login/getutent_r.c b/login/getutent_r.c index 62272a2841..1b126f088a 100644 --- a/login/getutent_r.c +++ b/login/getutent_r.c @@ -151,6 +151,7 @@ __getutent_r (struct utmp *buffer, struct utmp **result) return retval; } +libc_hidden_def (__getutent_r) weak_alias (__getutent_r, getutent_r) @@ -167,6 +168,7 @@ __pututline (const struct utmp *data) return buffer; } +libc_hidden_def (__pututline) weak_alias (__pututline, pututline) diff --git a/login/getutid.c b/login/getutid.c index 003bc657e6..62924f0fcf 100644 --- a/login/getutid.c +++ b/login/getutid.c @@ -39,4 +39,5 @@ __getutid (const struct utmp *id) return result; } +libc_hidden_def (__getutid) weak_alias (__getutid, getutid) diff --git a/login/getutid_r.c b/login/getutid_r.c index f82301322f..36ddbb228a 100644 --- a/login/getutid_r.c +++ b/login/getutid_r.c @@ -59,4 +59,5 @@ __getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result) return -1; #endif } +libc_hidden_def (__getutid_r) weak_alias (__getutid_r, getutid_r) diff --git a/login/getutline.c b/login/getutline.c index f5291e8a8e..636b8feec8 100644 --- a/login/getutline.c +++ b/login/getutline.c @@ -40,4 +40,5 @@ __getutline (const struct utmp *line) return result; } +libc_hidden_def (__getutline) weak_alias (__getutline, getutline) diff --git a/login/getutline_r.c b/login/getutline_r.c index 1a6f1688ee..3adc3d0d66 100644 --- a/login/getutline_r.c +++ b/login/getutline_r.c @@ -42,4 +42,5 @@ __getutline_r (const struct utmp *line, struct utmp *buffer, return retval; } +libc_hidden_def (__getutline_r) weak_alias (__getutline_r, getutline_r) diff --git a/login/updwtmp.c b/login/updwtmp.c index 7788614ed3..3fcbaf643d 100644 --- a/login/updwtmp.c +++ b/login/updwtmp.c @@ -31,4 +31,5 @@ __updwtmp (const char *wtmp_file, const struct utmp *utmp) (*__libc_utmp_file_functions.updwtmp) (file_name, utmp); } +libc_hidden_def (__updwtmp) weak_alias (__updwtmp, updwtmp) |