Message ID | 20170901180029.9527-19-hjl.tools@gmail.com |
---|---|
State | New |
Headers | show |
Series | Hide internal functions in libc.so | expand |
On 09/01/2017 07:59 PM, H.J. Lu wrote: > 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 attribute_hidden. > (__utmpname): Likewise. > (__getutent): Likewise. I believe this causes: /home/bmg/build/glibcs/s390-linux-gnu/glibc/login/utmpdump.o: In function `main': /home/bmg/build/glibcs/s390-linux-gnu/glibc-src/login/programs/utmpdump.c:93: undefined reference to `getutent' collect2: error: ld returned 1 exit status That's presumably due to the renaming business in sysdeps/unix/sysv/linux/s390/s390-32/getutent*.c Thanks, Florian
On 9/2/17, Florian Weimer <fweimer@redhat.com> wrote: > On 09/01/2017 07:59 PM, H.J. Lu wrote: >> 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 attribute_hidden. >> (__utmpname): Likewise. >> (__getutent): Likewise. > > I believe this causes: > > /home/bmg/build/glibcs/s390-linux-gnu/glibc/login/utmpdump.o: In > function `main': > /home/bmg/build/glibcs/s390-linux-gnu/glibc-src/login/programs/utmpdump.c:93: > undefined reference to `getutent' > collect2: error: ld returned 1 exit status > > That's presumably due to the renaming business in > sysdeps/unix/sysv/linux/s390/s390-32/getutent*.c > Here is the updated patch. Tested with build-many-glibcs.py. OK for master? Thanks.
diff --git a/include/utmp.h b/include/utmp.h index 6b2e262362..38538963e2 100644 --- a/include/utmp.h +++ b/include/utmp.h @@ -4,19 +4,25 @@ # ifndef _ISOMAC /* Now define the internal interfaces. */ -extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp); -extern int __utmpname (const char *__file); -extern struct utmp *__getutent (void); -extern void __setutent (void); -extern void __endutent (void); -extern struct utmp *__getutid (const struct utmp *__id); -extern struct utmp *__getutline (const struct utmp *__line); -extern struct utmp *__pututline (const struct utmp *__utmp_ptr); -extern int __getutent_r (struct utmp *__buffer, struct utmp **__result); +extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp) + attribute_hidden; +extern int __utmpname (const char *__file) attribute_hidden; +extern struct utmp *__getutent (void) attribute_hidden; +extern void __setutent (void) attribute_hidden; +extern void __endutent (void) attribute_hidden; +extern struct utmp *__getutid (const struct utmp *__id) attribute_hidden; +extern struct utmp *__getutline (const struct utmp *__line) + attribute_hidden; +extern struct utmp *__pututline (const struct utmp *__utmp_ptr) + attribute_hidden; +extern int __getutent_r (struct utmp *__buffer, struct utmp **__result) + attribute_hidden; extern int __getutid_r (const struct utmp *__id, struct utmp *__buffer, - struct utmp **__result); + struct utmp **__result) + attribute_hidden; extern int __getutline_r (const struct utmp *__line, - struct utmp *__buffer, struct utmp **__result); + struct utmp *__buffer, struct utmp **__result) + attribute_hidden; libutil_hidden_proto (login_tty)