public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/58] Hide internal functions in libc.so
@ 2017-09-01 18:00 H.J. Lu
  2017-09-01 18:00 ` [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822] H.J. Lu
                   ` (58 more replies)
  0 siblings, 59 replies; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

On x86,

# readelf -rW libc_pic.a | grep " __" | grep PLT32  | awk '{ print $5 }' | sort | uniq

shows that many internal functions are called via PLT in libc.so.  This
series of patches hides internal functions to allow direct access within
libc.so and libc.a without using GOT nor PLT.

H.J. Lu (58):
  Mark internal functions with attribute_hidden [BZ #18822]
  Mark 3 *_internal functions with attribute_hidden [BZ #18822]
  Mark __internal_statvfs[64] with attribute_hidden [BZ #18822]
  Mark ____wcsto*_l_internal functions with attribute_hidden [BZ #18822]
  Mark internal argp functions with attribute_hidden [BZ #18822]
  Mark internal unistd functions with attribute_hidden [BZ #18822]
  Mark internal grp/pwd/shadow functions with attribute_hidden [BZ
    #18822]
  Mark __dso_handle as hidden [BZ #18822]
  Mark internal wchar functions with attribute_hidden [BZ #18822]
  Mark internal gmp functions with attribute_hidden [BZ #18822]
  Mark internal nscd functions with attribute_hidden [BZ #18822]
  Mark internal time functions with attribute_hidden [BZ #18822]
  Mark internal statfs functions with attribute_hidden [BZ #18822]
  Mark internal gshadow functions with attribute_hidden [BZ #18822]
  Mark internal stdio functions with attribute_hidden [BZ #18822]
  Mark internal getXXXbyYYY functions with attribute_hidden [BZ #18822]
  Mark internal dirent functions with attribute_hidden [BZ #18822]
  Mark internal utmp functions with attribute_hidden [BZ #18822]
  Mark internal stdlib functions with attribute_hidden [BZ #18822]
  Hide internal regex functions [BZ #18822]
  Hide __readv and __writev [BZ #18822]
  Mark internal rpc functions with attribute_hidden [BZ #18822]
  Mark internal netlink functions with attribute_hidden [BZ #18822]
  Hide __chmod and __mkdir [BZ #18822]
  Hide internal sysinfo functions [BZ #18822]
  Mark internal intl functions with attribute_hidden [BZ #18822]
  Hide internal __ioctl function [BZ #18822]
  Hide internal __malloc_check_init function [BZ #18822]
  Hide internal __mremap function [BZ #18822]
  Hide __posix_spawn_file_actions_realloc/__spawni [BZ #18822]
  Hide internal __strsep function [BZ #18822]
  Hide internal signal functions [BZ #18822]
  Hide internal __sysinfo function [BZ #18822]
  Hide internal __assert_fail_base function [BZ #18822]
  Hide internal __tdestroy function [BZ #18822]
  Hide internal __fopen_maybe_mmap function [BZ #18822]
  Hide internal __bsd_getpt function [BZ #18822]
  Move hidden_proto (__dl_iterate_phdr) to include/link.h [BZ #18822]
  Hide internal __get_sol function [BZ #18822]
  Hide internal __gettextparse function [BZ #18822]
  Hide internal idna functions [BZ #18822]
  Hide internal __ifreq function [BZ #18822]
  Hide internal __hasmntopt function [BZ #18822]
  Hide internal __hash_string function [BZ #18822]
  Hide internal __sched_setparam function [BZ #18822]
  Hide internal __vstrfmon_l function [BZ #18822]
  Hide internal __setrlimit function [BZ #18822]
  Hide internal __tcgetattr function [BZ #18822]
  Hide internal __nis_hash function [BZ #18822]
  Hide internal __setfpucw function [BZ #18822]
  Hide internal __init_misc function [BZ #18822]
  Hide internal __libc_print_version function [BZ #18822]
  Hide internal __moncontrol function [BZ #18822]
  Hide internal __new_exitfn function [BZ #18822]
  Hide internal __new_getrlimit function [BZ #18822]
  Hide internal __glob64 function [BZ #18822]
  Hide internal __sched_setaffinity_new function [BZ #18822]
  Hide internal fadvise64/fallocate64 functions [BZ #18822]

 argp/argp-fmtstream.c                              |  2 +-
 argp/argp-fs-xinl.c                                |  2 +-
 argp/argp-help.c                                   |  4 +-
 argp/argp-parse.c                                  |  2 +-
 argp/argp-xinl.c                                   |  2 +-
 csu/version.c                                      |  2 +-
 dlfcn/modatexit.c                                  |  2 -
 dlfcn/modcxaatexit.c                               |  1 -
 dlfcn/tstatexit.c                                  |  8 ---
 dlfcn/tstcxaatexit.c                               |  8 ---
 elf/dl-iteratephdr.c                               |  1 -
 gmon/gmon.c                                        |  2 +
 iconv/gconv_int.h                                  | 43 +++++++++------
 include/aliases.h                                  |  3 +-
 include/argp-fmtstream.h                           | 19 +++++++
 include/argp.h                                     | 10 ++++
 include/assert.h                                   |  2 +-
 include/dirent.h                                   | 13 ++---
 include/dlfcn.h                                    |  3 +-
 include/fpu_control.h                              |  2 +-
 include/glob.h                                     |  1 +
 include/gmp.h                                      | 33 +++++++++---
 include/grp.h                                      |  6 +--
 include/gshadow.h                                  |  6 ++-
 include/idna.h                                     |  8 +++
 include/ifreq.h                                    | 14 +++++
 include/libc-internal.h                            |  2 +-
 include/link.h                                     |  1 +
 include/malloc.h                                   |  2 +
 include/mntent.h                                   |  1 +
 include/monetary.h                                 |  3 +-
 include/netdb.h                                    | 30 +++++++----
 include/plural-exp.h                               |  8 +++
 include/pwd.h                                      |  6 +--
 include/regex.h                                    |  6 ++-
 include/rpc/netdb.h                                |  4 +-
 include/rpc/rpc.h                                  |  8 +--
 include/sched.h                                    |  1 +
 include/search.h                                   |  1 +
 include/shadow.h                                   |  7 +--
 include/signal.h                                   |  4 ++
 include/stdio.h                                    | 20 +++----
 include/stdlib.h                                   | 63 +++++++++++++---------
 include/string.h                                   |  1 +
 include/sys/ioctl.h                                |  1 +
 include/sys/mman.h                                 |  1 +
 include/sys/resource.h                             |  1 +
 include/sys/stat.h                                 |  2 +
 include/sys/statfs.h                               |  9 ++--
 include/sys/statvfs.h                              |  6 ++-
 include/sys/sysinfo.h                              |  6 ++-
 include/sys/uio.h                                  |  2 +
 include/termios.h                                  |  1 +
 include/time.h                                     | 32 ++++++-----
 include/unistd.h                                   | 60 +++++++++++----------
 include/utmp.h                                     | 28 ++++++----
 include/wchar.h                                    | 61 ++++++++++++++++-----
 inet/getnameinfo.c                                 |  4 +-
 intl/gettextP.h                                    | 17 +++---
 intl/hash-string.h                                 |  3 +-
 intl/plural-exp.c                                  |  2 +-
 intl/plural-exp.h                                  |  5 +-
 io/chmod.c                                         |  1 +
 io/mkdir.c                                         |  1 +
 libio/iolibio.h                                    |  5 +-
 locale/coll-lookup.h                               |  6 ++-
 malloc/mtrace.c                                    |  3 +-
 misc/getsysstats.c                                 |  4 ++
 misc/ioctl.c                                       |  1 +
 misc/mntent_r.c                                    |  1 +
 misc/readv.c                                       |  1 +
 misc/tsearch.c                                     |  1 +
 misc/writev.c                                      |  1 +
 nptl/pthread_atfork.c                              |  7 +--
 nptl/tst-atfork2mod.c                              |  1 -
 nscd/nscd-client.h                                 | 12 +++--
 nscd/nscd_helper.c                                 |  5 ++
 nscd/nscd_proto.h                                  | 34 +++++++-----
 nss/getXXbyYY.c                                    |  3 +-
 posix/regcomp.c                                    |  2 +
 posix/regexec.c                                    |  2 +
 posix/sched_setp.c                                 |  1 +
 posix/spawn_int.h                                  |  5 +-
 posix/wordexp-test.c                               |  4 +-
 resolv/gai_misc.h                                  | 15 ++++--
 resource/setrlimit.c                               |  1 +
 signal/kill.c                                      |  1 +
 signal/sigblock.c                                  |  1 +
 signal/sigprocmask.c                               |  1 +
 stdlib/at_quick_exit.c                             |  7 +--
 stdlib/atexit.c                                    |  8 +--
 stdlib/canonicalize.c                              |  1 +
 stdlib/exit.h                                      |  3 +-
 stdlib/gmp-impl.h                                  | 12 +++--
 stdlib/tst-tls-atexit-lib.c                        |  2 -
 string/strsep.c                                    |  1 +
 sysdeps/generic/aio_misc.h                         |  3 +-
 sysdeps/generic/ifreq.h                            | 12 -----
 sysdeps/generic/ldsodefs.h                         |  8 +--
 sysdeps/i386/machine-gmon.h                        |  2 +-
 sysdeps/ieee754/float128/wcstof128.c               |  3 --
 sysdeps/ieee754/float128/wcstof128_l.c             |  3 --
 sysdeps/mach/getsysstats.c                         |  4 ++
 sysdeps/mach/hurd/chmod.c                          |  1 +
 sysdeps/mach/hurd/ifreq.h                          | 12 -----
 sysdeps/mach/hurd/ioctl.c                          |  1 +
 sysdeps/mach/hurd/kill.c                           |  1 +
 sysdeps/mach/hurd/mkdir.c                          |  1 +
 sysdeps/mach/hurd/readdir64.c                      |  1 +
 sysdeps/mach/hurd/setrlimit.c                      |  1 +
 sysdeps/mach/hurd/sigaltstack.c                    |  1 +
 sysdeps/mach/hurd/sigprocmask.c                    |  1 +
 sysdeps/posix/getaddrinfo.c                        |  5 +-
 sysdeps/posix/readv.c                              |  1 +
 sysdeps/posix/sigblock.c                           |  1 +
 sysdeps/posix/writev.c                             |  1 +
 sysdeps/unix/bsd/tcgetattr.c                       |  1 +
 sysdeps/unix/sysv/linux/aarch64/ioctl.S            |  1 +
 sysdeps/unix/sysv/linux/alpha/sigprocmask.c        |  1 +
 sysdeps/unix/sysv/linux/fstatvfs.c                 |  6 +--
 sysdeps/unix/sysv/linux/fstatvfs64.c               |  7 +--
 sysdeps/unix/sysv/linux/generic/chmod.c            |  2 +
 sysdeps/unix/sysv/linux/generic/mkdir.c            |  2 +
 sysdeps/unix/sysv/linux/getpt.c                    |  2 +-
 sysdeps/unix/sysv/linux/getrlimit64.c              |  3 +-
 sysdeps/unix/sysv/linux/getsourcefilter.c          |  1 +
 sysdeps/unix/sysv/linux/getsourcefilter.h          | 20 +++++++
 sysdeps/unix/sysv/linux/getsysstats.c              |  4 ++
 sysdeps/unix/sysv/linux/i386/glob64.c              |  1 +
 sysdeps/unix/sysv/linux/i386/olddirent.h           |  3 +-
 sysdeps/unix/sysv/linux/i386/readdir64.c           |  1 +
 sysdeps/unix/sysv/linux/ia64/sigprocmask.c         |  1 +
 sysdeps/unix/sysv/linux/include/sys/sysinfo.h      |  2 +-
 sysdeps/unix/sysv/linux/internal_statvfs.c         |  2 +-
 sysdeps/unix/sysv/linux/internal_statvfs.h         | 26 +++++++++
 sysdeps/unix/sysv/linux/m68k/mremap.S              |  1 +
 sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S    |  1 +
 sysdeps/unix/sysv/linux/netlinkaccess.h            | 10 ++--
 sysdeps/unix/sysv/linux/pathconf.h                 | 12 +++--
 sysdeps/unix/sysv/linux/posix_fadvise64.c          |  2 +
 sysdeps/unix/sysv/linux/posix_fallocate64.c        |  2 +
 sysdeps/unix/sysv/linux/powerpc/ioctl.c            |  1 +
 sysdeps/unix/sysv/linux/readdir64.c                |  1 +
 sysdeps/unix/sysv/linux/readv.c                    |  2 +
 sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c |  1 +
 sysdeps/unix/sysv/linux/sched_setaffinity.c        |  4 ++
 sysdeps/unix/sysv/linux/setrlimit.c                |  1 +
 sysdeps/unix/sysv/linux/setrlimit64.c              |  3 ++
 sysdeps/unix/sysv/linux/setsourcefilter.c          |  5 +-
 sysdeps/unix/sysv/linux/sigprocmask.c              |  1 +
 .../unix/sysv/linux/sparc/sparc64/sigprocmask.c    |  1 +
 sysdeps/unix/sysv/linux/statvfs.c                  |  6 +--
 sysdeps/unix/sysv/linux/statvfs64.c                |  7 +--
 sysdeps/unix/sysv/linux/tcgetattr.c                |  1 +
 sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S        |  1 +
 sysdeps/unix/sysv/linux/wordsize-64/readdir.c      |  1 +
 sysdeps/unix/sysv/linux/writev.c                   |  2 +
 sysdeps/unix/sysv/linux/x86_64/sigprocmask.c       |  1 +
 termios/tcgetattr.c                                |  1 +
 wcsmbs/wcsmbsload.h                                |  9 ++--
 wcsmbs/wcstod.c                                    |  3 --
 wcsmbs/wcstod_l.c                                  |  3 --
 wcsmbs/wcstof.c                                    |  3 --
 wcsmbs/wcstof_l.c                                  |  3 --
 wcsmbs/wcstol_l.c                                  |  3 --
 wcsmbs/wcstold.c                                   |  3 --
 wcsmbs/wcstold_l.c                                 |  3 --
 wcsmbs/wcstoll_l.c                                 |  3 --
 wcsmbs/wcstoul_l.c                                 |  3 --
 wcsmbs/wcstoull_l.c                                |  4 --
 170 files changed, 635 insertions(+), 384 deletions(-)
 create mode 100644 include/argp-fmtstream.h
 create mode 100644 include/idna.h
 create mode 100644 include/ifreq.h
 create mode 100644 include/plural-exp.h
 create mode 100644 sysdeps/unix/sysv/linux/getsourcefilter.h
 create mode 100644 sysdeps/unix/sysv/linux/internal_statvfs.h

-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 50/58] Hide internal __setfpucw function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (11 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 07/58] Mark internal grp/pwd/shadow " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  0:51   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 57/58] Hide internal __sched_setaffinity_new " H.J. Lu
                   ` (45 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __setfpucw function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/fpu_control.h (__setfpucw): Add attribute_hidden.
---
 include/fpu_control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/fpu_control.h b/include/fpu_control.h
index 4498a83b87..5c6b386278 100644
--- a/include/fpu_control.h
+++ b/include/fpu_control.h
@@ -4,7 +4,7 @@
 # ifndef _ISOMAC
 
 /* Called at startup.  It can be used to manipulate fpu control register.  */
-extern void __setfpucw (fpu_control_t);
+extern void __setfpucw (fpu_control_t) attribute_hidden;
 
 # endif /* !_ISOMAC */
 #endif /* fpu_control.h */
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 53/58] Hide internal __moncontrol function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (2 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 01/58] Mark internal " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  0:56   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 55/58] Hide internal __new_getrlimit " H.J. Lu
                   ` (54 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __moncontrol function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* mon/gmon.c (__moncontrol): Add libc_hidden_proto and
	libc_hidden_def.
---
 gmon/gmon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gmon/gmon.c b/gmon/gmon.c
index 4e48eba1bf..f1aa3b776c 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -62,6 +62,7 @@ static int	s_scale;
 
 void moncontrol (int mode);
 void __moncontrol (int mode);
+libc_hidden_proto (__moncontrol)
 static void write_hist (int fd);
 static void write_call_graph (int fd);
 static void write_bb_counts (int fd);
@@ -93,6 +94,7 @@ __moncontrol (int mode)
       p->state = GMON_PROF_OFF;
     }
 }
+libc_hidden_def (__moncontrol)
 weak_alias (__moncontrol, moncontrol)
 
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 12/58] Mark internal time functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (9 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 51/58] Hide internal __init_misc function " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 22:01   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 07/58] Mark internal grp/pwd/shadow " H.J. Lu
                   ` (47 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal time functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/time.h (__tzstring): Add attribute_hidden.
	(__tzfile_read): Likewise.
	(__tzfile_compute): Likewise.
	(__tzfile_default): Likewise.
	(__tzset_parse_tz): Likewise.
	(__offtime): Likewise.
	(__asctime_r): Likewise.
	(__tzset): Likewise.
	(__tz_convert): Likewise.
	(__getdate_r): Likewise.
	(__getclktck): Likewise.
---
 include/time.h | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/include/time.h b/include/time.h
index e8c07bbfea..aab26d7768 100644
--- a/include/time.h
+++ b/include/time.h
@@ -33,18 +33,19 @@ extern const unsigned short int __mon_yday[2][13] attribute_hidden;
 extern struct tm _tmbuf attribute_hidden;
 
 /* Defined in tzset.c.  */
-extern char *__tzstring (const char *string);
+extern char *__tzstring (const char *string) attribute_hidden;
 
 extern int __use_tzfile attribute_hidden;
 
 extern void __tzfile_read (const char *file, size_t extra,
-			   char **extrap);
+			   char **extrap) attribute_hidden;
 extern void __tzfile_compute (time_t timer, int use_localtime,
 			      long int *leap_correct, int *leap_hit,
-			      struct tm *tp);
+			      struct tm *tp) attribute_hidden;
 extern void __tzfile_default (const char *std, const char *dst,
-			      long int stdoff, long int dstoff);
-extern void __tzset_parse_tz (const char *tz);
+			      long int stdoff, long int dstoff)
+  attribute_hidden;
+extern void __tzset_parse_tz (const char *tz) attribute_hidden;
 extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
   __THROW attribute_hidden;
 
@@ -68,22 +69,25 @@ libc_hidden_proto (__gmtime_r)
    Return nonzero if successful.  */
 extern int __offtime (const time_t *__timer,
 		      long int __offset,
-		      struct tm *__tp);
+		      struct tm *__tp) attribute_hidden;
 
-extern char *__asctime_r (const struct tm *__tp, char *__buf);
-extern void __tzset (void);
+extern char *__asctime_r (const struct tm *__tp, char *__buf)
+  attribute_hidden;
+extern void __tzset (void) attribute_hidden;
 
 /* Prototype for the internal function to get information based on TZ.  */
-extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
+extern struct tm *__tz_convert (const time_t *timer, int use_localtime,
+				struct tm *tp) attribute_hidden;
 
 extern int __nanosleep (const struct timespec *__requested_time,
 			struct timespec *__remaining);
 hidden_proto (__nanosleep)
-extern int __getdate_r (const char *__string, struct tm *__resbufp);
+extern int __getdate_r (const char *__string, struct tm *__resbufp)
+  attribute_hidden;
 
 
 /* Determine CLK_TCK value.  */
-extern int __getclktck (void);
+extern int __getclktck (void) attribute_hidden;
 
 
 /* strptime support.  */
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 51/58] Hide internal __init_misc function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (8 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 10/58] Mark internal gmp " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  0:53   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 12/58] Mark internal time functions with attribute_hidden " H.J. Lu
                   ` (48 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __init_misc function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/libc-internal.h (__init_misc): Add attribute_hidden.
---
 include/libc-internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/libc-internal.h b/include/libc-internal.h
index c501c95eb5..7403c24e25 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -47,7 +47,7 @@ libc_hidden_proto (__libc_freeres)
 extern void __libc_thread_freeres (void);
 
 /* Define and initialize `__progname' et. al.  */
-extern void __init_misc (int, char **, char **);
+extern void __init_misc (int, char **, char **) attribute_hidden;
 
 # if IS_IN (rtld)
 extern __typeof (__profile_frequency) __profile_frequency attribute_hidden;
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 52/58] Hide internal __libc_print_version function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (13 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 57/58] Hide internal __sched_setaffinity_new " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  0:54   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 09/58] Mark internal wchar functions with attribute_hidden " H.J. Lu
                   ` (43 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __libc_print_version function to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* csu/version.c (__libc_print_version): Add attribute_hidden.
---
 csu/version.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/csu/version.c b/csu/version.c
index f3992ab6c8..bfb0303a8d 100644
--- a/csu/version.c
+++ b/csu/version.c
@@ -39,7 +39,7 @@ LIBC_ABIS_STRING
 
 #include <unistd.h>
 
-extern void __libc_print_version (void);
+extern void __libc_print_version (void) attribute_hidden;
 void
 __libc_print_version (void)
 {
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 56/58] Hide internal __glob64 function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (15 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 09/58] Mark internal wchar functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  1:01   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden " H.J. Lu
                   ` (41 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __glob64 function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/glob.h (__glob64): Add libc_hidden_proto.
	* sysdeps/unix/sysv/linux/i386/glob64.c (__glob64): Add
	libc_hidden_def.
---
 include/glob.h                        | 1 +
 sysdeps/unix/sysv/linux/i386/glob64.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/glob.h b/include/glob.h
index 228fe30ca8..1d2f78793e 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -12,6 +12,7 @@ extern int __glob_pattern_p (const char *__pattern, int __quote);
 extern int __glob64 (const char *__pattern, int __flags,
 		     int (*__errfunc) (const char *, int),
 		     glob64_t *__pglob);
+libc_hidden_proto (__glob64)
 #endif
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/glob64.c b/sysdeps/unix/sysv/linux/i386/glob64.c
index 956cb0474a..a2cd1e9c3b 100644
--- a/sysdeps/unix/sysv/linux/i386/glob64.c
+++ b/sysdeps/unix/sysv/linux/i386/glob64.c
@@ -43,6 +43,7 @@
 
 libc_hidden_def (globfree64)
 
+libc_hidden_def (__glob64)
 versioned_symbol (libc, __glob64, glob64, GLIBC_2_2);
 libc_hidden_ver (__glob64, glob64)
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 57/58] Hide internal __sched_setaffinity_new function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (12 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 50/58] Hide internal __setfpucw function " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  1:03   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 52/58] Hide internal __libc_print_version " H.J. Lu
                   ` (44 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __sched_setaffinity_new function to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/sched_setaffinity.c
	(__sched_setaffinity_new): Add libc_hidden_proto and
	libc_hidden_def.
---
 sysdeps/unix/sysv/linux/sched_setaffinity.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/sched_setaffinity.c b/sysdeps/unix/sysv/linux/sched_setaffinity.c
index 8854e72c67..9a40b581ae 100644
--- a/sysdeps/unix/sysv/linux/sched_setaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_setaffinity.c
@@ -26,6 +26,9 @@
 
 #ifdef __NR_sched_setaffinity
 
+extern int __sched_setaffinity_new (pid_t, size_t, const cpu_set_t *);
+libc_hidden_proto (__sched_setaffinity_new)
+
 int
 __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
 {
@@ -38,6 +41,7 @@ __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
 
   return result;
 }
+libc_hidden_def (__sched_setaffinity_new)
 versioned_symbol (libc, __sched_setaffinity_new, sched_setaffinity,
 		  GLIBC_2_3_4);
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 09/58] Mark internal wchar functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (14 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 52/58] Hide internal __libc_print_version " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 21:45   ` H.J. Lu
  2017-11-13 10:16   ` Stefan Liebler
  2017-09-01 18:00 ` [PATCH 56/58] Hide internal __glob64 function " H.J. Lu
                   ` (42 subsequent siblings)
  58 siblings, 2 replies; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal wchar functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/wchar.h (__wcsnlen): Add attribute_hidden.
	(__wcscat): Likewise.
	(__btowc): Likewise.
	(__wcrtomb): Likewise.
	(__mbsrtowcs): Likewise.
	(__wcsrtombs): Likewise.
	(__mbsnrtowcs): Likewise.
	(__wcsnrtombs): Likewise.
	(__wcsncpy): Likewise.
	(__wcpncpy): Likewise.
	(__wmemcpy): Likewise.
	(__wmempcpy): Likewise.
	(__wmemmove): Likewise.
	(__wcschrnul): Likewise.
	(__vfwscanf): Likewise.
	(__vswprintf): Likewise.
	(__fwprintf): Likewise.
	(__vfwprintf): Likewise.
---
 include/wchar.h | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/include/wchar.h b/include/wchar.h
index eb472daefb..24b2eaa5f9 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -152,9 +152,10 @@ extern int __wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
      __attribute_pure__;
 extern size_t __wcslen (const wchar_t *__s) __attribute_pure__;
 extern size_t __wcsnlen (const wchar_t *__s, size_t __maxlen)
-     __attribute_pure__;
-extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src);
-extern wint_t __btowc (int __c);
+     attribute_hidden __attribute_pure__;
+extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src)
+     attribute_hidden;
+extern wint_t __btowc (int __c) attribute_hidden;
 extern int __mbsinit (const __mbstate_t *__ps);
 extern size_t __mbrtowc (wchar_t *__restrict __pwc,
 			 const char *__restrict __s, size_t __n,
@@ -162,34 +163,39 @@ extern size_t __mbrtowc (wchar_t *__restrict __pwc,
 libc_hidden_proto (__mbrtowc)
 libc_hidden_proto (__mbrlen)
 extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
-			 __mbstate_t *__restrict __ps);
+			 __mbstate_t *__restrict __ps) attribute_hidden;
 extern size_t __mbsrtowcs (wchar_t *__restrict __dst,
 			   const char **__restrict __src,
-			   size_t __len, __mbstate_t *__restrict __ps);
+			   size_t __len, __mbstate_t *__restrict __ps)
+     attribute_hidden;
 extern size_t __wcsrtombs (char *__restrict __dst,
 			   const wchar_t **__restrict __src,
-			   size_t __len, __mbstate_t *__restrict __ps);
+			   size_t __len, __mbstate_t *__restrict __ps)
+     attribute_hidden;
 extern size_t __mbsnrtowcs (wchar_t *__restrict __dst,
 			    const char **__restrict __src, size_t __nmc,
-			    size_t __len, __mbstate_t *__restrict __ps);
+			    size_t __len, __mbstate_t *__restrict __ps)
+     attribute_hidden;
 extern size_t __wcsnrtombs (char *__restrict __dst,
 			    const wchar_t **__restrict __src,
 			    size_t __nwc, size_t __len,
-			    __mbstate_t *__restrict __ps);
+			    __mbstate_t *__restrict __ps)
+     attribute_hidden;
 extern wchar_t *__wcsncpy (wchar_t *__restrict __dest,
-			   const wchar_t *__restrict __src, size_t __n);
+			   const wchar_t *__restrict __src, size_t __n)
+     attribute_hidden;
 extern wchar_t *__wcpcpy (wchar_t *__dest, const wchar_t *__src);
 extern wchar_t *__wcpncpy (wchar_t *__dest, const wchar_t *__src,
-			   size_t __n);
+			   size_t __n) attribute_hidden;
 extern wchar_t *__wmemcpy (wchar_t *__s1, const wchar_t *s2,
-			   size_t __n);
+			   size_t __n) attribute_hidden;
 extern wchar_t *__wmempcpy (wchar_t *__restrict __s1,
 			    const wchar_t *__restrict __s2,
-			    size_t __n);
+			    size_t __n) attribute_hidden;
 extern wchar_t *__wmemmove (wchar_t *__s1, const wchar_t *__s2,
-			    size_t __n);
+			    size_t __n) attribute_hidden;
 extern wchar_t *__wcschrnul (const wchar_t *__s, wchar_t __wc)
-     __attribute_pure__;
+     attribute_hidden __attribute_pure__;
 
 extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
 			       size_t __ns) __THROW;
@@ -197,17 +203,21 @@ extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
 extern int __vfwscanf (__FILE *__restrict __s,
 		       const wchar_t *__restrict __format,
 		       __gnuc_va_list __arg)
+     attribute_hidden
      /* __attribute__ ((__format__ (__wscanf__, 2, 0)) */;
 extern int __vswprintf (wchar_t *__restrict __s, size_t __n,
 			const wchar_t *__restrict __format,
 			__gnuc_va_list __arg)
+     attribute_hidden
      /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
 extern int __fwprintf (__FILE *__restrict __s,
 		       const wchar_t *__restrict __format, ...)
+     attribute_hidden
      /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
 extern int __vfwprintf (__FILE *__restrict __s,
 			const wchar_t *__restrict __format,
 			__gnuc_va_list __arg)
+     attribute_hidden
      /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
 extern int __vfwprintf_chk (FILE *__restrict __s, int __flag,
 			    const wchar_t *__restrict __format,
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-09-03  8:21   ` Florian Weimer
  2017-09-01 18:00 ` [PATCH 18/58] Mark internal utmp functions with attribute_hidden " H.J. Lu
                   ` (57 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Since __dso_handle is always defined by either crtbegin.o from GCC or
dso_handle.c, it should be marked as hidden and be passed directly.

	[BZ #18822]
	* dlfcn/modatexit.c (foo): Remove __dso_handle check.
	* dlfcn/modcxaatexit.c (__dso_handle): Remove declaration.
	* dlfcn/tstatexit.c (__dso_handle): Removed.
	(main): Don't check __dso_handle.
	* dlfcn/tstcxaatexit.c (__dso_handle): Removed.
	(main): Don't check __dso_handle.
	* include/stdlib.h (__dso_handle): New.
	* malloc/mtrace.c (__dso_handle): Remove declaration.
	(mtrace): Pass __dso_handle directly.
	* nptl/pthread_atfork.c (__dso_handle): Remove declaration.
	(__pthread_atfork): Pass __dso_handle directly.
	* nptl/tst-atfork2mod.c (__dso_handle): Removed.
	* posix/wordexp-test.c (__dso_handle): Remove declaration.
	(__app_register_atfork): Pass __dso_handle directly.
	* stdlib/at_quick_exit.c (__dso_handle): Remove declaration.
	(at_quick_exit): Pass __dso_handle directly.
	* stdlib/atexit.c (__dso_handle): Remove declaration.
	(atexit): Pass __dso_handle directly.
	* stdlib/tst-tls-atexit-lib.c (__dso_handle): Removed.
---
 dlfcn/modatexit.c           | 2 --
 dlfcn/modcxaatexit.c        | 1 -
 dlfcn/tstatexit.c           | 8 --------
 dlfcn/tstcxaatexit.c        | 8 --------
 include/stdlib.h            | 4 ++++
 malloc/mtrace.c             | 3 +--
 nptl/pthread_atfork.c       | 7 +------
 nptl/tst-atfork2mod.c       | 1 -
 posix/wordexp-test.c        | 4 +---
 stdlib/at_quick_exit.c      | 7 +------
 stdlib/atexit.c             | 8 +-------
 stdlib/tst-tls-atexit-lib.c | 2 --
 12 files changed, 9 insertions(+), 46 deletions(-)

diff --git a/dlfcn/modatexit.c b/dlfcn/modatexit.c
index e620d10c70..95c18dcbac 100644
--- a/dlfcn/modatexit.c
+++ b/dlfcn/modatexit.c
@@ -35,9 +35,7 @@ dummy (void)
 void
 foo (void *p)
 {
-  extern void *__dso_handle __attribute__ ((__weak__));
   printf ("This is %s\n", __FUNCTION__);
   atexit (dummy);
-  if (&__dso_handle) puts ("have dso handle"); else puts ("no dso handle");
   ip = p;
 }
diff --git a/dlfcn/modcxaatexit.c b/dlfcn/modcxaatexit.c
index fbda2f3c9f..b921b5c9ac 100644
--- a/dlfcn/modcxaatexit.c
+++ b/dlfcn/modcxaatexit.c
@@ -34,7 +34,6 @@ fluffy (void *p)
 void
 bar (void *p)
 {
-  extern void *__dso_handle;
   printf ("This is %s\n", __FUNCTION__);
   __cxa_atexit (fluffy, p, __dso_handle);
 }
diff --git a/dlfcn/tstatexit.c b/dlfcn/tstatexit.c
index 2073843b8f..e25a3f8000 100644
--- a/dlfcn/tstatexit.c
+++ b/dlfcn/tstatexit.c
@@ -20,8 +20,6 @@
 #include <stdlib.h>
 
 
-extern void *__dso_handle __attribute__ ((__weak__));
-
 int
 main (void)
 {
@@ -30,12 +28,6 @@ main (void)
   void (*fp) (void *);
   int v = 0;
 
-  if (&__dso_handle == NULL)
-    {
-      puts ("__dso_handle not available, cannot perform the test");
-      exit (0);
-    }
-
   h = dlopen (fname, RTLD_NOW);
   if (h == NULL)
     {
diff --git a/dlfcn/tstcxaatexit.c b/dlfcn/tstcxaatexit.c
index fde645c16b..37f25d63d4 100644
--- a/dlfcn/tstcxaatexit.c
+++ b/dlfcn/tstcxaatexit.c
@@ -19,8 +19,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-extern void *__dso_handle __attribute__ ((__weak__));
-
 int
 main (void)
 {
@@ -29,12 +27,6 @@ main (void)
   void (*fp) (void *);
   int v = 0;
 
-  if (&__dso_handle == NULL)
-    {
-      puts ("__dso_handle not available, cannot perform the test");
-      exit (0);
-    }
-
   h = dlopen (fname, RTLD_LAZY);
   if (h == NULL)
     {
diff --git a/include/stdlib.h b/include/stdlib.h
index 2274790a2e..d0dcbf81c3 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -5,6 +5,10 @@
 #endif
 #include <stdlib/stdlib.h>
 
+/* __dso_handle is always defined by either crtbegin.o from GCC or our
+   dso_handle.c.  */
+extern void *__dso_handle __attribute__ ((visibility ("hidden")));
+
 /* Now define the internal interfaces.  */
 #if !defined _ISOMAC
 # include <sys/stat.h>
diff --git a/malloc/mtrace.c b/malloc/mtrace.c
index 6c362d9679..40dadc2be3 100644
--- a/malloc/mtrace.c
+++ b/malloc/mtrace.c
@@ -315,10 +315,9 @@ mtrace (void)
 #ifdef _LIBC
           if (!added_atexit_handler)
             {
-              extern void *__dso_handle __attribute__ ((__weak__));
               added_atexit_handler = 1;
               __cxa_atexit ((void (*)(void *))release_libc_mem, NULL,
-                            &__dso_handle ? __dso_handle : NULL);
+			    __dso_handle);
             }
 #endif
         }
diff --git a/nptl/pthread_atfork.c b/nptl/pthread_atfork.c
index dc2ea07887..dd328b76f1 100644
--- a/nptl/pthread_atfork.c
+++ b/nptl/pthread_atfork.c
@@ -36,10 +36,6 @@
 #include "pthreadP.h"
 #include <fork.h>
 
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__,
-					  __visibility__ ("hidden")));
-
 
 /* Hide the symbol so that no definition but the one locally in the
    executable or DSO is used.  */
@@ -51,8 +47,7 @@ attribute_hidden
 __pthread_atfork (void (*prepare) (void), void (*parent) (void),
 		  void (*child) (void))
 {
-  return __register_atfork (prepare, parent, child,
-			    &__dso_handle == NULL ? NULL : __dso_handle);
+  return __register_atfork (prepare, parent, child, __dso_handle);
 }
 #ifndef __pthread_atfork
 extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
diff --git a/nptl/tst-atfork2mod.c b/nptl/tst-atfork2mod.c
index fe64046d3c..1e49612bdd 100644
--- a/nptl/tst-atfork2mod.c
+++ b/nptl/tst-atfork2mod.c
@@ -46,7 +46,6 @@ static void
 __attribute__ ((constructor))
 init (void)
 {
-  extern void *__dso_handle;
   printf ("dsohandle = %p\n", __dso_handle);
 
   if (pthread_atfork (prepare, parent, child) != 0)
diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c
index 17ae812346..6ae769678c 100644
--- a/posix/wordexp-test.c
+++ b/posix/wordexp-test.c
@@ -30,13 +30,11 @@
 
 #define IFS " \n\t"
 
-extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden")));
 extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *);
 
 static int __app_register_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void))
 {
-  return __register_atfork (prepare, parent, child,
-			    &__dso_handle == NULL ? NULL : __dso_handle);
+  return __register_atfork (prepare, parent, child, __dso_handle);
 }
 
 /* Number of forks seen.  */
diff --git a/stdlib/at_quick_exit.c b/stdlib/at_quick_exit.c
index 3b74d0a688..ca54c3f851 100644
--- a/stdlib/at_quick_exit.c
+++ b/stdlib/at_quick_exit.c
@@ -36,15 +36,10 @@
 #include "exit.h"
 
 
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-
 /* Register FUNC to be executed by `quick_exit'.  */
 int
 attribute_hidden
 at_quick_exit (void (*func) (void))
 {
-  return __cxa_at_quick_exit ((void (*) (void *)) func,
-			      &__dso_handle == NULL ? NULL : __dso_handle);
+  return __cxa_at_quick_exit ((void (*) (void *)) func, __dso_handle);
 }
diff --git a/stdlib/atexit.c b/stdlib/atexit.c
index f28b6ba1b7..aec7f5ce1b 100644
--- a/stdlib/atexit.c
+++ b/stdlib/atexit.c
@@ -35,11 +35,6 @@
 #include <stdlib.h>
 #include "exit.h"
 
-
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-
 /* Register FUNC to be executed by `exit'.  */
 int
 #ifndef atexit
@@ -47,6 +42,5 @@ attribute_hidden
 #endif
 atexit (void (*func) (void))
 {
-  return __cxa_atexit ((void (*) (void *)) func, NULL,
-		       &__dso_handle == NULL ? NULL : __dso_handle);
+  return __cxa_atexit ((void (*) (void *)) func, NULL, __dso_handle);
 }
diff --git a/stdlib/tst-tls-atexit-lib.c b/stdlib/tst-tls-atexit-lib.c
index a227e4653c..9bdd690842 100644
--- a/stdlib/tst-tls-atexit-lib.c
+++ b/stdlib/tst-tls-atexit-lib.c
@@ -18,8 +18,6 @@
 
 #include <stdlib.h>
 
-extern void *__dso_handle;
-
 typedef struct
 {
   void *val;
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 18/58] Mark internal utmp functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
  2017-09-01 18:00 ` [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822] H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-09-02 20:58   ` Florian Weimer
  2017-09-01 18:00 ` [PATCH 01/58] Mark internal " H.J. Lu
                   ` (56 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

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.
	(__setutent): Likewise.
	(__endutent): Likewise.
	(__getutid): Likewise.
	(__getutline): Likewise.
	(__pututline): Likewise.
	(__getutent_r): Likewise.
	(__getutid_r): Likewise.
	(__getutline_r): Likewise.
---
 include/utmp.h | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

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)
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 54/58] Hide internal __new_exitfn function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (4 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 55/58] Hide internal __new_getrlimit " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  0:57   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 19/58] Mark internal stdlib functions with attribute_hidden " H.J. Lu
                   ` (52 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __new_exitfn function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* stdlib/exit.h (__new_exitfn): Add attribute_hidden.
---
 stdlib/exit.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/stdlib/exit.h b/stdlib/exit.h
index 7f2e679246..ade6c5d63a 100644
--- a/stdlib/exit.h
+++ b/stdlib/exit.h
@@ -60,7 +60,8 @@ struct exit_function_list
 extern struct exit_function_list *__exit_funcs attribute_hidden;
 extern struct exit_function_list *__quick_exit_funcs attribute_hidden;
 
-extern struct exit_function *__new_exitfn (struct exit_function_list **listp);
+extern struct exit_function *__new_exitfn (struct exit_function_list **listp)
+  attribute_hidden;
 extern uint64_t __new_exitfn_called attribute_hidden;
 
 extern void __run_exit_handlers (int status,
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 01/58] Mark internal functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
  2017-09-01 18:00 ` [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822] H.J. Lu
  2017-09-01 18:00 ` [PATCH 18/58] Mark internal utmp functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 21:37   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 53/58] Hide internal __moncontrol function " H.J. Lu
                   ` (55 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal functions with attribute_hidden to allow direct access to
internal functions within libc.so and libc.a without using GOT nor PLT.

Size comparison of libc.so:

On x86-64:
        text	   data	    bss	    dec	    hex
Before: 1728577	  20584	  17088	1766249	 1af369
After : 1728593	  20584	  17088	1766265	 1af379

The only change is __gconv_release_shlib in iconv/gconv_dl.c is inlined
since it is hidden, which increases the code size of gconv_dl.os by 18
bytes.

On i686:
        text	   data	    bss	    dec	    hex
Before: 1869039	  11444	  11112	1891595	 1cdd0b
After : 1868635	  11444	  11112	1891191	 1cdb77

The code size is decreased by avoiding GOT/PLT for hidden functions.

	[BZ #18822]
	* iconv/gconv_int.h (__gconv_open): Add attribute_hidden.
	(__gconv_close): Likewise.
	(__gconv): Likewise.
	(__gconv_find_transform): Likewise.
	(__gconv_lookup_cache): Likewise.
	(__gconv_compare_alias_cache): Likewise.
	(__gconv_load_cache): Likewise.
	(__gconv_get_path): Likewise.
	(__gconv_close_transform): Likewise.
	(__gconv_release_cache): Likewise.
	(__gconv_find_shlib): Likewise.
	(__gconv_release_shlib): Likewise.
	(__gconv_get_builtin_trans): Likewise.
	(__gconv_compare_alias): Likewise.
	* include/dlfcn.h (_dlerror_run): Likewise.
	* include/stdio.h (__fortify_fail_abort): Likewise.
	* include/time.h (__tz_compute): Likewise.
	(__strptime_internal): Likewise.
	* intl/gettextP.h (_nl_find_domain): Likewise.
	(_nl_load_domain): Likewise.
	(_nl_find_msg): Likewise.
	* intl/plural-exp.h (FREE_EXPRESSION): Likewise.
	(EXTRACT_PLURAL_EXPRESSION): Likewise.
	* locale/coll-lookup.h (__collidx_table_lookup): Likewise.
	* resolv/gai_misc.h (__gai_enqueue_request): Likewise.
	(__gai_find_request): Likewise.
	(__gai_remove_request): Likewise.
	(__gai_notify): Likewise.
	(__gai_notify_only): Likewise.
	* sysdeps/generic/aio_misc.h (__aio_sigqueue): Likewise.
	* sysdeps/generic/ldsodefs.h (_dl_fini): Likewise.
	(_dl_non_dynamic_init): Likewise.
	(_dl_aux_init): Likewise.
	* sysdeps/i386/machine-gmon.h (mcount_internal): Likewise.
	* sysdeps/unix/sysv/linux/i386/olddirent.h (__old_getdents64):
	Likewise.
	* wcsmbs/wcsmbsload.h (__wcsmbs_load_conv): Likewise.
	(__wcsmbs_clone_conv): Likewise.
	(__wcsmbs_named_conv): Likewise.
---
 iconv/gconv_int.h                        | 43 +++++++++++++++++++++-----------
 include/dlfcn.h                          |  3 ++-
 include/stdio.h                          |  2 +-
 include/time.h                           |  4 +--
 intl/gettextP.h                          | 12 ++++++---
 intl/plural-exp.h                        |  5 ++--
 locale/coll-lookup.h                     |  6 +++--
 resolv/gai_misc.h                        | 15 +++++++----
 sysdeps/generic/aio_misc.h               |  3 ++-
 sysdeps/generic/ldsodefs.h               |  8 +++---
 sysdeps/i386/machine-gmon.h              |  2 +-
 sysdeps/unix/sysv/linux/i386/olddirent.h |  3 ++-
 wcsmbs/wcsmbsload.h                      |  9 ++++---
 13 files changed, 74 insertions(+), 41 deletions(-)

diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
index b1433f801e..2afd12a977 100644
--- a/iconv/gconv_int.h
+++ b/iconv/gconv_int.h
@@ -156,10 +156,12 @@ __libc_lock_define (extern, __gconv_lock attribute_hidden)
 
 /* Return in *HANDLE decriptor for transformation from FROMSET to TOSET.  */
 extern int __gconv_open (const char *toset, const char *fromset,
-			 __gconv_t *handle, int flags);
+			 __gconv_t *handle, int flags)
+     attribute_hidden;
 
 /* Free resources associated with transformation descriptor CD.  */
-extern int __gconv_close (__gconv_t cd);
+extern int __gconv_close (__gconv_t cd)
+     attribute_hidden;
 
 /* Transform at most *INBYTESLEFT bytes from buffer starting at *INBUF
    according to rules described by CD and place up to *OUTBYTESLEFT
@@ -167,33 +169,38 @@ extern int __gconv_close (__gconv_t cd);
    conversions in *IRREVERSIBLE if this pointer is not null.  */
 extern int __gconv (__gconv_t cd, const unsigned char **inbuf,
 		    const unsigned char *inbufend, unsigned char **outbuf,
-		    unsigned char *outbufend, size_t *irreversible);
+		    unsigned char *outbufend, size_t *irreversible)
+     attribute_hidden;
 
 /* Return in *HANDLE a pointer to an array with *NSTEPS elements describing
    the single steps necessary for transformation from FROMSET to TOSET.  */
 extern int __gconv_find_transform (const char *toset, const char *fromset,
 				   struct __gconv_step **handle,
-				   size_t *nsteps, int flags);
+				   size_t *nsteps, int flags)
+     attribute_hidden;
 
 /* Search for transformation in cache data.  */
 extern int __gconv_lookup_cache (const char *toset, const char *fromset,
 				 struct __gconv_step **handle, size_t *nsteps,
-				 int flags);
+				 int flags)
+     attribute_hidden;
 
 /* Compare the two name for whether they are after alias expansion the
    same.  This function uses the cache and fails if none is
    loaded.  */
 extern int __gconv_compare_alias_cache (const char *name1, const char *name2,
-					int *result);
+					int *result)
+     attribute_hidden;
 
 /* Free data associated with a step's structure.  */
-extern void __gconv_release_step (struct __gconv_step *step);
+extern void __gconv_release_step (struct __gconv_step *step)
+     attribute_hidden;
 
 /* Read all the configuration data and cache it.  */
 extern void __gconv_read_conf (void) attribute_hidden;
 
 /* Try to read module cache file.  */
-extern int __gconv_load_cache (void);
+extern int __gconv_load_cache (void) attribute_hidden;
 
 /* Retrieve pointer to internal cache.  */
 extern void *__gconv_get_cache (void);
@@ -205,7 +212,7 @@ extern struct gconv_module *__gconv_get_modules_db (void);
 extern void *__gconv_get_alias_db (void);
 
 /* Determine the directories we are looking in.  */
-extern void __gconv_get_path (void);
+extern void __gconv_get_path (void) attribute_hidden;
 
 /* Comparison function to search alias.  */
 extern int __gconv_alias_compare (const void *p1, const void *p2)
@@ -214,28 +221,34 @@ extern int __gconv_alias_compare (const void *p1, const void *p2)
 /* Clear reference to transformation step implementations which might
    cause the code to be unloaded.  */
 extern int __gconv_close_transform (struct __gconv_step *steps,
-				    size_t nsteps);
+				    size_t nsteps)
+     attribute_hidden;
 
 /* Free all resources allocated for the transformation record when
    using the cache.  */
-extern void __gconv_release_cache (struct __gconv_step *steps, size_t nsteps);
+extern void __gconv_release_cache (struct __gconv_step *steps, size_t nsteps)
+     attribute_hidden;
 
 /* Load shared object named by NAME.  If already loaded increment reference
    count.  */
-extern struct __gconv_loaded_object *__gconv_find_shlib (const char *name);
+extern struct __gconv_loaded_object *__gconv_find_shlib (const char *name)
+     attribute_hidden;
 
 /* Release shared object.  If no further reference is available unload
    the object.  */
-extern void __gconv_release_shlib (struct __gconv_loaded_object *handle);
+extern void __gconv_release_shlib (struct __gconv_loaded_object *handle)
+     attribute_hidden;
 
 /* Fill STEP with information about builtin module with NAME.  */
 extern void __gconv_get_builtin_trans (const char *name,
-				       struct __gconv_step *step);
+				       struct __gconv_step *step)
+     attribute_hidden;
 
 libc_hidden_proto (__gconv_transliterate)
 
 /* If NAME is an codeset alias expand it.  */
-extern int __gconv_compare_alias (const char *name1, const char *name2);
+extern int __gconv_compare_alias (const char *name1, const char *name2)
+     attribute_hidden;
 
 
 /* Builtin transformations.  */
diff --git a/include/dlfcn.h b/include/dlfcn.h
index 888e84d4b8..526086f1a0 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -72,7 +72,8 @@ extern void *_dl_vsym (void *handle, const char *name, const char *version,
    _dl_catch_error.  Returns zero for success, nonzero for failure; and
    arranges for `dlerror' to return the error details.
    ARGS is passed as argument to OPERATE.  */
-extern int _dlerror_run (void (*operate) (void *), void *args);
+extern int _dlerror_run (void (*operate) (void *), void *args)
+    attribute_hidden;
 
 #ifdef SHARED
 # define DL_CALLER_DECL /* Nothing */
diff --git a/include/stdio.h b/include/stdio.h
index 87e0e10797..7625a2a3a0 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -100,7 +100,7 @@ extern void __libc_message (enum __libc_message_action action,
 			    const char *__fnt, ...);
 extern void __fortify_fail (const char *msg) __attribute__ ((__noreturn__));
 extern void __fortify_fail_abort (_Bool, const char *msg)
-  __attribute__ ((__noreturn__));
+  __attribute__ ((__noreturn__)) attribute_hidden;
 libc_hidden_proto (__fortify_fail)
 libc_hidden_proto (__fortify_fail_abort)
 
diff --git a/include/time.h b/include/time.h
index 324913214f..9fb0e329a3 100644
--- a/include/time.h
+++ b/include/time.h
@@ -46,7 +46,7 @@ extern void __tzfile_default (const char *std, const char *dst,
 			      long int stdoff, long int dstoff);
 extern void __tzset_parse_tz (const char *tz);
 extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
-  __THROW;
+  __THROW attribute_hidden;
 
 /* Subroutine of `mktime'.  Return the `time_t' representation of TP and
    normalize TP, given that a `struct tm *' maps to a `time_t' as performed
@@ -89,7 +89,7 @@ extern int __getclktck (void);
 /* strptime support.  */
 extern char * __strptime_internal (const char *rp, const char *fmt,
 				   struct tm *tm, void *statep,
-				   locale_t locparam);
+				   locale_t locparam) attribute_hidden;
 
 extern double __difftime (time_t time1, time_t time0);
 
diff --git a/intl/gettextP.h b/intl/gettextP.h
index 8fcfb5bef8..75b203ab52 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -251,19 +251,23 @@ extern const char *_nl_locale_name_default (void);
 
 struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
 					 const char *__domainname,
-					 struct binding *__domainbinding);
+					 struct binding *__domainbinding)
+     attribute_hidden;
 void _nl_load_domain (struct loaded_l10nfile *__domain,
-		      struct binding *__domainbinding);
+		      struct binding *__domainbinding)
+     attribute_hidden;
 
 #ifdef IN_LIBGLOCALE
 char *_nl_find_msg (struct loaded_l10nfile *domain_file,
 		    struct binding *domainbinding, const char *encoding,
 		    const char *msgid,
-		    size_t *lengthp);
+		    size_t *lengthp)
+     attribute_hidden;
 #else
 char *_nl_find_msg (struct loaded_l10nfile *domain_file,
 		    struct binding *domainbinding, const char *msgid,
-		    int convert, size_t *lengthp);
+		    int convert, size_t *lengthp)
+     attribute_hidden;
 #endif
 
 /* The internal variables in the standalone libintl.a must have different
diff --git a/intl/plural-exp.h b/intl/plural-exp.h
index 4833fcdf35..a4ffff9f91 100644
--- a/intl/plural-exp.h
+++ b/intl/plural-exp.h
@@ -101,12 +101,13 @@ struct parse_args
 # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
 #endif
 
-extern void FREE_EXPRESSION (struct expression *exp);
+extern void FREE_EXPRESSION (struct expression *exp) attribute_hidden;
 extern int PLURAL_PARSE (struct parse_args *arg);
 extern const struct expression GERMANIC_PLURAL attribute_hidden;
 extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
 				       const struct expression **pluralp,
-				       unsigned long int *npluralsp);
+				       unsigned long int *npluralsp)
+     attribute_hidden;
 
 #if !defined (_LIBC) && !defined (IN_LIBINTL) && !defined (IN_LIBGLOCALE)
 extern unsigned long int plural_eval (const struct expression *pexp,
diff --git a/locale/coll-lookup.h b/locale/coll-lookup.h
index d1c488dcf5..9e20d39329 100644
--- a/locale/coll-lookup.h
+++ b/locale/coll-lookup.h
@@ -19,7 +19,9 @@
 #include <stdint.h>
 
 /* Lookup in a table of int32_t, with default value 0.  */
-extern int32_t __collidx_table_lookup (const char *table, uint32_t wc);
+extern int32_t __collidx_table_lookup (const char *table, uint32_t wc)
+     attribute_hidden;
 
 /* Lookup in a table of uint32_t, with default value 0xffffffff.  */
-extern uint32_t __collseq_table_lookup (const char *table, uint32_t wc);
+extern uint32_t __collseq_table_lookup (const char *table, uint32_t wc)
+     attribute_hidden;
diff --git a/resolv/gai_misc.h b/resolv/gai_misc.h
index 95d14ed54f..efadf13010 100644
--- a/resolv/gai_misc.h
+++ b/resolv/gai_misc.h
@@ -75,19 +75,24 @@ extern pthread_mutex_t __gai_requests_mutex;
 
 
 /* Enqueue request.  */
-extern struct requestlist *__gai_enqueue_request (struct gaicb *gaicbp);
+extern struct requestlist *__gai_enqueue_request (struct gaicb *gaicbp)
+     attribute_hidden;
 
 /* Find request on wait list.  */
-extern struct requestlist *__gai_find_request (const struct gaicb *gaicbp);
+extern struct requestlist *__gai_find_request (const struct gaicb *gaicbp)
+     attribute_hidden;
 
 /* Remove request from waitlist.  */
-extern int __gai_remove_request (struct gaicb *gaicbp);
+extern int __gai_remove_request (struct gaicb *gaicbp)
+     attribute_hidden;
 
 /* Notify initiator of request and tell this everybody listening.  */
-extern void __gai_notify (struct requestlist *req);
+extern void __gai_notify (struct requestlist *req)
+     attribute_hidden;
 
 /* Notify initiator of request.  */
-extern int __gai_notify_only (struct sigevent *sigev, pid_t caller_pid);
+extern int __gai_notify_only (struct sigevent *sigev, pid_t caller_pid)
+     attribute_hidden;
 
 /* Send the signal.  */
 extern int __gai_sigqueue (int sig, const union sigval val, pid_t caller_pid);
diff --git a/sysdeps/generic/aio_misc.h b/sysdeps/generic/aio_misc.h
index c0622b2ab6..d5a0297673 100644
--- a/sysdeps/generic/aio_misc.h
+++ b/sysdeps/generic/aio_misc.h
@@ -40,7 +40,8 @@ typedef union
 
 
 /* Send the signal.  */
-extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid);
+extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
+     attribute_hidden;
 
 
 #endif /* aio_misc.h */
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 1a4449eeb3..5efae2d96d 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -954,7 +954,7 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
 
 /* Call the finalizer functions of all shared objects whose
    initializer functions have completed.  */
-extern void _dl_fini (void);
+extern void _dl_fini (void) attribute_hidden;
 
 /* Sort array MAPS according to dependencies of the contained objects.  */
 extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used,
@@ -1123,10 +1123,12 @@ extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr);
 rtld_hidden_proto (_dl_find_dso_for_object)
 
 /* Initialization which is normally done by the dynamic linker.  */
-extern void _dl_non_dynamic_init (void);
+extern void _dl_non_dynamic_init (void)
+     attribute_hidden;
 
 /* Used by static binaries to check the auxiliary vector.  */
-extern void _dl_aux_init (ElfW(auxv_t) *av);
+extern void _dl_aux_init (ElfW(auxv_t) *av)
+     attribute_hidden;
 
 
 __END_DECLS
diff --git a/sysdeps/i386/machine-gmon.h b/sysdeps/i386/machine-gmon.h
index 3e90b8c0c7..81e168e4e6 100644
--- a/sysdeps/i386/machine-gmon.h
+++ b/sysdeps/i386/machine-gmon.h
@@ -30,7 +30,7 @@
 #define mcount_internal __mcount_internal
 
 extern void mcount_internal (u_long frompc, u_long selfpc)
-  __attribute__ ((regparm (2)));
+  __attribute__ ((regparm (2))) attribute_hidden;
 
 #define _MCOUNT_DECL(frompc, selfpc)                \
   __attribute__ ((regparm (2)))			    \
diff --git a/sysdeps/unix/sysv/linux/i386/olddirent.h b/sysdeps/unix/sysv/linux/i386/olddirent.h
index 0b4c81da0e..5510ab2095 100644
--- a/sysdeps/unix/sysv/linux/i386/olddirent.h
+++ b/sysdeps/unix/sysv/linux/i386/olddirent.h
@@ -34,7 +34,8 @@ extern struct __old_dirent64 *__old_readdir64 (DIR *__dirp);
 libc_hidden_proto (__old_readdir64);
 extern int __old_readdir64_r (DIR *__dirp, struct __old_dirent64 *__entry,
 			  struct __old_dirent64 **__result);
-extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes);
+extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
+	attribute_hidden;
 int __old_scandir64 (const char * __dir,
 		     struct __old_dirent64 *** __namelist,
 		     int (*__selector) (const struct __old_dirent64 *),
diff --git a/wcsmbs/wcsmbsload.h b/wcsmbs/wcsmbsload.h
index 7efe2c1f81..57fad53077 100644
--- a/wcsmbs/wcsmbsload.h
+++ b/wcsmbs/wcsmbsload.h
@@ -37,13 +37,16 @@ struct gconv_fcts
 extern const struct gconv_fcts __wcsmbs_gconv_fcts_c attribute_hidden;
 
 /* Load conversion functions for the currently selected locale.  */
-extern void __wcsmbs_load_conv (struct __locale_data *new_category);
+extern void __wcsmbs_load_conv (struct __locale_data *new_category)
+     attribute_hidden;
 
 /* Clone the current `__wcsmbs_load_conv' value.  */
-extern void __wcsmbs_clone_conv (struct gconv_fcts *copy);
+extern void __wcsmbs_clone_conv (struct gconv_fcts *copy)
+     attribute_hidden;
 
 /* Find the conversion functions for converting to and from NAME.  */
-extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name);
+extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name)
+     attribute_hidden;
 
 /* Function used for the `private.cleanup' hook.  */
 extern void _nl_cleanup_ctype (struct __locale_data *) attribute_hidden;
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 11/58] Mark internal nscd functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (18 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 15/58] Mark internal stdio functions " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 22:00   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 06/58] Mark internal unistd " H.J. Lu
                   ` (38 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

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 */
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 55/58] Hide internal __new_getrlimit function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (3 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 53/58] Hide internal __moncontrol function " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-02  0:59   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 54/58] Hide internal __new_exitfn " H.J. Lu
                   ` (53 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Hide internal __new_getrlimit function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/getrlimit64.c (__new_getrlimit): Add
	attribute_hidden.
---
 sysdeps/unix/sysv/linux/getrlimit64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/getrlimit64.c b/sysdeps/unix/sysv/linux/getrlimit64.c
index 56af3c0646..37827e5f42 100644
--- a/sysdeps/unix/sysv/linux/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/getrlimit64.c
@@ -53,7 +53,8 @@ weak_alias (__getrlimit64, getrlimit)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
 /* Back compatible 2GiB limited rlimit.  */
-extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *);
+extern int __new_getrlimit (enum __rlimit_resource, struct rlimit *)
+  attribute_hidden;
 
 int
 attribute_compat_text_section
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (16 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 56/58] Hide internal __glob64 function " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 21:39   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 15/58] Mark internal stdio functions " H.J. Lu
                   ` (40 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark __internal_statvfs[64] with attribute_hidden to allow direct access
to them within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/fstatvfs.c: Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs): Removed.
	* sysdeps/unix/sysv/linux/fstatvfs64.c Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs64): Removed.
	* sysdeps/unix/sysv/linux/internal_statvfs.c: Include
	"internal_statvfs.h" instead of <sys/statvfs.h>.
	* sysdeps/unix/sysv/linux/internal_statvfs.h: New file.
	* sysdeps/unix/sysv/linux/statvfs.c Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs): Removed.
	* sysdeps/unix/sysv/linux/statvfs64.c Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs64): Removed.
---
 sysdeps/unix/sysv/linux/fstatvfs.c         |  6 +-----
 sysdeps/unix/sysv/linux/fstatvfs64.c       |  7 +------
 sysdeps/unix/sysv/linux/internal_statvfs.c |  2 +-
 sysdeps/unix/sysv/linux/internal_statvfs.h | 26 ++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/statvfs.c          |  6 +-----
 sysdeps/unix/sysv/linux/statvfs64.c        |  7 +------
 6 files changed, 31 insertions(+), 23 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/internal_statvfs.h

diff --git a/sysdeps/unix/sysv/linux/fstatvfs.c b/sysdeps/unix/sysv/linux/fstatvfs.c
index e07a5b9f3d..1b2f279291 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs.c
@@ -19,11 +19,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
-
-extern void __internal_statvfs (const char *name, struct statvfs *buf,
-				struct statfs *fsbuf, int fd);
-
+#include "internal_statvfs.h"
 
 int
 __fstatvfs (int fd, struct statvfs *buf)
diff --git a/sysdeps/unix/sysv/linux/fstatvfs64.c b/sysdeps/unix/sysv/linux/fstatvfs64.c
index 02a0d7ee42..c923208ea8 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs64.c
@@ -20,14 +20,9 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
 #include <kernel-features.h>
 
-
-extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
-				  struct statfs64 *fsbuf, int fd);
-
-
 /* Return information about the filesystem on which FD resides.  */
 int
 __fstatvfs64 (int fd, struct statvfs64 *buf)
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 9a17ca5c17..0a8dc35e16 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -26,7 +26,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
 #include "linux_fsinfo.h"
 #include <kernel-features.h>
 
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.h b/sysdeps/unix/sysv/linux/internal_statvfs.h
new file mode 100644
index 0000000000..1762bbc6c6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.h
@@ -0,0 +1,26 @@
+/* Internal statvfs/statvfs64 function prototypes.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/statvfs.h>
+
+extern void __internal_statvfs (const char *name, struct statvfs *buf,
+				struct statfs *fsbuf, int fd)
+      attribute_hidden;
+extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
+				  struct statfs64 *fsbuf, int fd)
+      attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c
index 744336e33b..1edf1acca9 100644
--- a/sysdeps/unix/sysv/linux/statvfs.c
+++ b/sysdeps/unix/sysv/linux/statvfs.c
@@ -19,11 +19,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
-
-extern void __internal_statvfs (const char *name, struct statvfs *buf,
-				struct statfs *fsbuf, int fd);
-
+#include "internal_statvfs.h"
 
 int
 __statvfs (const char *file, struct statvfs *buf)
diff --git a/sysdeps/unix/sysv/linux/statvfs64.c b/sysdeps/unix/sysv/linux/statvfs64.c
index a89f720b38..005495fa20 100644
--- a/sysdeps/unix/sysv/linux/statvfs64.c
+++ b/sysdeps/unix/sysv/linux/statvfs64.c
@@ -21,14 +21,9 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
 #include <kernel-features.h>
 
-
-extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
-				  struct statfs64 *fsbuf, int fd);
-
-
 /* Return information about the filesystem on which FILE resides.  */
 int
 __statvfs64 (const char *file, struct statvfs64 *buf)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 10/58] Mark internal gmp functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (7 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 04/58] Mark ____wcsto*_l_internal " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 21:46   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 51/58] Hide internal __init_misc function " H.J. Lu
                   ` (49 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal gmp functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/gmp.h: Declare internal functions only if _ISOMAC is
	undefined.
	(__mpn_extract_double): Add attribute_hidden.
	(__mpn_extract_long_double): Likewise.
	(__mpn_extract_float128): Likewise.
	(__mpn_construct_float): Likewise.
	(__mpn_construct_double): Likewise.
	(__mpn_construct_long_double): Likewise.
	(__mpn_construct_float128): Likewise.
	(mpn_add_1): Likewise.
	(mpn_addmul_1): Likewise.
	(mpn_add_n): Likewise.
	(mpn_cmp): Likewise.
	(mpn_divrem): Likewise.
	(mpn_lshift): Likewise.
	(mpn_mul): Likewise.
	(mpn_mul_1): Likewise.
	(mpn_rshift): Likewise.
	(mpn_sub_1): Likewise.
	(mpn_submul_1): Likewise.
	(mpn_sub_n): Likewise.
---
 include/gmp.h     | 33 ++++++++++++++++++++++++++-------
 stdlib/gmp-impl.h | 12 ++++++++----
 2 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/include/gmp.h b/include/gmp.h
index 3590acf408..657c7a0148 100644
--- a/include/gmp.h
+++ b/include/gmp.h
@@ -8,32 +8,51 @@
 
 #include <bits/floatn.h>
 
+#ifndef _ISOMAC
 /* Now define the internal interfaces.  */
 extern mp_size_t __mpn_extract_double (mp_ptr res_ptr, mp_size_t size,
 				       int *expt, int *is_neg,
-				       double value);
+				       double value) attribute_hidden;
 
 extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
 					    int *expt, int *is_neg,
-					    long double value);
+					    long double value)
+     attribute_hidden;
 
 #if __HAVE_DISTINCT_FLOAT128
 extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,
 					 int *expt, int *is_neg,
-					 _Float128 value);
+					 _Float128 value)
+     attribute_hidden;
 #endif
 
-extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign);
+extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign)
+     attribute_hidden;
 
 extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,
-				      int negative);
+				      int negative) attribute_hidden;
 
 extern long double __mpn_construct_long_double (mp_srcptr frac_ptr, int expt,
-						int sign);
+						int sign)
+     attribute_hidden;
 
 #if __HAVE_DISTINCT_FLOAT128
 extern _Float128 __mpn_construct_float128 (mp_srcptr frac_ptr, int expt,
-					   int sign);
+					   int sign) attribute_hidden;
+#endif
+
+extern __typeof (mpn_add_1) mpn_add_1 attribute_hidden;
+extern __typeof (mpn_addmul_1) mpn_addmul_1 attribute_hidden;
+extern __typeof (mpn_add_n) mpn_add_n attribute_hidden;
+extern __typeof (mpn_cmp) mpn_cmp attribute_hidden;
+extern __typeof (mpn_divrem) mpn_divrem attribute_hidden;
+extern __typeof (mpn_lshift) mpn_lshift attribute_hidden;
+extern __typeof (mpn_mul) mpn_mul attribute_hidden;
+extern __typeof (mpn_mul_1) mpn_mul_1 attribute_hidden;
+extern __typeof (mpn_rshift) mpn_rshift attribute_hidden;
+extern __typeof (mpn_sub_1) mpn_sub_1 attribute_hidden;
+extern __typeof (mpn_submul_1) mpn_submul_1 attribute_hidden;
+extern __typeof (mpn_sub_n) mpn_sub_n attribute_hidden;
 #endif
 
 #endif
diff --git a/stdlib/gmp-impl.h b/stdlib/gmp-impl.h
index 42d3e4afac..cbbf9479ac 100644
--- a/stdlib/gmp-impl.h
+++ b/stdlib/gmp-impl.h
@@ -308,13 +308,17 @@ typedef unsigned int UHWtype;
 
 /* Prototypes for internal mpn calls.  */
 extern void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
-					 mp_srcptr vp, mp_size_t size));
+					 mp_srcptr vp, mp_size_t size))
+     attribute_hidden;
 extern void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,
-				mp_size_t size, mp_ptr tspace));
+				mp_size_t size, mp_ptr tspace))
+     attribute_hidden;
 extern void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
-					 mp_size_t size));
+					 mp_size_t size))
+     attribute_hidden;
 extern void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size,
-				mp_ptr tspace));
+				mp_ptr tspace))
+     attribute_hidden;
 
 
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 15/58] Mark internal stdio functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (17 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 22:03   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 11/58] Mark internal nscd " H.J. Lu
                   ` (39 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal stdio functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/stdio.h (__fcloseall): Add attribute_hidden.
	(__getline): Likewise.
	(__path_search): Likewise.
	(__gen_tempname): Likewise.
	(__libc_message): Likewise.
	(__flockfile): Likewise.
	(__funlockfile): Likewise.
	(__fxprintf): Likewise.
	(__fxprintf_nocancel): Likewise.
---
 include/stdio.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/stdio.h b/include/stdio.h
index 7625a2a3a0..f1e987ae5e 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -4,7 +4,7 @@
 
 /* Now define the internal interfaces.  */
 
-extern int __fcloseall (void);
+extern int __fcloseall (void) attribute_hidden;
 extern int __snprintf (char *__restrict __s, size_t __maxlen,
 		       const char *__restrict __format, ...)
      __attribute__ ((__format__ (__printf__, 3, 4)));
@@ -21,7 +21,7 @@ extern int __vscanf (const char *__restrict __format,
 		     _G_va_list __arg)
      __attribute__ ((__format__ (__scanf__, 1, 0)));
 extern _IO_ssize_t __getline (char **__lineptr, size_t *__n,
-			      FILE *__stream);
+			      FILE *__stream) attribute_hidden;
 extern int __vsscanf (const char *__restrict __s,
 		      const char *__restrict __format,
 		      _G_va_list __arg)
@@ -77,10 +77,10 @@ extern FILE *__old_tmpfile (void);
 /* Generate a unique file name (and possibly open it).  */
 extern int __path_search (char *__tmpl, size_t __tmpl_len,
 			  const char *__dir, const char *__pfx,
-			  int __try_tempdir);
+			  int __try_tempdir) attribute_hidden;
 
 extern int __gen_tempname (char *__tmpl, int __suffixlen, int __flags,
-			   int __kind);
+			   int __kind) attribute_hidden;
 /* The __kind argument to __gen_tempname may be one of: */
 #  define __GT_FILE	0	/* create a file */
 #  define __GT_DIR	1	/* create a directory */
@@ -97,7 +97,7 @@ enum __libc_message_action
 extern void __libc_fatal (const char *__message)
      __attribute__ ((__noreturn__));
 extern void __libc_message (enum __libc_message_action action,
-			    const char *__fnt, ...);
+			    const char *__fnt, ...) attribute_hidden;
 extern void __fortify_fail (const char *msg) __attribute__ ((__noreturn__));
 extern void __fortify_fail_abort (_Bool, const char *msg)
   __attribute__ ((__noreturn__)) attribute_hidden;
@@ -105,10 +105,10 @@ libc_hidden_proto (__fortify_fail)
 libc_hidden_proto (__fortify_fail_abort)
 
 /* Acquire ownership of STREAM.  */
-extern void __flockfile (FILE *__stream);
+extern void __flockfile (FILE *__stream) attribute_hidden;
 
 /* Relinquish the ownership granted for STREAM.  */
-extern void __funlockfile (FILE *__stream);
+extern void __funlockfile (FILE *__stream) attribute_hidden;
 
 /* Try to acquire ownership of STREAM but do not block if it is not
    possible.  */
@@ -118,9 +118,9 @@ extern int __getc_unlocked (FILE *__fp);
 extern wint_t __getwc_unlocked (FILE *__fp);
 
 extern int __fxprintf (FILE *__fp, const char *__fmt, ...)
-     __attribute__ ((__format__ (__printf__, 2, 3)));
+     __attribute__ ((__format__ (__printf__, 2, 3))) attribute_hidden;
 extern int __fxprintf_nocancel (FILE *__fp, const char *__fmt, ...)
-     __attribute__ ((__format__ (__printf__, 2, 3)));
+     __attribute__ ((__format__ (__printf__, 2, 3))) attribute_hidden;
 
 extern const char *const _sys_errlist_internal[] attribute_hidden;
 extern int _sys_nerr_internal attribute_hidden;
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 07/58] Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (10 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 12/58] Mark internal time functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 21:44   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 50/58] Hide internal __setfpucw function " H.J. Lu
                   ` (46 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal grp/pwd/shadow functions with attribute_hidden to allow
direct access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/grp.h (__fgetgrent_r): Add attribute_hidden.
	(__getgrgid_r): Likewise.
	(__getgrnam_r): Likewise.
	* include/pwd.h (__getpwuid_r): Likewise.
	(__getpwnam_r): Likewise.
	(__fgetpwent_r): Likewise.
	* include/shadow.h (__getspnam_r): Likewise.
	(__sgetspent_r): Likewise.
	(__fgetspent_r): Likewise.
---
 include/grp.h    | 6 +++---
 include/pwd.h    | 6 +++---
 include/shadow.h | 7 ++++---
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/include/grp.h b/include/grp.h
index 0fb5c9a574..871701adbe 100644
--- a/include/grp.h
+++ b/include/grp.h
@@ -12,12 +12,12 @@ extern int __old_getgrent_r (struct group *__resultbuf, char *buffer,
 			     size_t __buflen, struct group **__result);
 extern int __fgetgrent_r (FILE * __stream, struct group *__resultbuf,
 			  char *buffer, size_t __buflen,
-			  struct group **__result);
+			  struct group **__result) attribute_hidden;
 
 /* Search for an entry with a matching group ID.  */
 extern int __getgrgid_r (__gid_t __gid, struct group *__resultbuf,
 			 char *__buffer, size_t __buflen,
-			 struct group **__result);
+			 struct group **__result) attribute_hidden;
 extern int __old_getgrgid_r (__gid_t __gid, struct group *__resultbuf,
 			     char *__buffer, size_t __buflen,
 			     struct group **__result);
@@ -25,7 +25,7 @@ extern int __old_getgrgid_r (__gid_t __gid, struct group *__resultbuf,
 /* Search for an entry with a matching group name.  */
 extern int __getgrnam_r (const char *__name, struct group *__resultbuf,
 			 char *__buffer, size_t __buflen,
-			 struct group **__result);
+			 struct group **__result) attribute_hidden;
 extern int __old_getgrnam_r (const char *__name, struct group *__resultbuf,
 			     char *__buffer, size_t __buflen,
 			     struct group **__result);
diff --git a/include/pwd.h b/include/pwd.h
index 3b0f72540c..fc995065d9 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -10,19 +10,19 @@ extern int __old_getpwent_r (struct passwd *__resultbuf, char *__buffer,
 			     size_t __buflen, struct passwd **__result);
 extern int __getpwuid_r (__uid_t __uid, struct passwd *__resultbuf,
 			 char *__buffer, size_t __buflen,
-			 struct passwd **__result);
+			 struct passwd **__result) attribute_hidden;
 extern int __old_getpwuid_r (__uid_t __uid, struct passwd *__resultbuf,
 			     char *__buffer, size_t __buflen,
 			     struct passwd **__result);
 extern int __getpwnam_r (const char *__name, struct passwd *__resultbuf,
 			 char *__buffer, size_t __buflen,
-			 struct passwd **__result);
+			 struct passwd **__result) attribute_hidden;
 extern int __old_getpwnam_r (const char *__name, struct passwd *__resultbuf,
 			     char *__buffer, size_t __buflen,
 			     struct passwd **__result);
 extern int __fgetpwent_r (FILE * __stream, struct passwd *__resultbuf,
 			  char *__buffer, size_t __buflen,
-			  struct passwd **__result);
+			  struct passwd **__result) attribute_hidden;
 
 #include <nss.h>
 
diff --git a/include/shadow.h b/include/shadow.h
index 124a1ab50a..366ea83482 100644
--- a/include/shadow.h
+++ b/include/shadow.h
@@ -11,16 +11,17 @@ extern int __old_getspent_r (struct spwd *__result_buf, char *__buffer,
 			     size_t __buflen, struct spwd **__result);
 extern int __getspnam_r (const char *__name, struct spwd *__result_buf,
 			 char *__buffer, size_t __buflen,
-			 struct spwd **__result);
+			 struct spwd **__result) attribute_hidden;
 extern int __old_getspnam_r (const char *__name, struct spwd *__result_buf,
 			     char *__buffer, size_t __buflen,
 			     struct spwd **__result);
 extern int __sgetspent_r (const char *__string,
 			  struct spwd *__result_buf, char *__buffer,
-			  size_t __buflen, struct spwd **__result);
+			  size_t __buflen, struct spwd **__result)
+     attribute_hidden;
 extern int __fgetspent_r (FILE *__stream, struct spwd *__result_buf,
 			  char *__buffer, size_t __buflen,
-			  struct spwd **__result);
+			  struct spwd **__result) attribute_hidden;
 extern int __lckpwdf (void);
 extern int __ulckpwdf (void);
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 19/58] Mark internal stdlib functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (5 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 54/58] Hide internal __new_exitfn " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-09-03  9:13   ` Florian Weimer
  2017-09-01 18:00 ` [PATCH 04/58] Mark ____wcsto*_l_internal " H.J. Lu
                   ` (51 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark internal stdlib functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.  __realpath
is hidden with libc_hidden_proto and libc_hidden_def since the exported
realpath is an alias of __realpath.

	[BZ #18822]
	* include/stdlib.h (__random): Add attribute_hidden.
	(__random_r): Likewise.
	(__srandom_r): Likewise.
	(__initstate_r): Likewise.
	(__setstate_r): Likewise.
	(__erand48_r): Likewise.
	(__nrand48_r): Likewise.
	(__jrand48_r): Likewise.
	(__srand48_r): Likewise.
	(__seed48_r): Likewise.
	(__lcong48_r): Likewise.
	(__drand48_iterate): Likewise.
	(__setenv): Likewise.
	(__unsetenv): Likewise.
	(__clearenv): Likewise.
	(__ptsname_r): Likewise.
	(__posix_openpt): Likewise.
	(__add_to_environ): Likewise.
	(__ecvt_r): Likewise.
	(__fcvt_r): Likewise.
	(__qecvt_r): Likewise.
	(__qfcvt_r): Likewise.
	(__realpath): Add libc_hidden_proto.
	* stdlib/canonicalize.c (__realpath): Add libc_hidden_def.
---
 include/stdlib.h      | 57 ++++++++++++++++++++++++++++++---------------------
 stdlib/canonicalize.c |  1 +
 2 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h
index d0dcbf81c3..61a15cb340 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -40,56 +40,65 @@ libc_hidden_proto (__qsort_r)
 libc_hidden_proto (lrand48_r)
 libc_hidden_proto (wctomb)
 
-extern long int __random (void);
+extern long int __random (void) attribute_hidden;
 extern void __srandom (unsigned int __seed);
 extern char *__initstate (unsigned int __seed, char *__statebuf,
 			  size_t __statelen);
 extern char *__setstate (char *__statebuf);
-extern int __random_r (struct random_data *__buf, int32_t *__result);
-extern int __srandom_r (unsigned int __seed, struct random_data *__buf);
+extern int __random_r (struct random_data *__buf, int32_t *__result)
+     attribute_hidden;
+extern int __srandom_r (unsigned int __seed, struct random_data *__buf)
+     attribute_hidden;
 extern int __initstate_r (unsigned int __seed, char *__statebuf,
-			  size_t __statelen, struct random_data *__buf);
-extern int __setstate_r (char *__statebuf, struct random_data *__buf);
+			  size_t __statelen, struct random_data *__buf)
+     attribute_hidden;
+extern int __setstate_r (char *__statebuf, struct random_data *__buf)
+     attribute_hidden;
 extern int __rand_r (unsigned int *__seed);
 extern int __erand48_r (unsigned short int __xsubi[3],
-			struct drand48_data *__buffer, double *__result);
+			struct drand48_data *__buffer, double *__result)
+     attribute_hidden;
 extern int __nrand48_r (unsigned short int __xsubi[3],
 			struct drand48_data *__buffer,
-			long int *__result);
+			long int *__result) attribute_hidden;
 extern int __jrand48_r (unsigned short int __xsubi[3],
 			struct drand48_data *__buffer,
-			long int *__result);
+			long int *__result) attribute_hidden;
 extern int __srand48_r (long int __seedval,
-			struct drand48_data *__buffer);
+			struct drand48_data *__buffer) attribute_hidden;
 extern int __seed48_r (unsigned short int __seed16v[3],
-		       struct drand48_data *__buffer);
+		       struct drand48_data *__buffer) attribute_hidden;
 extern int __lcong48_r (unsigned short int __param[7],
-			struct drand48_data *__buffer);
+			struct drand48_data *__buffer) attribute_hidden;
 
 /* Internal function to compute next state of the generator.  */
 extern int __drand48_iterate (unsigned short int __xsubi[3],
-			      struct drand48_data *__buffer);
+			      struct drand48_data *__buffer)
+     attribute_hidden;
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */
 extern struct drand48_data __libc_drand48_data attribute_hidden;
 
-extern int __setenv (const char *__name, const char *__value, int __replace);
-extern int __unsetenv (const char *__name);
-extern int __clearenv (void);
+extern int __setenv (const char *__name, const char *__value, int __replace)
+     attribute_hidden;
+extern int __unsetenv (const char *__name) attribute_hidden;
+extern int __clearenv (void) attribute_hidden;
 extern char *__mktemp (char *__template) __THROW __nonnull ((1));
 extern char *__canonicalize_file_name (const char *__name);
 extern char *__realpath (const char *__name, char *__resolved);
-extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
+libc_hidden_proto (__realpath)
+extern int __ptsname_r (int __fd, char *__buf, size_t __buflen)
+     attribute_hidden;
 # ifndef _ISOMAC
 extern int __ptsname_internal (int fd, char *buf, size_t buflen,
 			       struct stat64 *stp) attribute_hidden;
 # endif
 extern int __getpt (void);
-extern int __posix_openpt (int __oflag);
+extern int __posix_openpt (int __oflag) attribute_hidden;
 
 extern int __add_to_environ (const char *name, const char *value,
-			     const char *combines, int replace);
-
+			     const char *combines, int replace)
+     attribute_hidden;
 extern void _quicksort (void *const pbase, size_t total_elems,
 			size_t size, __compar_d_fn_t cmp, void *arg);
 
@@ -253,10 +262,10 @@ extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,
 extern char *__gcvt (double __value, int __ndigit, char *__buf);
 extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
 		     int *__restrict __sign, char *__restrict __buf,
-		     size_t __len);
+		     size_t __len) attribute_hidden;
 extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
 		     int *__restrict __sign, char *__restrict __buf,
-		     size_t __len);
+		     size_t __len) attribute_hidden;
 extern char *__qecvt (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign);
 extern char *__qfcvt (long double __value, int __ndigit,
@@ -264,10 +273,12 @@ extern char *__qfcvt (long double __value, int __ndigit,
 extern char *__qgcvt (long double __value, int __ndigit, char *__buf);
 extern int __qecvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
-		      char *__restrict __buf, size_t __len);
+		      char *__restrict __buf, size_t __len)
+     attribute_hidden;
 extern int __qfcvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
-		      char *__restrict __buf, size_t __len);
+		      char *__restrict __buf, size_t __len)
+     attribute_hidden;
 
 # if IS_IN (libc)
 #  undef MB_CUR_MAX
diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c
index c3d892c862..4ff7e0feb8 100644
--- a/stdlib/canonicalize.c
+++ b/stdlib/canonicalize.c
@@ -218,6 +218,7 @@ error:
     free (rpath);
   return NULL;
 }
+libc_hidden_def (__realpath)
 versioned_symbol (libc, __realpath, realpath, GLIBC_2_3);
 
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 04/58] Mark ____wcsto*_l_internal functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (6 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 19/58] Mark internal stdlib functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:00 ` H.J. Lu
  2017-10-01 21:40   ` H.J. Lu
  2017-09-01 18:00 ` [PATCH 10/58] Mark internal gmp " H.J. Lu
                   ` (50 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:00 UTC (permalink / raw)
  To: libc-alpha

Mark ____wcsto*_l_internal functions with attribute_hidden to allow
direct access to them within libc.so and libc.a without using GOT nor
PLT.

	[BZ #18822]
	* include/wchar.h (____wcstof_l_internal): New prototype.
	(____wcstod_l_internal): Likewise.
	(____wcstold_l_internal): Likewise.
	(____wcstol_l_internal): Likewise.
	(____wcstoul_l_internal): Likewise.
	(____wcstoll_l_internal): Likewise.
	(____wcstoull_l_internal): Likewise.
	(____wcstof128_l_internal): Likewise.
	* sysdeps/ieee754/float128/wcstof128.c
	(____wcstof128_l_internal): Removed.
	* sysdeps/ieee754/float128/wcstof128_l.c
	(____wcstof128_l_internal): Likewise.
	* wcsmbs/wcstod.c (____wcstod_l_internal): Likewise.
	* wcsmbs/wcstod_l.c (____wcstod_l_internal): Likewise.
	* wcsmbs/wcstof.c (____wcstof_l_internal): Likewise.
	* wcsmbs/wcstof_l.c (____wcstof_l_internal): Likewise.
	* wcsmbs/wcstol_l.c (____wcstol_l_internal): Likewise.
	* wcsmbs/wcstold.c (____wcstold_l_internal): Likewise.
	* wcsmbs/wcstold_l.c (____wcstold_l_internal): Likewise.
	* wcsmbs/wcstoll_l.c (____wcstoll_l_internal): Likewise.
	* wcsmbs/wcstoul_l.c (____wcstoul_l_internal): Likewise.
	* wcsmbs/wcstoull_l.c (____wcstoull_l_internal): Likewise.
---
 include/wchar.h                        | 23 +++++++++++++++++++++++
 sysdeps/ieee754/float128/wcstof128.c   |  3 ---
 sysdeps/ieee754/float128/wcstof128_l.c |  3 ---
 wcsmbs/wcstod.c                        |  3 ---
 wcsmbs/wcstod_l.c                      |  3 ---
 wcsmbs/wcstof.c                        |  3 ---
 wcsmbs/wcstof_l.c                      |  3 ---
 wcsmbs/wcstol_l.c                      |  3 ---
 wcsmbs/wcstold.c                       |  3 ---
 wcsmbs/wcstold_l.c                     |  3 ---
 wcsmbs/wcstoll_l.c                     |  3 ---
 wcsmbs/wcstoul_l.c                     |  3 ---
 wcsmbs/wcstoull_l.c                    |  4 ----
 13 files changed, 23 insertions(+), 37 deletions(-)

diff --git a/include/wchar.h b/include/wchar.h
index 7bf042c235..eb472daefb 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -70,6 +70,26 @@ libc_hidden_proto (wcstoll)
 libc_hidden_proto (wcstoul)
 libc_hidden_proto (wcstoull)
 
+extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
+				    locale_t) attribute_hidden;
+extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
+				     locale_t) attribute_hidden;
+extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **,
+					   int, locale_t) attribute_hidden;
+extern long int ____wcstol_l_internal (const wchar_t *, wchar_t **, int,
+				       int, locale_t) attribute_hidden;
+extern unsigned long int ____wcstoul_l_internal (const wchar_t *,
+						 wchar_t **,
+						 int, int, locale_t)
+     attribute_hidden;
+extern long long int ____wcstoll_l_internal (const wchar_t *, wchar_t **,
+					     int, int, locale_t)
+     attribute_hidden;
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+						       wchar_t **, int, int,
+						       locale_t)
+     attribute_hidden;
+
 #if __HAVE_DISTINCT_FLOAT128
 extern __typeof (wcstof128_l) __wcstof128_l;
 libc_hidden_proto (__wcstof128_l)
@@ -77,6 +97,9 @@ extern _Float128 __wcstof128_internal (const wchar_t *__restrict __nptr,
 				       wchar_t **__restrict __endptr,
 				       int __group) __THROW;
 
+extern _Float128 ____wcstof128_l_internal (const wchar_t *, wchar_t **, int,
+					   locale_t) attribute_hidden;
+
 libc_hidden_proto (__wcstof128_internal)
 libc_hidden_proto (wcstof128)
 #endif
diff --git a/sysdeps/ieee754/float128/wcstof128.c b/sysdeps/ieee754/float128/wcstof128.c
index 49aa4d61ac..bab8c24040 100644
--- a/sysdeps/ieee754/float128/wcstof128.c
+++ b/sysdeps/ieee754/float128/wcstof128.c
@@ -24,7 +24,4 @@
 /* Bring in _Float128 typedef if needed.  */
 #include <bits/floatn.h>
 
-extern _Float128 ____wcstof128_l_internal (const wchar_t *, wchar_t **, int,
-					   locale_t);
-
 #include "strtof128.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_l.c b/sysdeps/ieee754/float128/wcstof128_l.c
index b295087efe..33fcccdaa6 100644
--- a/sysdeps/ieee754/float128/wcstof128_l.c
+++ b/sysdeps/ieee754/float128/wcstof128_l.c
@@ -24,7 +24,4 @@
 
 #include <bits/floatn.h>
 
-extern _Float128 ____wcstof128_l_internal (const wchar_t *, wchar_t **, int,
-					   locale_t);
-
 #include "strtof128_l.c"
diff --git a/wcsmbs/wcstod.c b/wcsmbs/wcstod.c
index 4604f51621..4c6343c040 100644
--- a/wcsmbs/wcstod.c
+++ b/wcsmbs/wcstod.c
@@ -22,7 +22,4 @@
 
 #define	USE_WIDE_CHAR	1
 
-extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
-				     locale_t);
-
 #include <stdlib/strtod.c>
diff --git a/wcsmbs/wcstod_l.c b/wcsmbs/wcstod_l.c
index 7790f5abb7..25effe9681 100644
--- a/wcsmbs/wcstod_l.c
+++ b/wcsmbs/wcstod_l.c
@@ -21,9 +21,6 @@
 #include <locale.h>
 
 
-extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
-				     locale_t);
-
 #define	USE_WIDE_CHAR	1
 
 #include <stdlib/strtod_l.c>
diff --git a/wcsmbs/wcstof.c b/wcsmbs/wcstof.c
index e91c09cd53..1f91ab5478 100644
--- a/wcsmbs/wcstof.c
+++ b/wcsmbs/wcstof.c
@@ -21,7 +21,4 @@
 
 #define	USE_WIDE_CHAR	1
 
-extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
-				    locale_t);
-
 #include <stdlib/strtof.c>
diff --git a/wcsmbs/wcstof_l.c b/wcsmbs/wcstof_l.c
index 143b716d07..8b99b69e48 100644
--- a/wcsmbs/wcstof_l.c
+++ b/wcsmbs/wcstof_l.c
@@ -23,7 +23,4 @@
 
 #define	USE_WIDE_CHAR	1
 
-extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
-				    locale_t);
-
 #include <stdlib/strtof_l.c>
diff --git a/wcsmbs/wcstol_l.c b/wcsmbs/wcstol_l.c
index 42bd8429d0..36eaf562b4 100644
--- a/wcsmbs/wcstol_l.c
+++ b/wcsmbs/wcstol_l.c
@@ -23,7 +23,4 @@
 
 #define	USE_WIDE_CHAR	1
 
-extern long int ____wcstol_l_internal (const wchar_t *, wchar_t **, int, int,
-				       locale_t);
-
 #include <stdlib/strtol_l.c>
diff --git a/wcsmbs/wcstold.c b/wcsmbs/wcstold.c
index 7a14cd2871..481fcc4035 100644
--- a/wcsmbs/wcstold.c
+++ b/wcsmbs/wcstold.c
@@ -21,7 +21,4 @@
 
 #define USE_WIDE_CHAR	1
 
-extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int,
-					   locale_t);
-
 #include <stdlib/strtold.c>
diff --git a/wcsmbs/wcstold_l.c b/wcsmbs/wcstold_l.c
index a7ab025792..8192620bcc 100644
--- a/wcsmbs/wcstold_l.c
+++ b/wcsmbs/wcstold_l.c
@@ -22,7 +22,4 @@
 
 #define USE_WIDE_CHAR	1
 
-extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int,
-					   locale_t);
-
 #include <strtold_l.c>
diff --git a/wcsmbs/wcstoll_l.c b/wcsmbs/wcstoll_l.c
index 598d3f5fff..4a71282346 100644
--- a/wcsmbs/wcstoll_l.c
+++ b/wcsmbs/wcstoll_l.c
@@ -23,7 +23,4 @@
 
 #define QUAD	1
 
-extern long long int ____wcstoll_l_internal (const wchar_t *, wchar_t **,
-					     int, int, locale_t);
-
 #include <wcstol_l.c>
diff --git a/wcsmbs/wcstoul_l.c b/wcsmbs/wcstoul_l.c
index f9f3808b20..1a345d4bb0 100644
--- a/wcsmbs/wcstoul_l.c
+++ b/wcsmbs/wcstoul_l.c
@@ -23,7 +23,4 @@
 
 #define UNSIGNED	1
 
-extern unsigned long int ____wcstoul_l_internal (const wchar_t *, wchar_t **,
-						 int, int, locale_t);
-
 #include "wcstol_l.c"
diff --git a/wcsmbs/wcstoull_l.c b/wcsmbs/wcstoull_l.c
index 412a9fcf0a..1666d5070e 100644
--- a/wcsmbs/wcstoull_l.c
+++ b/wcsmbs/wcstoull_l.c
@@ -23,8 +23,4 @@
 
 #define UNSIGNED	1
 
-extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
-						       wchar_t **, int, int,
-						       locale_t);
-
 #include <wcstoll_l.c>
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 27/58] Hide internal __ioctl function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (24 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 37/58] Hide internal __bsd_getpt function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:31   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 41/58] Hide internal idna functions " H.J. Lu
                   ` (32 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __ioctl function to allow direct access within libc.so and
libc.a without using GOT nor PLT.

__GI___ioctl is defined when sysdeps/unix/syscalls.list is used to
generate ioctl.  Otherwise libc_hidden_def is needed explicitly.

	[BZ #18822]
	* include/sys/ioctl.h (__ioctl): Add libc_hidden_proto.
	* misc/ioctl.c (__ioctl): Add libc_hidden_def.
	* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/ioctl.S (__ioctl): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/ioctl.c (__ioctl): Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S (__ioctl): Likewise.
---
 include/sys/ioctl.h                             | 1 +
 misc/ioctl.c                                    | 1 +
 sysdeps/mach/hurd/ioctl.c                       | 1 +
 sysdeps/unix/sysv/linux/aarch64/ioctl.S         | 1 +
 sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S | 1 +
 sysdeps/unix/sysv/linux/powerpc/ioctl.c         | 1 +
 sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S     | 1 +
 7 files changed, 7 insertions(+)

diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h
index bfc6909dbc..dd7c3c7c9c 100644
--- a/include/sys/ioctl.h
+++ b/include/sys/ioctl.h
@@ -5,6 +5,7 @@
 
 /* Now define the internal interfaces.  */
 extern int __ioctl (int __fd, unsigned long int __request, ...);
+libc_hidden_proto (__ioctl)
 
 # endif /* !_ISOMAC */
 #endif
diff --git a/misc/ioctl.c b/misc/ioctl.c
index 9b90102544..7e1c8cc4d7 100644
--- a/misc/ioctl.c
+++ b/misc/ioctl.c
@@ -28,4 +28,5 @@ __ioctl (int fd, unsigned long int request, ...)
 }
 stub_warning (ioctl)
 
+libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index 7ce521c4fa..d6b4583a6f 100644
--- a/sysdeps/mach/hurd/ioctl.c
+++ b/sysdeps/mach/hurd/ioctl.c
@@ -323,4 +323,5 @@ __ioctl (int fd, unsigned long int request, ...)
     }
 }
 
+libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/ioctl.S
index 866d6ef12d..61b3804e1b 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ioctl.S
+++ b/sysdeps/unix/sysv/linux/aarch64/ioctl.S
@@ -28,4 +28,5 @@ ENTRY(__ioctl)
 	ret
 PSEUDO_END (__ioctl)
 
+libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
index ee5d11d240..54d186666d 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
@@ -38,4 +38,5 @@ L(error):
 
 PSEUDO_END (__ioctl)
 
+libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/powerpc/ioctl.c b/sysdeps/unix/sysv/linux/powerpc/ioctl.c
index 1437d1dccc..9efccbd2c5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/ioctl.c
+++ b/sysdeps/unix/sysv/linux/powerpc/ioctl.c
@@ -61,4 +61,5 @@ __ioctl (int fd, unsigned long int request, ...)
 
   return result;
 }
+libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S b/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S
index e2bf44c75d..43f956399e 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S
@@ -38,4 +38,5 @@ ENTRY (__ioctl)
 	BNEZ r1, 0f
 	jrp lr
 PSEUDO_END (__ioctl)
+libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 33/58] Hide internal __sysinfo function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (39 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 42/58] Hide internal __ifreq function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:38   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 20/58] Hide internal regex functions " H.J. Lu
                   ` (17 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __sysinfo function to allow direct access within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/include/sys/sysinfo.h (__sysinfo): Add
	attribute_hidden.
---
 sysdeps/unix/sysv/linux/include/sys/sysinfo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/include/sys/sysinfo.h b/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
index 1fa4969ef8..084e203826 100644
--- a/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
+++ b/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
@@ -23,7 +23,7 @@
 
 # ifndef _ISOMAC
 
-extern __typeof (sysinfo) __sysinfo __THROW;
+extern __typeof (sysinfo) __sysinfo __THROW attribute_hidden;
 
 # endif /* _ISOMAC */
 #endif /* sys/sysinfo.h */
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (42 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 21/58] Hide __readv and __writev " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:04   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 43/58] Hide internal __hasmntopt function " H.J. Lu
                   ` (14 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal getXXXbyYYY functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/aliases.h (__getaliasbyname_r): Add attribute_hidden.
	* include/netdb.h (__gethostbyaddr_r): Likewise.
	(__gethostbyname_r): Likewise.
	(__gethostbyname2_r): Likewise.
	(__getnetbyaddr_r): Likewise.
	(__getnetbyname_r): Likewise.
	(__getservbyname_r): Likewise.
	(__getservbyport_r): Likewise.
	(__getprotobyname_r): Likewise.
	(__getprotobynumber_r): Likewise.
	(__getnetgrent_r): Likewise.
	* include/rpc/netdb.h (__getrpcbyname_r): Likewise.
	(__getrpcbynumber_r): Likewise.
	* nss/getXXbyYY.c (INTERNAL (REENTRANT_NAME)): Likewise.
---
 include/aliases.h   |  3 ++-
 include/netdb.h     | 30 ++++++++++++++++++++----------
 include/rpc/netdb.h |  4 ++--
 nss/getXXbyYY.c     |  3 ++-
 4 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/include/aliases.h b/include/aliases.h
index ece69ebe43..11b81d4d24 100644
--- a/include/aliases.h
+++ b/include/aliases.h
@@ -14,7 +14,8 @@ extern int __old_getaliasent_r (struct aliasent *__restrict __result_buf,
 extern int __getaliasbyname_r (const char *__restrict __name,
 			       struct aliasent *__restrict __result_buf,
 			       char *__restrict __buffer, size_t __buflen,
-			       struct aliasent **__restrict __result);
+			       struct aliasent **__restrict __result)
+     attribute_hidden;
 extern int __old_getaliasbyname_r (const char *__restrict __name,
 				   struct aliasent *__restrict __result_buf,
 				   char *__restrict __buffer, size_t __buflen,
diff --git a/include/netdb.h b/include/netdb.h
index d425a64506..e230b1f4fc 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -43,7 +43,8 @@ extern int __gethostbyaddr_r (const void *__restrict __addr,
 			      struct hostent *__restrict __result_buf,
 			      char *__restrict __buf, size_t __buflen,
 			      struct hostent **__restrict __result,
-			      int *__restrict __h_errnop);
+			      int *__restrict __h_errnop)
+     attribute_hidden;
 extern int __old_gethostbyaddr_r (const void *__restrict __addr,
 				  socklen_t __len, int __type,
 				  struct hostent *__restrict __result_buf,
@@ -63,7 +64,8 @@ extern int __gethostbyname_r (const char *__restrict __name,
 			      struct hostent *__restrict __result_buf,
 			      char *__restrict __buf, size_t __buflen,
 			      struct hostent **__restrict __result,
-			      int *__restrict __h_errnop);
+			      int *__restrict __h_errnop)
+     attribute_hidden;
 extern int __old_gethostbyname_r (const char *__restrict __name,
 				  struct hostent *__restrict __result_buf,
 				  char *__restrict __buf, size_t __buflen,
@@ -74,7 +76,8 @@ extern int __gethostbyname2_r (const char *__restrict __name, int __af,
 			       struct hostent *__restrict __result_buf,
 			       char *__restrict __buf, size_t __buflen,
 			       struct hostent **__restrict __result,
-			       int *__restrict __h_errnop);
+			       int *__restrict __h_errnop)
+     attribute_hidden;
 extern int __old_gethostbyname2_r (const char *__restrict __name, int __af,
 				   struct hostent *__restrict __result_buf,
 				   char *__restrict __buf, size_t __buflen,
@@ -101,7 +104,8 @@ extern int __getnetbyaddr_r (uint32_t __net, int __type,
 			     struct netent *__restrict __result_buf,
 			     char *__restrict __buf, size_t __buflen,
 			     struct netent **__restrict __result,
-			     int *__restrict __h_errnop);
+			     int *__restrict __h_errnop)
+     attribute_hidden;
 extern int __old_getnetbyaddr_r (uint32_t __net, int __type,
 				 struct netent *__restrict __result_buf,
 				 char *__restrict __buf, size_t __buflen,
@@ -112,7 +116,8 @@ extern int __getnetbyname_r (const char *__restrict __name,
 			     struct netent *__restrict __result_buf,
 			     char *__restrict __buf, size_t __buflen,
 			     struct netent **__restrict __result,
-			     int *__restrict __h_errnop);
+			     int *__restrict __h_errnop)
+     attribute_hidden;
 extern int __old_getnetbyname_r (const char *__restrict __name,
 				 struct netent *__restrict __result_buf,
 				 char *__restrict __buf, size_t __buflen,
@@ -131,7 +136,8 @@ extern int __getservbyname_r (const char *__restrict __name,
 			      const char *__restrict __proto,
 			      struct servent *__restrict __result_buf,
 			      char *__restrict __buf, size_t __buflen,
-			      struct servent **__restrict __result);
+			      struct servent **__restrict __result)
+     attribute_hidden;
 extern int __old_getservbyname_r (const char *__restrict __name,
 				  const char *__restrict __proto,
 				  struct servent *__restrict __result_buf,
@@ -142,7 +148,8 @@ extern int __getservbyport_r (int __port,
 			      const char *__restrict __proto,
 			      struct servent *__restrict __result_buf,
 			      char *__restrict __buf, size_t __buflen,
-			      struct servent **__restrict __result);
+			      struct servent **__restrict __result)
+     attribute_hidden;
 extern int __old_getservbyport_r (int __port,
 				  const char *__restrict __proto,
 				  struct servent *__restrict __result_buf,
@@ -160,7 +167,8 @@ extern int __old_getprotoent_r (struct protoent *__restrict __result_buf,
 extern int __getprotobyname_r (const char *__restrict __name,
 			       struct protoent *__restrict __result_buf,
 			       char *__restrict __buf, size_t __buflen,
-			       struct protoent **__restrict __result);
+			       struct protoent **__restrict __result)
+     attribute_hidden;
 extern int __old_getprotobyname_r (const char *__restrict __name,
 				   struct protoent *__restrict __result_buf,
 				   char *__restrict __buf, size_t __buflen,
@@ -169,7 +177,8 @@ extern int __old_getprotobyname_r (const char *__restrict __name,
 extern int __getprotobynumber_r (int __proto,
 				 struct protoent *__restrict __res_buf,
 				 char *__restrict __buf, size_t __buflen,
-				 struct protoent **__restrict __result);
+				 struct protoent **__restrict __result)
+     attribute_hidden;
 extern int __old_getprotobynumber_r (int __proto,
 				     struct protoent *__restrict __res_buf,
 				     char *__restrict __buf, size_t __buflen,
@@ -178,7 +187,8 @@ extern int __old_getprotobynumber_r (int __proto,
 extern int __getnetgrent_r (char **__restrict __hostp,
 			    char **__restrict __userp,
 			    char **__restrict __domainp,
-			    char *__restrict __buffer, size_t __buflen);
+			    char *__restrict __buffer, size_t __buflen)
+     attribute_hidden;
 
 extern int ruserpass (const char *host, const char **aname,
 		      const char **apass);
diff --git a/include/rpc/netdb.h b/include/rpc/netdb.h
index 9b84668be7..eb75f3f58c 100644
--- a/include/rpc/netdb.h
+++ b/include/rpc/netdb.h
@@ -5,7 +5,7 @@
 
 extern int __getrpcbyname_r (const char *__name, struct rpcent *__result_buf,
 			     char *__buffer, size_t __buflen,
-			     struct rpcent **__result);
+			     struct rpcent **__result) attribute_hidden;
 extern int __old_getrpcbyname_r (const char *__name,
 				 struct rpcent *__result_buf,
 				 char *__buffer, size_t __buflen,
@@ -13,7 +13,7 @@ extern int __old_getrpcbyname_r (const char *__name,
 
 extern int __getrpcbynumber_r (int __number, struct rpcent *__result_buf,
 			       char *__buffer, size_t __buflen,
-			       struct rpcent **__result);
+			       struct rpcent **__result) attribute_hidden;
 extern int __old_getrpcbynumber_r (int __number, struct rpcent *__result_buf,
 				   char *__buffer, size_t __buflen,
 				   struct rpcent **__result);
diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c
index a439b816f7..f420b34fb8 100644
--- a/nss/getXXbyYY.c
+++ b/nss/getXXbyYY.c
@@ -79,7 +79,8 @@
 /* Prototype for reentrant version we use here.  */
 extern int INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf,
 				      char *buffer, size_t buflen,
-				      LOOKUP_TYPE **result H_ERRNO_PARM);
+				      LOOKUP_TYPE **result H_ERRNO_PARM)
+     attribute_hidden;
 
 /* We need to protect the dynamic buffer handling.  */
 __libc_lock_define_initialized (static, lock);
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 02/58] Mark 3 *_internal functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (37 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 32/58] Hide internal signal functions " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 21:21   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 42/58] Hide internal __ifreq function " H.J. Lu
                   ` (19 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark __ptsname_internal, __mktime_internal and __fopen_internal with
attribute_hidden to allow direct access to them within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/stdlib.h (__ptsname_internal): Add attribute_hidden.
	* include/time.h (__mktime_internal): Likewise.
	* libio/iolibio.h (__fopen_internal): Likewise.
---
 include/stdlib.h | 2 +-
 include/time.h   | 2 +-
 libio/iolibio.h  | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h
index c4a6e6f737..2274790a2e 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -78,7 +78,7 @@ extern char *__realpath (const char *__name, char *__resolved);
 extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
 # ifndef _ISOMAC
 extern int __ptsname_internal (int fd, char *buf, size_t buflen,
-			       struct stat64 *stp);
+			       struct stat64 *stp) attribute_hidden;
 # endif
 extern int __getpt (void);
 extern int __posix_openpt (int __oflag);
diff --git a/include/time.h b/include/time.h
index 9fb0e329a3..e8c07bbfea 100644
--- a/include/time.h
+++ b/include/time.h
@@ -54,7 +54,7 @@ extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
 extern time_t __mktime_internal (struct tm *__tp,
 				 struct tm *(*__func) (const time_t *,
 						       struct tm *),
-				 time_t *__offset);
+				 time_t *__offset) attribute_hidden;
 extern struct tm *__localtime_r (const time_t *__timer,
 				 struct tm *__tp) attribute_hidden;
 
diff --git a/libio/iolibio.h b/libio/iolibio.h
index f215fcef01..754d8b0650 100644
--- a/libio/iolibio.h
+++ b/libio/iolibio.h
@@ -23,7 +23,8 @@ extern _IO_FILE *_IO_fopen (const char*, const char*);
 extern _IO_FILE *_IO_old_fopen (const char*, const char*);
 extern _IO_FILE *_IO_new_fopen (const char*, const char*);
 extern _IO_FILE *_IO_fopen64 (const char*, const char*);
-extern _IO_FILE *__fopen_internal (const char*, const char*, int);
+extern _IO_FILE *__fopen_internal (const char*, const char*, int)
+	attribute_hidden;
 extern _IO_FILE *__fopen_maybe_mmap (_IO_FILE *) __THROW;
 extern int _IO_fprintf (_IO_FILE*, const char*, ...);
 extern int _IO_fputs (const char*, _IO_FILE*);
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 40/58] Hide internal __gettextparse function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (45 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 35/58] Hide internal __tdestroy " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:30   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 22/58] Mark internal rpc functions with attribute_hidden " H.J. Lu
                   ` (11 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __gettextparse function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/plural-exp.h: New file.
	* intl/plural-exp.c: Include <plural-exp.h> instead of
	"plural-exp.h".
---
 include/plural-exp.h | 8 ++++++++
 intl/plural-exp.c    | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 include/plural-exp.h

diff --git a/include/plural-exp.h b/include/plural-exp.h
new file mode 100644
index 0000000000..3b026f804d
--- /dev/null
+++ b/include/plural-exp.h
@@ -0,0 +1,8 @@
+#ifndef _PLURAL_EXP_H
+#include <intl/plural-exp.h>
+
+#ifndef _ISOMAC
+extern __typeof (__gettextparse) __gettextparse attribute_hidden;
+#endif /* !_ISOMAC */
+
+#endif
diff --git a/intl/plural-exp.c b/intl/plural-exp.c
index 8c15032631..f5249d5373 100644
--- a/intl/plural-exp.c
+++ b/intl/plural-exp.c
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "plural-exp.h"
+#include <plural-exp.h>
 
 #if (defined __GNUC__ && !(defined __APPLE_CC_ && __APPLE_CC__ > 1) && \
      !defined __cplusplus)					       \
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 29/58] Hide internal __mremap function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (20 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 06/58] Mark internal unistd " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:33   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 46/58] Hide internal __vstrfmon_l " H.J. Lu
                   ` (36 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __mremap function to allow direct access within libc.so and
libc.a without using GOT nor PLT.

__GI___mremap is defined when sysdeps/unix/syscalls.list is used to
generate mremap.  Otherwise libc_hidden_def is needed explicitly.

	[BZ #18822]
	* include/sys/mman.h (__mremap): Add libc_hidden_proto.
	* sysdeps/unix/sysv/linux/m68k/mremap.S (__mremap): Add
	libc_hidden_def.
---
 include/sys/mman.h                    | 1 +
 sysdeps/unix/sysv/linux/m68k/mremap.S | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/sys/mman.h b/include/sys/mman.h
index 8b996fce73..503edaae88 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -20,6 +20,7 @@ libc_hidden_proto (__madvise)
 /* This one is Linux specific.  */
 extern void *__mremap (void *__addr, size_t __old_len,
 		       size_t __new_len, int __flags, ...);
+libc_hidden_proto (__mremap)
 
 # if IS_IN (rtld)
 #  include <dl-mman.h>
diff --git a/sysdeps/unix/sysv/linux/m68k/mremap.S b/sysdeps/unix/sysv/linux/m68k/mremap.S
index 01be848f45..5cb7c1b132 100644
--- a/sysdeps/unix/sysv/linux/m68k/mremap.S
+++ b/sysdeps/unix/sysv/linux/m68k/mremap.S
@@ -25,4 +25,5 @@ PSEUDO (__mremap, mremap, 5)
 	move.l %d0, %a0
 	rts
 PSEUDO_END (__mremap)
+libc_hidden_def (__mremap)
 weak_alias (__mremap, mremap)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 34/58] Hide internal __assert_fail_base function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (52 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:39   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni " H.J. Lu
                   ` (4 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __assert_fail_base function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/assert.h (__assert_fail_base): Add attribute_hidden.
---
 include/assert.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/assert.h b/include/assert.h
index c452667956..c0f7e1a91c 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -18,7 +18,7 @@ extern void __assert_perror_fail (int __errnum, const char *__file,
 extern void __assert_fail_base (const char *fmt, const char *assertion,
 				const char *file, unsigned int line,
 				const char *function)
-     __THROW  __attribute__ ((__noreturn__));
+     __THROW  __attribute__ ((__noreturn__)) attribute_hidden;
 
 # if IS_IN (libc) || IS_IN (rtld)
 hidden_proto (__assert_fail)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 24/58] Hide __chmod and __mkdir [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (47 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 22/58] Mark internal rpc functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-09-04  8:05   ` Florian Weimer
  2017-09-01 18:01 ` [PATCH 31/58] Hide internal __strsep function " H.J. Lu
                   ` (9 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __chmod and __mkdir functions to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/stat.h (__chmod): Add libc_hidden_proto.
	(__mkdir): Likewise.
	* io/chmod.c (__chmod): Add libc_hidden_def.
	* io/mkdir.c (__mkdir): Likewise.
	* sysdeps/mach/hurd/chmod.c (__chmod): Likewise.
	* sysdeps/mach/hurd/mkdir.c (__mkdir): Likewise.
	* sysdeps/unix/sysv/linux/generic/chmod.c (__chmod): Likewise.
	* sysdeps/unix/sysv/linux/generic/mkdir.c (__mkdir): Likewise.
---
 include/sys/stat.h                      | 2 ++
 io/chmod.c                              | 1 +
 io/mkdir.c                              | 1 +
 sysdeps/mach/hurd/chmod.c               | 1 +
 sysdeps/mach/hurd/mkdir.c               | 1 +
 sysdeps/unix/sysv/linux/generic/chmod.c | 2 ++
 sysdeps/unix/sysv/linux/generic/mkdir.c | 2 ++
 7 files changed, 10 insertions(+)

diff --git a/include/sys/stat.h b/include/sys/stat.h
index 4f31c00eca..eb44754185 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -7,9 +7,11 @@ extern int __stat (const char *__file, struct stat *__buf);
 extern int __fstat (int __fd, struct stat *__buf);
 extern int __lstat (const char *__file, struct stat *__buf);
 extern int __chmod (const char *__file, __mode_t __mode);
+libc_hidden_proto (__chmod)
 extern int __fchmod (int __fd, __mode_t __mode);
 extern __mode_t __umask (__mode_t __mask);
 extern int __mkdir (const char *__path, __mode_t __mode);
+libc_hidden_proto (__mkdir)
 extern int __mknod (const char *__path,
 		    __mode_t __mode, __dev_t __dev);
 #if IS_IN (libc) || IS_IN (rtld)
diff --git a/io/chmod.c b/io/chmod.c
index 0b85565ec2..3cacbf612f 100644
--- a/io/chmod.c
+++ b/io/chmod.c
@@ -35,4 +35,5 @@ __chmod (const char *file, mode_t mode)
 }
 stub_warning (chmod)
 
+libc_hidden_def (__chmod)
 weak_alias (__chmod, chmod)
diff --git a/io/mkdir.c b/io/mkdir.c
index 0b8499a707..43a790de33 100644
--- a/io/mkdir.c
+++ b/io/mkdir.c
@@ -36,4 +36,5 @@ __mkdir (const char *path, mode_t mode)
 }
 stub_warning (mkdir)
 
+libc_hidden_def (__mkdir)
 weak_alias (__mkdir, mkdir)
diff --git a/sysdeps/mach/hurd/chmod.c b/sysdeps/mach/hurd/chmod.c
index 943f9855d4..612e62d0b2 100644
--- a/sysdeps/mach/hurd/chmod.c
+++ b/sysdeps/mach/hurd/chmod.c
@@ -35,4 +35,5 @@ __chmod (const char *file, mode_t mode)
   return 0;
 }
 
+libc_hidden_def (__chmod)
 weak_alias (__chmod, chmod)
diff --git a/sysdeps/mach/hurd/mkdir.c b/sysdeps/mach/hurd/mkdir.c
index 58c2ac4291..1efac949f6 100644
--- a/sysdeps/mach/hurd/mkdir.c
+++ b/sysdeps/mach/hurd/mkdir.c
@@ -40,4 +40,5 @@ __mkdir (const char *file_name, mode_t mode)
   return 0;
 }
 
+libc_hidden_def (__mkdir)
 weak_alias (__mkdir, mkdir)
diff --git a/sysdeps/unix/sysv/linux/generic/chmod.c b/sysdeps/unix/sysv/linux/generic/chmod.c
index 41d6d9851f..551c67cd07 100644
--- a/sysdeps/unix/sysv/linux/generic/chmod.c
+++ b/sysdeps/unix/sysv/linux/generic/chmod.c
@@ -28,4 +28,6 @@ __chmod (const char *file, mode_t mode)
 {
   return INLINE_SYSCALL (fchmodat, 3, AT_FDCWD, file, mode);
 }
+
+libc_hidden_def (__chmod)
 weak_alias (__chmod, chmod)
diff --git a/sysdeps/unix/sysv/linux/generic/mkdir.c b/sysdeps/unix/sysv/linux/generic/mkdir.c
index 6571d29ca3..7eebe90ba7 100644
--- a/sysdeps/unix/sysv/linux/generic/mkdir.c
+++ b/sysdeps/unix/sysv/linux/generic/mkdir.c
@@ -30,4 +30,6 @@ __mkdir (const char *path, mode_t mode)
 {
   return INLINE_SYSCALL (mkdirat, 3, AT_FDCWD, path, mode);
 }
+
+libc_hidden_def (__mkdir)
 weak_alias (__mkdir, mkdir)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 31/58] Hide internal __strsep function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (48 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 24/58] Hide __chmod and __mkdir " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:36   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 28/58] Hide internal __malloc_check_init " H.J. Lu
                   ` (8 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __strsep function to allow direct access within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/string.h (__strsep): Add libc_hidden_proto.
	* string/strsep.c (__strsep): Add libc_hidden_def.
---
 include/string.h | 1 +
 string/strsep.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/string.h b/include/string.h
index 069efd0b87..968d6fea05 100644
--- a/include/string.h
+++ b/include/string.h
@@ -12,6 +12,7 @@ extern size_t __strnlen (const char *__string, size_t __maxlen)
      __attribute_pure__;
 
 extern char *__strsep (char **__stringp, const char *__delim);
+libc_hidden_proto (__strsep)
 
 extern int __strverscmp (const char *__s1, const char *__s2)
      __attribute_pure__;
diff --git a/string/strsep.c b/string/strsep.c
index 7091234a6c..b6103657a8 100644
--- a/string/strsep.c
+++ b/string/strsep.c
@@ -46,4 +46,5 @@ __strsep (char **stringp, const char *delim)
 }
 weak_alias (__strsep, strsep)
 strong_alias (__strsep, __strsep_g)
+libc_hidden_def (__strsep)
 libc_hidden_def (__strsep_g)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 47/58] Hide internal __setrlimit function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (32 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 26/58] Mark internal intl " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:46   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 39/58] Hide internal __get_sol " H.J. Lu
                   ` (24 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __setrlimit function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/resource.h (__setrlimit): Add libc_hidden_proto.
	* resource/setrlimit.c (__setrlimit): Add libc_hidden_def.
	* sysdeps/mach/hurd/setrlimit.c (__setrlimit): Likewise.
	* sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Likewise.
	* sysdeps/unix/sysv/linux/setrlimit64.c (__GI___setrlimit): New.
---
 include/sys/resource.h                | 1 +
 resource/setrlimit.c                  | 1 +
 sysdeps/mach/hurd/setrlimit.c         | 1 +
 sysdeps/unix/sysv/linux/setrlimit.c   | 1 +
 sysdeps/unix/sysv/linux/setrlimit64.c | 3 +++
 5 files changed, 7 insertions(+)

diff --git a/include/sys/resource.h b/include/sys/resource.h
index 688c46c4ae..c55d4e63bd 100644
--- a/include/sys/resource.h
+++ b/include/sys/resource.h
@@ -23,5 +23,6 @@ extern int __getrusage (enum __rusage_who __who, struct rusage *__usage)
 
 extern int __setrlimit (enum __rlimit_resource __resource,
 			const struct rlimit *__rlimits);
+libc_hidden_proto (__setrlimit);
 #endif
 #endif
diff --git a/resource/setrlimit.c b/resource/setrlimit.c
index 6e3a1fbc54..e02b6a826a 100644
--- a/resource/setrlimit.c
+++ b/resource/setrlimit.c
@@ -29,6 +29,7 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__setrlimit)
 weak_alias (__setrlimit, setrlimit)
 
 stub_warning (setrlimit)
diff --git a/sysdeps/mach/hurd/setrlimit.c b/sysdeps/mach/hurd/setrlimit.c
index 3ea9af2e7c..693422a537 100644
--- a/sysdeps/mach/hurd/setrlimit.c
+++ b/sysdeps/mach/hurd/setrlimit.c
@@ -53,4 +53,5 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
   return 0;
 }
 
+libc_hidden_def (__setrlimit)
 weak_alias (__setrlimit, setrlimit)
diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c
index 8773c78236..50a21636ef 100644
--- a/sysdeps/unix/sysv/linux/setrlimit.c
+++ b/sysdeps/unix/sysv/linux/setrlimit.c
@@ -48,6 +48,7 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlim)
   return INLINE_SYSCALL_CALL (prlimit64, 0, resource, &rlim64, NULL);
 }
 
+libc_hidden_def (__setrlimit)
 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
 strong_alias (__setrlimit, __setrlimit_1)
 compat_symbol (libc, __setrlimit, setrlimit, GLIBC_2_0);
diff --git a/sysdeps/unix/sysv/linux/setrlimit64.c b/sysdeps/unix/sysv/linux/setrlimit64.c
index db1960fc18..ff835c8733 100644
--- a/sysdeps/unix/sysv/linux/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/setrlimit64.c
@@ -43,4 +43,7 @@ weak_alias (__setrlimit64, setrlimit64)
 #if __RLIM_T_MATCHES_RLIM64_T
 strong_alias (__setrlimit64, __setrlimit)
 weak_alias (__setrlimit64, setrlimit)
+# ifdef SHARED
+__hidden_ver1 (__setrlimit64, __GI___setrlimit, __setrlimit64);
+# endif
 #endif
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 42/58] Hide internal __ifreq function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (38 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 02/58] Mark 3 *_internal functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:34   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 33/58] Hide internal __sysinfo " H.J. Lu
                   ` (18 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __ifreq function to allow direct access within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/ifreq.h: New file.
	* sysdeps/generic/ifreq.h (__if_nextreq): Removed.
	(__ifreq): Likewise.
	* sysdeps/mach/hurd/ifreq.h (__if_nextreq): Removed.
	(__ifreq): Likewise.
---
 include/ifreq.h           | 14 ++++++++++++++
 sysdeps/generic/ifreq.h   | 12 ------------
 sysdeps/mach/hurd/ifreq.h | 12 ------------
 3 files changed, 14 insertions(+), 24 deletions(-)
 create mode 100644 include/ifreq.h

diff --git a/include/ifreq.h b/include/ifreq.h
new file mode 100644
index 0000000000..94e984c73c
--- /dev/null
+++ b/include/ifreq.h
@@ -0,0 +1,14 @@
+#include_next <ifreq.h>
+
+static inline struct ifreq *
+__if_nextreq (struct ifreq *ifr)
+{
+#ifdef _HAVE_SA_LEN
+  if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr)
+    return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
+#endif
+  return ifr + 1;
+}
+
+extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
+     attribute_hidden;
diff --git a/sysdeps/generic/ifreq.h b/sysdeps/generic/ifreq.h
index 6ebd7c83f3..b39739debb 100644
--- a/sysdeps/generic/ifreq.h
+++ b/sysdeps/generic/ifreq.h
@@ -23,18 +23,6 @@
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 
-static inline struct ifreq *
-__if_nextreq (struct ifreq *ifr)
-{
-#ifdef _HAVE_SA_LEN
-  if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr)
-    return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
-#endif
-  return ifr + 1;
-}
-
-extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd);
-
 
 static inline void
 __if_freereq (struct ifreq *ifreqs, int num_ifs)
diff --git a/sysdeps/mach/hurd/ifreq.h b/sysdeps/mach/hurd/ifreq.h
index eceeb7a2c3..3dd17f773d 100644
--- a/sysdeps/mach/hurd/ifreq.h
+++ b/sysdeps/mach/hurd/ifreq.h
@@ -24,18 +24,6 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
-static inline struct ifreq *
-__if_nextreq (struct ifreq *ifr)
-{
-#ifdef _HAVE_SA_LEN
-  if (ifr->ifr_addr.sa_len > sizeof ifr->ifr_addr)
-    return (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
-#endif
-  return ifr + 1;
-}
-
-extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd);
-
 
 static inline void
 __if_freereq (struct ifreq *ifreqs, int num_ifs)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 21/58] Hide __readv and __writev [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (41 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 20/58] Hide internal regex functions " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden " H.J. Lu
                   ` (15 subsequent siblings)
  58 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __readv and __writev functions to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/uio.h (__readv): Add libc_hidden_proto.
	(__writev): Likewise.
	* misc/readv.c (__readv): Add libc_hidden_def.
	* misc/writev.c (__writev): Likewise.
	* sysdeps/posix/readv.c (__readv): Likewise.
	* sysdeps/posix/writev.c (__writev): Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Include <sys/uio.h>.
	(__readv): Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Include <sys/uio.h>.
	(__writev): Likewise.
---
 include/sys/uio.h                | 2 ++
 misc/readv.c                     | 1 +
 misc/writev.c                    | 1 +
 sysdeps/posix/readv.c            | 1 +
 sysdeps/posix/writev.c           | 1 +
 sysdeps/unix/sysv/linux/readv.c  | 2 ++
 sysdeps/unix/sysv/linux/writev.c | 2 ++
 7 files changed, 10 insertions(+)

diff --git a/include/sys/uio.h b/include/sys/uio.h
index 20860bfd82..204c4b906d 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -5,8 +5,10 @@
 /* Now define the internal interfaces.  */
 extern ssize_t __readv (int __fd, const struct iovec *__iovec,
 			int __count);
+libc_hidden_proto (__readv)
 extern ssize_t __writev (int __fd, const struct iovec *__iovec,
 			 int __count);
+libc_hidden_proto (__writev)
 
 /* Used for p{read,write}{v64}v2 implementation.  */
 libc_hidden_proto (preadv)
diff --git a/misc/readv.c b/misc/readv.c
index 064f88523c..9ad94d370a 100644
--- a/misc/readv.c
+++ b/misc/readv.c
@@ -30,6 +30,7 @@ __readv (int fd, const struct iovec *vector, int count)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__readv)
 weak_alias (__readv, readv)
 
 stub_warning (readv)
diff --git a/misc/writev.c b/misc/writev.c
index c8d222e04f..8bd2eddf1a 100644
--- a/misc/writev.c
+++ b/misc/writev.c
@@ -30,6 +30,7 @@ __writev (int fd, const struct iovec *vector, int count)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__writev)
 weak_alias (__writev, writev)
 
 stub_warning (writev)
diff --git a/sysdeps/posix/readv.c b/sysdeps/posix/readv.c
index 5b0c124e89..2875c76daf 100644
--- a/sysdeps/posix/readv.c
+++ b/sysdeps/posix/readv.c
@@ -88,4 +88,5 @@ __readv (int fd, const struct iovec *vector, int count)
 
   return bytes_read;
 }
+libc_hidden_def (__readv)
 weak_alias (__readv, readv)
diff --git a/sysdeps/posix/writev.c b/sysdeps/posix/writev.c
index 7ce1deb80f..89d463033a 100644
--- a/sysdeps/posix/writev.c
+++ b/sysdeps/posix/writev.c
@@ -88,4 +88,5 @@ __writev (int fd, const struct iovec *vector, int count)
 
   return bytes_written;
 }
+libc_hidden_def (__writev)
 weak_alias (__writev, writev)
diff --git a/sysdeps/unix/sysv/linux/readv.c b/sysdeps/unix/sysv/linux/readv.c
index 142a0a92a7..e4713008f1 100644
--- a/sysdeps/unix/sysv/linux/readv.c
+++ b/sysdeps/unix/sysv/linux/readv.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <unistd.h>
+#include <sys/uio.h>
 #include <sysdep-cancel.h>
 
 ssize_t
@@ -24,4 +25,5 @@ __readv (int fd, const struct iovec *iov, int iovcnt)
 {
   return SYSCALL_CANCEL (readv, fd, iov, iovcnt);
 }
+libc_hidden_def (__readv)
 weak_alias (__readv, readv)
diff --git a/sysdeps/unix/sysv/linux/writev.c b/sysdeps/unix/sysv/linux/writev.c
index 1b56cbb709..2495fd938a 100644
--- a/sysdeps/unix/sysv/linux/writev.c
+++ b/sysdeps/unix/sysv/linux/writev.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <unistd.h>
+#include <sys/uio.h>
 #include <sysdep-cancel.h>
 
 ssize_t
@@ -24,4 +25,5 @@ __writev (int fd, const struct iovec *iov, int iovcnt)
 {
   return SYSCALL_CANCEL (writev, fd, iov, iovcnt);
 }
+libc_hidden_def (__writev)
 weak_alias (__writev, writev)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 35/58] Hide internal __tdestroy function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (44 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 43/58] Hide internal __hasmntopt function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:40   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 40/58] Hide internal __gettextparse " H.J. Lu
                   ` (12 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __tdestroy function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/search.h (__tdestroy): Add libc_hidden_proto.
	* misc/tsearch.c (__tdestroy): Add libc_hidden_def.
---
 include/search.h | 1 +
 misc/tsearch.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/search.h b/include/search.h
index a941959dbe..e17693022d 100644
--- a/include/search.h
+++ b/include/search.h
@@ -24,5 +24,6 @@ libc_hidden_proto (__tdelete)
 extern void __twalk (const void *__root, __action_fn_t action);
 libc_hidden_proto (__twalk)
 extern void __tdestroy (void *__root, __free_fn_t freefct);
+libc_hidden_proto (__tdestroy)
 #endif
 #endif
diff --git a/misc/tsearch.c b/misc/tsearch.c
index aef9c7c1ee..cdc401a4e5 100644
--- a/misc/tsearch.c
+++ b/misc/tsearch.c
@@ -745,4 +745,5 @@ __tdestroy (void *vroot, __free_fn_t freefct)
   if (root != NULL)
     tdestroy_recurse (root, freefct);
 }
+libc_hidden_def (__tdestroy)
 weak_alias (__tdestroy, tdestroy)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 32/58] Hide internal signal functions [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (36 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 45/58] Hide internal __sched_setparam function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:37   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 02/58] Mark 3 *_internal functions with attribute_hidden " H.J. Lu
                   ` (20 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal signal functions to allow direct access within libc.so and
libc.a without using GOT nor PLT.

__GI___kill and __GI___sigaltstack are defined when syscalls.list is
used to generate them.  Otherwise libc_hidden_def is needed explicitly.

	[BZ #18822]
	* include/signal.h (__kill): Add libc_hidden_proto.
	(__sigblock): Likewise.
	(__sigprocmask): Likewise.
	(__sigaltstack): Likewise.
	* signal/kill.c (__kill): Add libc_hidden_def.
	* signal/sigblock.c (__sigblock): Likewise.
	* signal/sigprocmask.c (__sigprocmask): Likewise.
	* sysdeps/mach/hurd/kill.c (__kill): Likewise.
	* sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise.
	* sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise.
	* sysdeps/posix/sigblock.c (__sigblock): Likewise.
	* sysdeps/unix/sysv/linux/alpha/sigprocmask.c (__sigprocmask):
	Likewise.
	* sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
	(__sigprocmask): Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask):
	Likewise.
	* /sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
	(__sigprocmask): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask):
	Likewise.
---
 include/signal.h                                    | 4 ++++
 signal/kill.c                                       | 1 +
 signal/sigblock.c                                   | 1 +
 signal/sigprocmask.c                                | 1 +
 sysdeps/mach/hurd/kill.c                            | 1 +
 sysdeps/mach/hurd/sigaltstack.c                     | 1 +
 sysdeps/mach/hurd/sigprocmask.c                     | 1 +
 sysdeps/posix/sigblock.c                            | 1 +
 sysdeps/unix/sysv/linux/alpha/sigprocmask.c         | 1 +
 sysdeps/unix/sysv/linux/ia64/sigprocmask.c          | 1 +
 sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c  | 1 +
 sysdeps/unix/sysv/linux/sigprocmask.c               | 1 +
 sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c | 1 +
 sysdeps/unix/sysv/linux/x86_64/sigprocmask.c        | 1 +
 14 files changed, 17 insertions(+)

diff --git a/include/signal.h b/include/signal.h
index 61ad422dcb..7cbe64b8ad 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -17,13 +17,16 @@ libc_hidden_proto (_sys_siglist)
 /* Now define the internal interfaces.  */
 extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler);
 extern int __kill (__pid_t __pid, int __sig);
+libc_hidden_proto (__kill)
 extern int __sigaction (int __sig, const struct sigaction *__restrict __act,
 			struct sigaction *__restrict __oact);
 libc_hidden_proto (__sigaction)
 extern int __sigblock (int __mask);
+libc_hidden_proto (__sigblock)
 extern int __sigsetmask (int __mask);
 extern int __sigprocmask (int __how,
 			  const sigset_t *__set, sigset_t *__oset);
+libc_hidden_proto (__sigprocmask)
 extern int __sigsuspend (const sigset_t *__set);
 libc_hidden_proto (__sigsuspend)
 extern int __sigwait (const sigset_t *__set, int *__sig);
@@ -40,6 +43,7 @@ extern int __sigreturn (struct sigcontext *__scp);
 #endif
 extern int __sigaltstack (const stack_t *__ss,
 			  stack_t *__oss);
+libc_hidden_proto (__sigaltstack)
 extern int __libc_sigaction (int sig, const struct sigaction *act,
 			     struct sigaction *oact);
 libc_hidden_proto (__libc_sigaction)
diff --git a/signal/kill.c b/signal/kill.c
index c7591b10c1..66f85d127c 100644
--- a/signal/kill.c
+++ b/signal/kill.c
@@ -30,4 +30,5 @@ __kill (int pid, int sig)
 }
 stub_warning (kill)
 
+libc_hidden_def (__kill)
 weak_alias (__kill, kill)
diff --git a/signal/sigblock.c b/signal/sigblock.c
index a8be9dbde9..fca370a52d 100644
--- a/signal/sigblock.c
+++ b/signal/sigblock.c
@@ -27,4 +27,5 @@ __sigblock (int mask)
 }
 stub_warning (sigblock)
 
+libc_hidden_def (__sigblock)
 weak_alias (__sigblock, sigblock)
diff --git a/signal/sigprocmask.c b/signal/sigprocmask.c
index afcf5a116e..ca9bb556b8 100644
--- a/signal/sigprocmask.c
+++ b/signal/sigprocmask.c
@@ -44,4 +44,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
    and we don't want warnings for every use of abort on
    a system without safe signals.  */
 
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/mach/hurd/kill.c b/sysdeps/mach/hurd/kill.c
index 2d556dd2ff..5360bb52c5 100644
--- a/sysdeps/mach/hurd/kill.c
+++ b/sysdeps/mach/hurd/kill.c
@@ -146,4 +146,5 @@ __kill (pid_t pid, int sig)
   return delivered ? 0 : __hurd_fail (err ?: ESRCH);
 }
 
+libc_hidden_def (__kill)
 weak_alias (__kill, kill)
diff --git a/sysdeps/mach/hurd/sigaltstack.c b/sysdeps/mach/hurd/sigaltstack.c
index 4fba69e766..3fde510e23 100644
--- a/sysdeps/mach/hurd/sigaltstack.c
+++ b/sysdeps/mach/hurd/sigaltstack.c
@@ -57,4 +57,5 @@ __sigaltstack (const stack_t *argss, stack_t *oss)
 
   return 0;
 }
+libc_hidden_def (__sigaltstack)
 weak_alias (__sigaltstack, sigaltstack)
diff --git a/sysdeps/mach/hurd/sigprocmask.c b/sysdeps/mach/hurd/sigprocmask.c
index a4ebe580ff..70b9a10a7b 100644
--- a/sysdeps/mach/hurd/sigprocmask.c
+++ b/sysdeps/mach/hurd/sigprocmask.c
@@ -80,4 +80,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
   return 0;
 }
 
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/posix/sigblock.c b/sysdeps/posix/sigblock.c
index 1f8686458b..ab59f2968f 100644
--- a/sysdeps/posix/sigblock.c
+++ b/sysdeps/posix/sigblock.c
@@ -35,4 +35,5 @@ __sigblock (int mask)
   return sigset_get_old_mask (&oset);
 }
 
+libc_hidden_def (__sigblock)
 weak_alias (__sigblock, sigblock)
diff --git a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
index 39a07de475..ebec70cff0 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/alpha/sigprocmask.c
@@ -54,4 +54,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
   return 0;
 }
 
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask);
diff --git a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
index 7e62438b03..920c5fd052 100644
--- a/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
@@ -36,4 +36,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
index 4cbbc8e133..a8010e7f14 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
@@ -34,4 +34,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index e39e5f6872..d0b8e049b2 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -53,4 +53,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
 
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
index c2205d0044..ef7d7feb49 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
@@ -30,4 +30,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
index a87ad106ea..1610ddf47f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
@@ -35,4 +35,5 @@ __sigprocmask (int how, const sigset_t *set, sigset_t *oset)
      real size of the user-level sigset_t.  */
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
 }
+libc_hidden_def (__sigprocmask)
 weak_alias (__sigprocmask, sigprocmask)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 41/58] Hide internal idna functions [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (25 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 27/58] Hide internal __ioctl " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:32   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 49/58] Hide internal __nis_hash function " H.J. Lu
                   ` (31 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal idna functions to allow direct access within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/idna.h: New file.
	* inet/getnameinfo.c: Include <idna.h> instead of
	<libidn/idna.h>.
	(__idna_to_unicode_lzlz): Removed.
	* sysdeps/posix/getaddrinfo.c: Include <idna.h> instead of
	<libidn/idna.h>.
	(__idna_to_ascii_lz): Removed.
	(__idna_to_unicode_lzlz): Likewise.
---
 include/idna.h              | 8 ++++++++
 inet/getnameinfo.c          | 4 +---
 sysdeps/posix/getaddrinfo.c | 5 +----
 3 files changed, 10 insertions(+), 7 deletions(-)
 create mode 100644 include/idna.h

diff --git a/include/idna.h b/include/idna.h
new file mode 100644
index 0000000000..dcb271d575
--- /dev/null
+++ b/include/idna.h
@@ -0,0 +1,8 @@
+#ifndef _IDNA_H
+#include <libidn/idna.h>
+
+extern __typeof (idna_to_ascii_lz) __idna_to_ascii_lz attribute_hidden;
+extern __typeof (idna_to_unicode_lzlz ) __idna_to_unicode_lzlz
+     attribute_hidden;
+
+#endif
diff --git a/inet/getnameinfo.c b/inet/getnameinfo.c
index b41e555f3c..292e087362 100644
--- a/inet/getnameinfo.c
+++ b/inet/getnameinfo.c
@@ -73,9 +73,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <scratch_buffer.h>
 
 #ifdef HAVE_LIBIDN
-# include <libidn/idna.h>
-extern int __idna_to_unicode_lzlz (const char *input, char **output,
-				   int flags);
+# include <idna.h>
 #endif
 
 #ifndef min
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index ce099bdf9c..c58d54dff5 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -86,10 +86,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <inet/net-internal.h>
 
 #ifdef HAVE_LIBIDN
-extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
-extern int __idna_to_unicode_lzlz (const char *input, char **output,
-				   int flags);
-# include <libidn/idna.h>
+# include <idna.h>
 #endif
 
 struct gaih_service
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 28/58] Hide internal __malloc_check_init function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (49 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 31/58] Hide internal __strsep function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:32   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 48/58] Hide internal __tcgetattr " H.J. Lu
                   ` (7 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __malloc_check_init function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	* include/malloc.h (__malloc_check_init): Add attribute_hidden.
---
 include/malloc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/malloc.h b/include/malloc.h
index 70d32c7c84..d4cd9a5ffc 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -9,6 +9,8 @@
 /* Nonzero if the malloc is already initialized.  */
 extern int __malloc_initialized attribute_hidden;
 
+extern __typeof (__malloc_check_init) __malloc_check_init attribute_hidden;
+
 struct malloc_state;
 typedef struct malloc_state *mstate;
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 14/58] Mark internal gshadow functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (28 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 25/58] Hide internal sysinfo functions " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:02   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 23/58] Mark internal netlink " H.J. Lu
                   ` (28 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal gshadow functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/gshadow.h (__fgetsgent_r): Add attribute_hidden.
	(__sgetsgent_r): Likewise.
---
 include/gshadow.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/gshadow.h b/include/gshadow.h
index 532801afd0..aa6a5a693e 100644
--- a/include/gshadow.h
+++ b/include/gshadow.h
@@ -4,9 +4,11 @@
 # ifndef _ISOMAC
 
 extern int __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer,
-			  size_t buflen, struct sgrp **result);
+			  size_t buflen, struct sgrp **result)
+     attribute_hidden;
 extern int __sgetsgent_r (const char *string, struct sgrp *resbuf,
-			  char *buffer, size_t buflen, struct sgrp **result);
+			  char *buffer, size_t buflen, struct sgrp **result)
+     attribute_hidden;
 
 struct parser_data;
 extern int _nss_files_parse_sgent (char *line, struct sgrp *result,
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 22/58] Mark internal rpc functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (46 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 40/58] Hide internal __gettextparse " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:24   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 24/58] Hide __chmod and __mkdir " H.J. Lu
                   ` (10 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal rpc functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/rpc/rpc.h (__rpc_thread_variables): Add
	attribute_hidden.
	(__rpc_thread_svc_cleanup): Likewise.
	(__rpc_thread_clnt_cleanup): Likewise.
	(__rpc_thread_key_cleanup): Likewise.
---
 include/rpc/rpc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index 60c78968de..1fb925e85c 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -41,10 +41,10 @@ struct rpc_thread_variables {
 };
 
 extern struct rpc_thread_variables *__rpc_thread_variables(void)
-     __attribute__ ((const));
-extern void __rpc_thread_svc_cleanup (void);
-extern void __rpc_thread_clnt_cleanup (void);
-extern void __rpc_thread_key_cleanup (void);
+     __attribute__ ((const)) attribute_hidden;
+extern void __rpc_thread_svc_cleanup (void) attribute_hidden;
+extern void __rpc_thread_clnt_cleanup (void) attribute_hidden;
+extern void __rpc_thread_key_cleanup (void) attribute_hidden;
 
 extern void __rpc_thread_destroy (void);
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 36/58] Hide internal __fopen_maybe_mmap function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (56 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 17/58] Mark internal dirent functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:41   ` H.J. Lu
  2017-09-01 18:16 ` [PATCH 00/58] Hide internal functions in libc.so Florian Weimer
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __fopen_maybe_mmap function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* libio/iolibio.h (__fopen_maybe_mmap): Add attribute_hidden.
---
 libio/iolibio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libio/iolibio.h b/libio/iolibio.h
index 754d8b0650..0185e685d4 100644
--- a/libio/iolibio.h
+++ b/libio/iolibio.h
@@ -25,7 +25,7 @@ extern _IO_FILE *_IO_new_fopen (const char*, const char*);
 extern _IO_FILE *_IO_fopen64 (const char*, const char*);
 extern _IO_FILE *__fopen_internal (const char*, const char*, int)
 	attribute_hidden;
-extern _IO_FILE *__fopen_maybe_mmap (_IO_FILE *) __THROW;
+extern _IO_FILE *__fopen_maybe_mmap (_IO_FILE *) __THROW attribute_hidden;
 extern int _IO_fprintf (_IO_FILE*, const char*, ...);
 extern int _IO_fputs (const char*, _IO_FILE*);
 libc_hidden_proto (_IO_fputs)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 48/58] Hide internal __tcgetattr function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (50 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 28/58] Hide internal __malloc_check_init " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:47   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h " H.J. Lu
                   ` (6 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __tcgetattr function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/termios.h (__tcgetattr): Add libc_hidden_proto.
	* sysdeps/unix/bsd/tcgetattr.c (__tcgetattr): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Likewise.
	* termios/tcgetattr.c (__tcgetattr): Likewise.
---
 include/termios.h                   | 1 +
 sysdeps/unix/bsd/tcgetattr.c        | 1 +
 sysdeps/unix/sysv/linux/tcgetattr.c | 1 +
 termios/tcgetattr.c                 | 1 +
 4 files changed, 4 insertions(+)

diff --git a/include/termios.h b/include/termios.h
index 1a36e226b8..e2c35ebbae 100644
--- a/include/termios.h
+++ b/include/termios.h
@@ -9,6 +9,7 @@ extern int __tcsetattr (int __fd, int __optional_actions,
 
 extern int __libc_tcdrain (int __fd);
 
+libc_hidden_proto (__tcgetattr)
 libc_hidden_proto (tcsetattr)
 libc_hidden_proto (cfsetispeed)
 libc_hidden_proto (cfsetospeed)
diff --git a/sysdeps/unix/bsd/tcgetattr.c b/sysdeps/unix/bsd/tcgetattr.c
index 1779bb9342..654f1e6407 100644
--- a/sysdeps/unix/bsd/tcgetattr.c
+++ b/sysdeps/unix/bsd/tcgetattr.c
@@ -35,4 +35,5 @@ __tcgetattr (int fd, struct termios *termios_p)
   return __ioctl (fd, TIOCGETA, termios_p);
 }
 
+libc_hidden_def (__tcgetattr)
 weak_alias (__tcgetattr, tcgetattr)
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index b1d73d042a..99a59b6cd9 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -76,4 +76,5 @@ __tcgetattr (int fd, struct termios *termios_p)
   return retval;
 }
 
+libc_hidden_def (__tcgetattr)
 weak_alias (__tcgetattr, tcgetattr)
diff --git a/termios/tcgetattr.c b/termios/tcgetattr.c
index a5c076b1b0..12a56dd30f 100644
--- a/termios/tcgetattr.c
+++ b/termios/tcgetattr.c
@@ -39,4 +39,5 @@ __tcgetattr (int fd, struct termios *termios_p)
 }
 stub_warning (tcgetattr)
 
+libc_hidden_def (__tcgetattr)
 weak_alias (__tcgetattr, tcgetattr)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 17/58] Mark internal dirent functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (55 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 44/58] Hide internal __hash_string function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:23   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 36/58] Hide internal __fopen_maybe_mmap function " H.J. Lu
  2017-09-01 18:16 ` [PATCH 00/58] Hide internal functions in libc.so Florian Weimer
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal dirent functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.  __readdir64
is hidden with libc_hidden_proto and libc_hidden_def since the exported
readdir64 is an alias of __readdir64.

	[BZ #18822]
	* include/dirent.h (__opendir): Always add attribute_hidden.
	(__fdopendir): Likewise.
	(__closedir): Likewise.
	(__readdir): Likewise.
	(__readdir64): Add libc_hidden_proto.
	* sysdeps/mach/hurd/readdir64.c (__readdir64): Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/i386/readdir64.c (__readdir64): Likewise.
	* sysdeps/unix/sysv/linux/readdir64.c (__readdir64): Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/readdir.c (__GI___readdir64):
	New alias.
---
 include/dirent.h                              | 13 +++++--------
 sysdeps/mach/hurd/readdir64.c                 |  1 +
 sysdeps/unix/sysv/linux/i386/readdir64.c      |  1 +
 sysdeps/unix/sysv/linux/readdir64.c           |  1 +
 sysdeps/unix/sysv/linux/wordsize-64/readdir.c |  1 +
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/dirent.h b/include/dirent.h
index bebcd52cdb..26868eeb61 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -15,12 +15,13 @@ struct scandir_cancel_struct
 };
 
 /* Now define the internal interfaces.  */
-extern DIR *__opendir (const char *__name);
+extern DIR *__opendir (const char *__name) attribute_hidden;
 extern DIR *__opendirat (int dfd, const char *__name) attribute_hidden;
-extern DIR *__fdopendir (int __fd);
-extern int __closedir (DIR *__dirp);
-extern struct dirent *__readdir (DIR *__dirp);
+extern DIR *__fdopendir (int __fd) attribute_hidden;
+extern int __closedir (DIR *__dirp) attribute_hidden;
+extern struct dirent *__readdir (DIR *__dirp) attribute_hidden;
 extern struct dirent64 *__readdir64 (DIR *__dirp);
+libc_hidden_proto (__readdir64)
 extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
 			struct dirent **__result);
 extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
@@ -75,10 +76,6 @@ libc_hidden_proto (__scandirat)
 libc_hidden_proto (scandirat64)
 
 #  if IS_IN (rtld)
-extern __typeof (__closedir) __closedir attribute_hidden;
-extern __typeof (__fdopendir) __fdopendir attribute_hidden;
-extern __typeof (__readdir) __readdir attribute_hidden;
-extern __typeof (__readdir64) __readdir64 attribute_hidden;
 extern __typeof (__rewinddir) __rewinddir attribute_hidden;
 #  endif
 # endif
diff --git a/sysdeps/mach/hurd/readdir64.c b/sysdeps/mach/hurd/readdir64.c
index f422fcff04..bad0bcb559 100644
--- a/sysdeps/mach/hurd/readdir64.c
+++ b/sysdeps/mach/hurd/readdir64.c
@@ -98,4 +98,5 @@ __readdir64 (DIR *dirp)
   return dp;
 }
 
+libc_hidden_def (__readdir64)
 weak_alias (__readdir64, readdir64)
diff --git a/sysdeps/unix/sysv/linux/i386/readdir64.c b/sysdeps/unix/sysv/linux/i386/readdir64.c
index de8669feff..8c235f9831 100644
--- a/sysdeps/unix/sysv/linux/i386/readdir64.c
+++ b/sysdeps/unix/sysv/linux/i386/readdir64.c
@@ -27,6 +27,7 @@
 #undef __GETDENTS
 #undef DIRENT_TYPE
 
+libc_hidden_def (__readdir64)
 versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
 
 #if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
index 224f53db88..6d154fe988 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -4,4 +4,5 @@
 
 #include <sysdeps/posix/readdir.c>
 
+libc_hidden_def (__readdir64)
 weak_alias (__readdir64, readdir64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
index e197d93b00..0d5798849d 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/readdir.c
@@ -3,5 +3,6 @@
 #include <sysdeps/posix/readdir.c>
 #undef __readdir64
 strong_alias (__readdir, __readdir64)
+strong_alias (__readdir, __GI___readdir64)
 #undef readdir64
 weak_alias (__readdir, readdir64)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 25/58] Hide internal sysinfo functions [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (27 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 49/58] Hide internal __nis_hash function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:29   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 14/58] Mark internal gshadow functions with attribute_hidden " H.J. Lu
                   ` (29 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal sysinfo functions to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/sysinfo.h (__get_nprocs_conf): Add
	libc_hidden_proto.
	(__get_nprocs): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
	(__get_child_max): Add attribute_hidden.
	* misc/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def.
	(__get_nprocs): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
	* sysdeps/mach/getsysstats.c (__get_nprocs_conf): Add
	libc_hidden_def.
	(__get_nprocs): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Add
	libc_hidden_def.
	(__get_nprocs_conf): Likewise.
	(__get_phys_pages): Likewise.
	(__get_avphys_pages): Likewise.
---
 include/sys/sysinfo.h                 | 6 +++++-
 misc/getsysstats.c                    | 4 ++++
 sysdeps/mach/getsysstats.c            | 4 ++++
 sysdeps/unix/sysv/linux/getsysstats.c | 4 ++++
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h
index c33eae2883..7388356a19 100644
--- a/include/sys/sysinfo.h
+++ b/include/sys/sysinfo.h
@@ -7,18 +7,22 @@
 
 /* Return number of configured processors.  */
 extern int __get_nprocs_conf (void);
+libc_hidden_proto (__get_nprocs_conf)
 
 /* Return number of available processors.  */
 extern int __get_nprocs (void);
+libc_hidden_proto (__get_nprocs)
 
 /* Return number of physical pages of memory in the system.  */
 extern long int __get_phys_pages (void);
+libc_hidden_proto (__get_phys_pages)
 
 /* Return number of available physical pages of memory in the system.  */
 extern long int __get_avphys_pages (void);
+libc_hidden_proto (__get_avphys_pages)
 
 /* Return maximum number of processes this real user ID can have.  */
-extern long int __get_child_max (void);
+extern long int __get_child_max (void) attribute_hidden;
 
 # endif /* !_ISOMAC */
 #endif /* sys/sysinfo.h */
diff --git a/misc/getsysstats.c b/misc/getsysstats.c
index d25770ec52..cbad87a3a2 100644
--- a/misc/getsysstats.c
+++ b/misc/getsysstats.c
@@ -26,6 +26,7 @@ __get_nprocs_conf (void)
   /* We don't know how to determine the number.  Simply return always 1.  */
   return 1;
 }
+libc_hidden_def (__get_nprocs_conf)
 weak_alias (__get_nprocs_conf, get_nprocs_conf)
 
 link_warning (get_nprocs_conf, "warning: get_nprocs_conf will always return 1")
@@ -38,6 +39,7 @@ __get_nprocs (void)
   /* We don't know how to determine the number.  Simply return always 1.  */
   return 1;
 }
+libc_hidden_def (__get_nprocs)
 weak_alias (__get_nprocs, get_nprocs)
 
 link_warning (get_nprocs, "warning: get_nprocs will always return 1")
@@ -50,6 +52,7 @@ __get_phys_pages (void)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__get_phys_pages)
 weak_alias (__get_phys_pages, get_phys_pages)
 
 stub_warning (get_phys_pages)
@@ -62,6 +65,7 @@ __get_avphys_pages (void)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__get_avphys_pages)
 weak_alias (__get_avphys_pages, get_avphys_pages)
 
 stub_warning (get_avphys_pages)
diff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c
index 0dacab0300..3aabd61382 100644
--- a/sysdeps/mach/getsysstats.c
+++ b/sysdeps/mach/getsysstats.c
@@ -39,6 +39,7 @@ __get_nprocs_conf (void)
 
   return hbi.max_cpus;
 }
+libc_hidden_def (__get_nprocs_conf)
 weak_alias (__get_nprocs_conf, get_nprocs_conf)
 
 /* Return the number of processors currently available on the system. */
@@ -58,6 +59,7 @@ __get_nprocs (void)
 
   return hbi.avail_cpus;
 }
+libc_hidden_def (__get_nprocs)
 weak_alias (__get_nprocs, get_nprocs)
 
 /* Return the number of physical pages on the system. */
@@ -77,6 +79,7 @@ __get_phys_pages (void)
 
   return hbi.memory_size / __vm_page_size;
 }
+libc_hidden_def (__get_phys_pages)
 weak_alias (__get_phys_pages, get_phys_pages)
 
 /* Return the number of available physical pages */
@@ -102,4 +105,5 @@ __get_avphys_pages (void)
 
   return vs.free_count;
 }
+libc_hidden_def (__get_avphys_pages)
 weak_alias (__get_avphys_pages, get_avphys_pages)
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index d02c86d739..c245b3c662 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -226,6 +226,7 @@ __get_nprocs (void)
 
   return result;
 }
+libc_hidden_def (__get_nprocs)
 weak_alias (__get_nprocs, get_nprocs)
 
 
@@ -279,6 +280,7 @@ __get_nprocs_conf (void)
 
   return result;
 }
+libc_hidden_def (__get_nprocs_conf)
 weak_alias (__get_nprocs_conf, get_nprocs_conf)
 
 
@@ -320,6 +322,7 @@ __get_phys_pages (void)
   __sysinfo (&info);
   return sysinfo_mempages (info.totalram, info.mem_unit);
 }
+libc_hidden_def (__get_phys_pages)
 weak_alias (__get_phys_pages, get_phys_pages)
 
 long int
@@ -330,4 +333,5 @@ __get_avphys_pages (void)
   __sysinfo (&info);
   return sysinfo_mempages (info.freeram, info.mem_unit);
 }
+libc_hidden_def (__get_avphys_pages)
 weak_alias (__get_avphys_pages, get_avphys_pages)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (51 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 48/58] Hide internal __tcgetattr " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:43   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 34/58] Hide internal __assert_fail_base function " H.J. Lu
                   ` (5 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

	[BZ #18822]
	* elf/dl-iteratephdr.c (hidden_proto (__dl_iterate_phdr)): Moved
	to ...
	* include/link.h (hidden_proto (__dl_iterate_phdr)): Here.
---
 elf/dl-iteratephdr.c | 1 -
 include/link.h       | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/dl-iteratephdr.c b/elf/dl-iteratephdr.c
index ddd5bde831..88473e790b 100644
--- a/elf/dl-iteratephdr.c
+++ b/elf/dl-iteratephdr.c
@@ -28,7 +28,6 @@ cancel_handler (void *arg __attribute__((unused)))
   __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
 }
 
-hidden_proto (__dl_iterate_phdr)
 int
 __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
 				    size_t size, void *data), void *data)
diff --git a/include/link.h b/include/link.h
index eeb5f4d53b..3e1b2aefb7 100644
--- a/include/link.h
+++ b/include/link.h
@@ -341,6 +341,7 @@ struct link_map
 extern int __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
 					       size_t size, void *data),
 			      void *data);
+hidden_proto (__dl_iterate_phdr)
 
 /* We use this macro to refer to ELF macros independent of the native
    wordsize.  `ELFW(R_TYPE)' is used in place of `ELF32_R_TYPE' or
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 13/58] Mark internal statfs functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (30 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 23/58] Mark internal netlink " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:02   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 26/58] Mark internal intl " H.J. Lu
                   ` (26 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal statfs functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/statfs.h (__fstatfs): Add attribute_hidden.
	(__statfs64): Likewise.
	(__fstatfs64): Likewise.
	* include/sys/statvfs.h (__statvfs64): Likewise.
	(__fstatvfs64): Likewise.
	* sysdeps/unix/sysv/linux/pathconf.h (__statfs_link_max): Likewise.
	(__statfs_filesize_max): Likewise.
	(__statfs_symlinks): Likewise.
	(__statfs_chown_restricted): Likewise.
---
 include/sys/statfs.h               |  9 ++++++---
 include/sys/statvfs.h              |  6 ++++--
 sysdeps/unix/sysv/linux/pathconf.h | 12 ++++++++----
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/include/sys/statfs.h b/include/sys/statfs.h
index 3fac4a3490..8a9f5a7b3b 100644
--- a/include/sys/statfs.h
+++ b/include/sys/statfs.h
@@ -6,9 +6,12 @@
 /* Now define the internal interfaces.  */
 extern int __statfs (const char *__file, struct statfs *__buf);
 libc_hidden_proto (__statfs)
-extern int __fstatfs (int __fildes, struct statfs *__buf);
-extern int __statfs64 (const char *__file, struct statfs64 *__buf);
-extern int __fstatfs64 (int __fildes, struct statfs64 *__buf);
+extern int __fstatfs (int __fildes, struct statfs *__buf)
+     attribute_hidden;
+extern int __statfs64 (const char *__file, struct statfs64 *__buf)
+     attribute_hidden;
+extern int __fstatfs64 (int __fildes, struct statfs64 *__buf)
+     attribute_hidden;
 
 # endif /* !_ISOMAC */
 #endif
diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h
index fa3045386d..4cd1977c35 100644
--- a/include/sys/statvfs.h
+++ b/include/sys/statvfs.h
@@ -3,8 +3,10 @@
 
 #ifndef _ISOMAC
 /* Now define the internal interfaces.  */
-extern int __statvfs64 (const char *__file, struct statvfs64 *__buf);
-extern int __fstatvfs64 (int __fildes, struct statvfs64 *__buf);
+extern int __statvfs64 (const char *__file, struct statvfs64 *__buf)
+     attribute_hidden;
+extern int __fstatvfs64 (int __fildes, struct statvfs64 *__buf)
+     attribute_hidden;
 
 libc_hidden_proto (statvfs)
 libc_hidden_proto (fstatvfs)
diff --git a/sysdeps/unix/sysv/linux/pathconf.h b/sysdeps/unix/sysv/linux/pathconf.h
index 5de2915f40..b9de04f268 100644
--- a/sysdeps/unix/sysv/linux/pathconf.h
+++ b/sysdeps/unix/sysv/linux/pathconf.h
@@ -24,17 +24,21 @@
 /* Used like: return __statfs_link_max (__statfs (name, &buf), &buf,
 					name, -1); */
 extern long int __statfs_link_max (int result, const struct statfs *fsbuf,
-				   const char *file, int fd);
+				   const char *file, int fd)
+     attribute_hidden;
 
 
 /* Used like: return __statfs_filesize_max (__statfs (name, &buf), &buf); */
-extern long int __statfs_filesize_max (int result, const struct statfs *fsbuf);
+extern long int __statfs_filesize_max (int result, const struct statfs *fsbuf)
+     attribute_hidden;
 
 
 /* Used like: return __statfs_link_max (__statfs (name, &buf), &buf); */
-extern long int __statfs_symlinks (int result, const struct statfs *fsbuf);
+extern long int __statfs_symlinks (int result, const struct statfs *fsbuf)
+     attribute_hidden;
 
 
 /* Used like: return __statfs_chown_restricted (__statfs (name, &buf), &buf);*/
 extern long int __statfs_chown_restricted (int result,
-					   const struct statfs *fsbuf);
+					   const struct statfs *fsbuf)
+     attribute_hidden;
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 37/58] Hide internal __bsd_getpt function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (23 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 58/58] Hide internal fadvise64/fallocate64 functions " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:42   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 27/58] Hide internal __ioctl " H.J. Lu
                   ` (33 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __bsd_getpt function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/getpt.c (__bsd_getpt): Add
	attribute_hidden.
---
 sysdeps/unix/sysv/linux/getpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
index a92b8f988d..da3df47cd6 100644
--- a/sysdeps/unix/sysv/linux/getpt.c
+++ b/sysdeps/unix/sysv/linux/getpt.c
@@ -31,7 +31,7 @@
 #define _PATH_DEVPTS _PATH_DEV "pts"
 
 /* Prototype for function that opens BSD-style master pseudo-terminals.  */
-int __bsd_getpt (void);
+extern int __bsd_getpt (void) attribute_hidden;
 
 /* Open a master pseudo terminal and return its file descriptor.  */
 int
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 20/58] Hide internal regex functions [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (40 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 33/58] Hide internal __sysinfo " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:27   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 21/58] Hide __readv and __writev " H.J. Lu
                   ` (16 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal regex functions to allow direct access within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/regex.h (__re_compile_fastmap): Add attribute_hidden.
	(__regcomp): Add libc_hidden_proto.
	(__regexec): Likewise.
	(__regfree): Likewise.
	* posix/regcomp.c (__regcomp): Add libc_hidden_def.
	(__regfree): Likewise.
	* posix/regexec.c (__regexec): Likewise.
---
 include/regex.h | 6 +++++-
 posix/regcomp.c | 2 ++
 posix/regexec.c | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/regex.h b/include/regex.h
index fd4beeff3d..24eca2c297 100644
--- a/include/regex.h
+++ b/include/regex.h
@@ -8,7 +8,8 @@ extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax);
 extern const char *__re_compile_pattern (const char *pattern, size_t length,
 					 struct re_pattern_buffer *buffer);
 
-extern int __re_compile_fastmap (struct re_pattern_buffer *buffer);
+extern int __re_compile_fastmap (struct re_pattern_buffer *buffer)
+     attribute_hidden;
 
 extern int __re_search (struct re_pattern_buffer *buffer, const char *string,
 			int length, int start, int range,
@@ -33,13 +34,16 @@ extern void __re_set_registers
    unsigned num_regs, regoff_t *starts, regoff_t *ends);
 
 extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags);
+libc_hidden_proto (__regcomp)
 
 extern int __regexec (const regex_t *__preg, const char *__string,
 		      size_t __nmatch, regmatch_t __pmatch[], int __eflags);
+libc_hidden_proto (__regexec)
 
 extern size_t __regerror (int __errcode, const regex_t *__preg,
 			  char *__errbuf, size_t __errbuf_size);
 
 extern void __regfree (regex_t *__preg);
+libc_hidden_proto (__regfree)
 #endif
 #endif
diff --git a/posix/regcomp.c b/posix/regcomp.c
index a5b46139a9..871ae2ffab 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -517,6 +517,7 @@ regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
   return (int) ret;
 }
 #ifdef _LIBC
+libc_hidden_def (__regcomp)
 weak_alias (__regcomp, regcomp)
 #endif
 
@@ -644,6 +645,7 @@ regfree (regex_t *preg)
   preg->translate = NULL;
 }
 #ifdef _LIBC
+libc_hidden_def (__regfree)
 weak_alias (__regfree, regfree)
 #endif
 \f
diff --git a/posix/regexec.c b/posix/regexec.c
index f46b1f71ca..a96d86d431 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -224,6 +224,8 @@ regexec (const regex_t *__restrict preg, const char *__restrict string,
 }
 
 #ifdef _LIBC
+libc_hidden_def (__regexec)
+
 # include <shlib-compat.h>
 versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
 
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 58/58] Hide internal fadvise64/fallocate64 functions [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (22 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 46/58] Hide internal __vstrfmon_l " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  1:05   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 37/58] Hide internal __bsd_getpt function " H.J. Lu
                   ` (34 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal fadvise64/fallocate64 functions to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/posix_fadvise64.c
	(__posix_fadvise64_l64): Add Add libc_hidden_proto and
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/posix_fallocate64.c
	(__posix_fallocate64_l64): Likewise.
---
 sysdeps/unix/sysv/linux/posix_fadvise64.c   | 2 ++
 sysdeps/unix/sysv/linux/posix_fallocate64.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c
index aaee60add7..6dee86c833 100644
--- a/sysdeps/unix/sysv/linux/posix_fadvise64.c
+++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c
@@ -20,6 +20,7 @@
 #include <shlib-compat.h>
 
 int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
+libc_hidden_proto (__posix_fadvise64_l64)
 
 /* Both arm and powerpc implements fadvise64_64 with last 'advise' argument
    just after 'fd' to avoid the requirement of implementing 7-arg syscalls.
@@ -83,3 +84,4 @@ weak_alias (__posix_fadvise64_l64, posix_fadvise64);
 weak_alias (__posix_fadvise64_l64, posix_fadvise64);
 strong_alias (__posix_fadvise64_l64, posix_fadvise);
 #endif
+libc_hidden_def (__posix_fadvise64_l64)
diff --git a/sysdeps/unix/sysv/linux/posix_fallocate64.c b/sysdeps/unix/sysv/linux/posix_fallocate64.c
index eb05f7c5d0..76cf27a616 100644
--- a/sysdeps/unix/sysv/linux/posix_fallocate64.c
+++ b/sysdeps/unix/sysv/linux/posix_fallocate64.c
@@ -19,6 +19,7 @@
 #include <sysdep.h>
 
 extern int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len);
+libc_hidden_proto (__posix_fallocate64_l64)
 #define __posix_fallocate64_l64 static internal_fallocate64
 #include <sysdeps/posix/posix_fallocate64.c>
 #undef __posix_fallocate64_l64
@@ -42,3 +43,4 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
     return INTERNAL_SYSCALL_ERRNO (res, err);
   return internal_fallocate64 (fd, offset, len);
 }
+libc_hidden_def (__posix_fallocate64_l64)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (53 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 34/58] Hide internal __assert_fail_base function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:34   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 44/58] Hide internal __hash_string function " H.J. Lu
                   ` (3 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __posix_spawn_file_actions_realloc and /__spawni functions
to allow direct access within libc.so and libc.a without using GOT nor
PLT.

	[BZ #18822]
	* posix/spawn_int.h (__posix_spawn_file_actions_realloc): Add
	attribute_hidden.
	(__spawni): Likewise.
---
 posix/spawn_int.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/posix/spawn_int.h b/posix/spawn_int.h
index 6ada827f55..01bf603e27 100644
--- a/posix/spawn_int.h
+++ b/posix/spawn_int.h
@@ -57,12 +57,13 @@ struct __spawn_action
 #define SPAWN_XFLAGS_TRY_SHELL	0x2
 
 extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
-					       file_actions);
+					       file_actions)
+     attribute_hidden;
 
 extern int __spawni (pid_t *pid, const char *path,
 		     const posix_spawn_file_actions_t *file_actions,
 		     const posix_spawnattr_t *attrp, char *const argv[],
-		     char *const envp[], int xflags);
+		     char *const envp[], int xflags) attribute_hidden;
 
 /* Return true if FD falls into the range valid for file descriptors.
    The check in this form is mandated by POSIX.  */
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 46/58] Hide internal __vstrfmon_l function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (21 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 29/58] Hide internal __mremap function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:44   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 58/58] Hide internal fadvise64/fallocate64 functions " H.J. Lu
                   ` (35 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __vstrfmon_l function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/monetary.h (__vstrfmon_l): Add attribute_hidden.
---
 include/monetary.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/monetary.h b/include/monetary.h
index 2a182636d2..c130ed56a3 100644
--- a/include/monetary.h
+++ b/include/monetary.h
@@ -3,5 +3,6 @@
 #include <stdarg.h>
 
 extern ssize_t __vstrfmon_l (char *s, size_t maxsize, locale_t loc,
-			     const char *format, va_list ap);
+			     const char *format, va_list ap)
+     attribute_hidden;
 #endif
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 43/58] Hide internal __hasmntopt function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (43 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:38   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 35/58] Hide internal __tdestroy " H.J. Lu
                   ` (13 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __hasmntopt function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/mntent.h (__hasmntopt): Add libc_hidden_proto.
	* misc/mntent_r.c (__hasmntopt): Add libc_hidden_def.
---
 include/mntent.h | 1 +
 misc/mntent_r.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/mntent.h b/include/mntent.h
index 169210fc66..a16298ed6e 100644
--- a/include/mntent.h
+++ b/include/mntent.h
@@ -15,6 +15,7 @@ extern char *__hasmntopt (const struct mntent *__mnt, const char *__opt);
 libc_hidden_proto (__setmntent)
 libc_hidden_proto (__getmntent_r)
 libc_hidden_proto (__endmntent)
+libc_hidden_proto (__hasmntopt)
 
 # endif /* !_ISOMAC */
 #endif
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 30f55212be..96bd1e2fb4 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -293,4 +293,5 @@ __hasmntopt (const struct mntent *mnt, const char *opt)
 
   return NULL;
 }
+libc_hidden_def (__hasmntopt)
 weak_alias (__hasmntopt, hasmntopt)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 26/58] Mark internal intl functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (31 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 13/58] Mark internal statfs " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:25   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 47/58] Hide internal __setrlimit function " H.J. Lu
                   ` (25 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal intl functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* intl/gettextP.h (__dcngettext): Add attribute_hidden.
	(__dcigettext): Likewise.
---
 intl/gettextP.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/intl/gettextP.h b/intl/gettextP.h
index 75b203ab52..d0af470b25 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -49,11 +49,12 @@ extern char *__dngettext (const char *__domainname,
 			  unsigned long int n);
 extern char *__dcngettext (const char *__domainname,
 			   const char *__msgid1, const char *__msgid2,
-			   unsigned long int __n, int __category);
+			   unsigned long int __n, int __category)
+     attribute_hidden;
 extern char *__dcigettext (const char *__domainname,
 			   const char *__msgid1, const char *__msgid2,
 			   int __plural, unsigned long int __n,
-			   int __category);
+			   int __category) attribute_hidden;
 extern char *__textdomain (const char *__domainname);
 extern char *__bindtextdomain (const char *__domainname,
 			       const char *__dirname);
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 45/58] Hide internal __sched_setparam function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (35 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 05/58] Mark internal argp functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:42   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 32/58] Hide internal signal functions " H.J. Lu
                   ` (21 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __sched_setparam function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

__GI___sched_setparam is defined when sysdeps/unix/syscalls.list is
used to generate sched_setparam.  Otherwise libc_hidden_def is needed
explicitly.

	[BZ #18822]
	* include/sched.h (__sched_setparam): Add libc_hidden_proto.
	* posix/sched_setp.c (__sched_setparam): Add libc_hidden_def.
---
 include/sched.h    | 1 +
 posix/sched_setp.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/sched.h b/include/sched.h
index f75faed4ce..b698f78666 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -5,6 +5,7 @@
 /* Now define the internal interfaces.  */
 extern int __sched_setparam (__pid_t __pid,
 			     const struct sched_param *__param);
+libc_hidden_proto (__sched_setparam)
 extern int __sched_getparam (__pid_t __pid, struct sched_param *__param);
 extern int __sched_setscheduler (__pid_t __pid, int __policy,
 				 const struct sched_param *__param);
diff --git a/posix/sched_setp.c b/posix/sched_setp.c
index 17c3af322a..ad50d5abe7 100644
--- a/posix/sched_setp.c
+++ b/posix/sched_setp.c
@@ -29,4 +29,5 @@ __sched_setparam (pid_t pid, const struct sched_param *param)
 }
 stub_warning (sched_setparam)
 
+libc_hidden_def (__sched_setparam)
 weak_alias (__sched_setparam, sched_setparam)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 49/58] Hide internal __nis_hash function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (26 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 41/58] Hide internal idna functions " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:49   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 25/58] Hide internal sysinfo functions " H.J. Lu
                   ` (30 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

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(+)

diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index a225623f92..56e6d1421f 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -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
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 44/58] Hide internal __hash_string function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (54 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-02  0:40   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 17/58] Mark internal dirent functions with attribute_hidden " H.J. Lu
                   ` (2 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __hash_string function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* intl/hash-string.h (__hash_string): Add attribute_hidden.
---
 intl/hash-string.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/intl/hash-string.h b/intl/hash-string.h
index 21dcb16739..e579a7cab3 100644
--- a/intl/hash-string.h
+++ b/intl/hash-string.h
@@ -31,4 +31,5 @@
 /* Defines the so called `hashpjw' function by P.J. Weinberger
    [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
    1986, 1987 Bell Telephone Laboratories, Inc.]  */
-extern unsigned long int __hash_string (const char *str_param);
+extern unsigned long int __hash_string (const char *str_param)
+     attribute_hidden;
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 23/58] Mark internal netlink functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (29 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 14/58] Mark internal gshadow functions with attribute_hidden " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:25   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 13/58] Mark internal statfs " H.J. Lu
                   ` (27 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal netlink functions with attribute_hidden to allow direct
access within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/netlinkaccess.h (__netlink_open): Add
	attribute_hidden.
	(__netlink_close): Likewise.
	(__netlink_free_handle): Likewise.
	(__netlink_request): Likewise.
---
 sysdeps/unix/sysv/linux/netlinkaccess.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/netlinkaccess.h b/sysdeps/unix/sysv/linux/netlinkaccess.h
index 66bbbe6158..f4973e2a04 100644
--- a/sysdeps/unix/sysv/linux/netlinkaccess.h
+++ b/sysdeps/unix/sysv/linux/netlinkaccess.h
@@ -44,10 +44,12 @@ struct netlink_handle
 };
 
 
-extern int __netlink_open (struct netlink_handle *h);
-extern void __netlink_close (struct netlink_handle *h);
-extern void __netlink_free_handle (struct netlink_handle *h);
-extern int __netlink_request (struct netlink_handle *h, int type);
+extern int __netlink_open (struct netlink_handle *h) attribute_hidden;
+extern void __netlink_close (struct netlink_handle *h) attribute_hidden;
+extern void __netlink_free_handle (struct netlink_handle *h)
+     attribute_hidden;
+extern int __netlink_request (struct netlink_handle *h, int type)
+     attribute_hidden;
 
 /* Terminate the process if RESULT is an invalid recvmsg result for
    the netlink socket FD.  */
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 05/58] Mark internal argp functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (34 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 39/58] Hide internal __get_sol " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 21:42   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 45/58] Hide internal __sched_setparam function " H.J. Lu
                   ` (22 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal argp functions with attribute_hidden to allow direct
access to them within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* argp/argp-fmtstream.c: Include <argp-fmtstream.h>.
	* argp/argp-fs-xinl.c: Likewise.
	* argp/argp-help.c: Include <argp.h> and <argp-fmtstream.h>.
	* argp/argp-parse.c: Include <argp.h>.
	* argp/argp-xinl.c: Likewise.
	* include/argp-fmtstream.h: New file.
	* include/argp.h (__argp_error): Add attribute_hidden.
	(__argp_failure): Likewise.
	(__argp_input): Likewise.
	(__argp_state_help): Likewise.
---
 argp/argp-fmtstream.c    |  2 +-
 argp/argp-fs-xinl.c      |  2 +-
 argp/argp-help.c         |  4 ++--
 argp/argp-parse.c        |  2 +-
 argp/argp-xinl.c         |  2 +-
 include/argp-fmtstream.h | 19 +++++++++++++++++++
 include/argp.h           | 10 ++++++++++
 7 files changed, 35 insertions(+), 6 deletions(-)
 create mode 100644 include/argp-fmtstream.h

diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
index 9e41708cbd..f12c265196 100644
--- a/argp/argp-fmtstream.c
+++ b/argp/argp-fmtstream.c
@@ -30,7 +30,7 @@
 #include <stdarg.h>
 #include <ctype.h>
 
-#include "argp-fmtstream.h"
+#include <argp-fmtstream.h>
 #include "argp-namefrob.h"
 
 #ifndef ARGP_FMTSTREAM_USE_LINEWRAP
diff --git a/argp/argp-fs-xinl.c b/argp/argp-fs-xinl.c
index f0ce509040..8ebbb8eb1f 100644
--- a/argp/argp-fs-xinl.c
+++ b/argp/argp-fs-xinl.c
@@ -24,7 +24,7 @@
 #define ARGP_FS_EI
 #undef __OPTIMIZE__
 #define __OPTIMIZE__ 1
-#include "argp-fmtstream.h"
+#include <argp-fmtstream.h>
 
 #if 0
 /* Not exported.  */
diff --git a/argp/argp-help.c b/argp/argp-help.c
index e704c5a3aa..821d98c3d6 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -79,8 +79,8 @@ char *strerror (int errnum);
 # endif
 #endif
 
-#include "argp.h"
-#include "argp-fmtstream.h"
+#include <argp.h>
+#include <argp-fmtstream.h>
 #include "argp-namefrob.h"
 
 #ifndef SIZE_MAX
diff --git a/argp/argp-parse.c b/argp/argp-parse.c
index 662eed32ad..691c4623ac 100644
--- a/argp/argp-parse.c
+++ b/argp/argp-parse.c
@@ -62,7 +62,7 @@ char *alloca ();
 # define N_(msgid) (msgid)
 #endif
 
-#include "argp.h"
+#include <argp.h>
 #include "argp-namefrob.h"
 
 /* Getopt return values.  */
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 0b45bdc86b..206d0e46c7 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -31,7 +31,7 @@
 #define ARGP_EI
 #undef __OPTIMIZE__
 #define __OPTIMIZE__ 1
-#include "argp.h"
+#include <argp.h>
 
 /* Add weak aliases.  */
 #if _LIBC - 0 && defined (weak_alias)
diff --git a/include/argp-fmtstream.h b/include/argp-fmtstream.h
new file mode 100644
index 0000000000..45c65ce834
--- /dev/null
+++ b/include/argp-fmtstream.h
@@ -0,0 +1,19 @@
+#ifndef _ARGP_FMTSTREAM_H
+#include <argp/argp-fmtstream.h>
+
+#ifndef _ISOMAC
+extern __typeof (__argp_fmtstream_ensure) __argp_fmtstream_ensure
+      attribute_hidden;
+extern __typeof (__argp_fmtstream_free) __argp_fmtstream_free
+      attribute_hidden;
+extern __typeof (__argp_fmtstream_printf) __argp_fmtstream_printf
+      attribute_hidden;
+extern __typeof (__argp_fmtstream_update) __argp_fmtstream_update
+      attribute_hidden;
+extern __typeof (__argp_fmtstream_write) __argp_fmtstream_write
+      attribute_hidden;
+extern __typeof (__argp_make_fmtstream) __argp_make_fmtstream
+      attribute_hidden;
+#endif
+
+#endif
diff --git a/include/argp.h b/include/argp.h
index 92be5f90f1..6cf8782060 100644
--- a/include/argp.h
+++ b/include/argp.h
@@ -1 +1,11 @@
+#ifndef _ARGP_H
 #include <argp/argp.h>
+
+#ifndef _ISOMAC
+extern __typeof (__argp_error) __argp_error attribute_hidden;
+extern __typeof (__argp_failure) __argp_failure attribute_hidden;
+extern __typeof (__argp_input) __argp_input attribute_hidden;
+extern __typeof (__argp_state_help) __argp_state_help attribute_hidden;
+#endif
+
+#endif
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 39/58] Hide internal __get_sol function [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (33 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 47/58] Hide internal __setrlimit function " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 22:44   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 05/58] Mark internal argp functions with attribute_hidden " H.J. Lu
                   ` (23 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Hide internal __get_sol function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/getsourcefilter.c: Include
	"getsourcefilter.h".
	* sysdeps/unix/sysv/linux/getsourcefilter.h: New file.
	* sysdeps/unix/sysv/linux/setsourcefilter.c: Include
	"getsourcefilter.h".
	(__get_sol): Removed.
---
 sysdeps/unix/sysv/linux/getsourcefilter.c |  1 +
 sysdeps/unix/sysv/linux/getsourcefilter.h | 20 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/setsourcefilter.c |  5 +----
 3 files changed, 22 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/getsourcefilter.h

diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.c b/sysdeps/unix/sysv/linux/getsourcefilter.c
index 806cb161e4..1465d69348 100644
--- a/sysdeps/unix/sysv/linux/getsourcefilter.c
+++ b/sysdeps/unix/sysv/linux/getsourcefilter.c
@@ -31,6 +31,7 @@
 #include <netrose/rose.h>
 #include <sys/param.h>
 #include <sys/socket.h>
+#include "getsourcefilter.h"
 
 
 static const struct
diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.h b/sysdeps/unix/sysv/linux/getsourcefilter.h
new file mode 100644
index 0000000000..ac49290881
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getsourcefilter.h
@@ -0,0 +1,20 @@
+/* __get_sol function prototype.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Defined in getsourcefilter.c.  */
+extern int __get_sol (int af, socklen_t len) attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/setsourcefilter.c b/sysdeps/unix/sysv/linux/setsourcefilter.c
index b4160ff4d8..ade424bbac 100644
--- a/sysdeps/unix/sysv/linux/setsourcefilter.c
+++ b/sysdeps/unix/sysv/linux/setsourcefilter.c
@@ -24,10 +24,7 @@
 #include <stdint.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
-
-
-/* Defined in getsourcefilter.c.  */
-extern int __get_sol (int af, socklen_t len);
+#include "getsourcefilter.h"
 
 
 int
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* [PATCH 06/58] Mark internal unistd functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (19 preceding siblings ...)
  2017-09-01 18:00 ` [PATCH 11/58] Mark internal nscd " H.J. Lu
@ 2017-09-01 18:01 ` H.J. Lu
  2017-10-01 21:43   ` H.J. Lu
  2017-09-01 18:01 ` [PATCH 29/58] Hide internal __mremap function " H.J. Lu
                   ` (37 subsequent siblings)
  58 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 18:01 UTC (permalink / raw)
  To: libc-alpha

Mark internal unistd functions with attribute_hidden to allow direct
access to them within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/unistd.h (__access): Add attribute_hidden.
	(__lseek64): Likewise.
	(__libc_pread64): Likewise.
	(__pipe2): Likewise.
	(__sleep): Likewise.
	(__chdir): Likewise.
	(__fchdir): Likewise.
	(__getcwd): Likewise.
	(__rmdir): Likewise.
	(__execvpe): Likewise.
	(__execve): Likewise.
	(__setsid): Likewise.
	(__getuid): Likewise.
	(__geteuid): Likewise.
	(__getgid): Likewise.
	(__getegid): Likewise.
	(__getgroups): Likewise.
	(__group_member): Likewise.
	(__ttyname_r): Likewise.
	(__isatty): Likewise.
	(__readlink): Likewise.
	(__unlink): Likewise.
	(__gethostname): Likewise.
	(__profil): Likewise.
	(__getdtablesize): Likewise.
	(__brk): Likewise.
	(__ftruncate): Likewise.
	(__ftruncate64): Likewise.
---
 include/unistd.h | 60 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 32 insertions(+), 28 deletions(-)

diff --git a/include/unistd.h b/include/unistd.h
index a5625ed7f4..4dc445e048 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -23,9 +23,10 @@ libc_hidden_proto (tcgetpgrp)
 libc_hidden_proto (readlinkat)
 
 /* Now define the internal interfaces.  */
-extern int __access (const char *__name, int __type);
+extern int __access (const char *__name, int __type) attribute_hidden;
 extern int __euidaccess (const char *__name, int __type);
-extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence);
+extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence)
+     attribute_hidden;
 extern __off_t __lseek (int __fd, __off_t __offset, int __whence);
 libc_hidden_proto (__lseek)
 extern __off_t __libc_lseek (int __fd, __off_t __offset, int __whence);
@@ -39,7 +40,7 @@ extern ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes,
 			  __off64_t __offset);
 libc_hidden_proto (__pread64);
 extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes,
-			       __off64_t __offset);
+			       __off64_t __offset) attribute_hidden;
 extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n,
 			 __off_t __offset);
 libc_hidden_proto (__pwrite)
@@ -58,8 +59,8 @@ libc_hidden_proto (__libc_write)
 libc_hidden_proto (write)
 extern int __pipe (int __pipedes[2]);
 libc_hidden_proto (__pipe)
-extern int __pipe2 (int __pipedes[2], int __flags);
-extern unsigned int __sleep (unsigned int __seconds);
+extern int __pipe2 (int __pipedes[2], int __flags) attribute_hidden;
+extern unsigned int __sleep (unsigned int __seconds) attribute_hidden;
 extern int __chown (const char *__file,
 		    __uid_t __owner, __gid_t __group);
 libc_hidden_proto (__chown)
@@ -67,12 +68,12 @@ extern int __fchown (int __fd,
 		     __uid_t __owner, __gid_t __group);
 extern int __lchown (const char *__file, __uid_t __owner,
 		     __gid_t __group);
-extern int __chdir (const char *__path);
-extern int __fchdir (int __fd);
-extern char *__getcwd (char *__buf, size_t __size);
-extern int __rmdir (const char *__path);
+extern int __chdir (const char *__path) attribute_hidden;
+extern int __fchdir (int __fd) attribute_hidden;
+extern char *__getcwd (char *__buf, size_t __size) attribute_hidden;
+extern int __rmdir (const char *__path) attribute_hidden;
 extern int __execvpe (const char *file, char *const argv[],
-		      char *const envp[]);
+		      char *const envp[]) attribute_hidden;
 
 /* Get the canonical absolute name of the named directory, and put it in SIZE
    bytes of BUF.  Returns NULL if the directory couldn't be determined or
@@ -91,7 +92,7 @@ libc_hidden_proto (__dup2)
 extern int __dup3 (int __fd, int __fd2, int flags);
 libc_hidden_proto (__dup3)
 extern int __execve (const char *__path, char *const __argv[],
-		     char *const __envp[]);
+		     char *const __envp[]) attribute_hidden;
 extern long int __pathconf (const char *__path, int __name);
 extern long int __fpathconf (int __fd, int __name);
 extern long int __sysconf (int __name);
@@ -99,14 +100,14 @@ libc_hidden_proto (__sysconf)
 extern __pid_t __getpid (void);
 libc_hidden_proto (__getpid)
 extern __pid_t __getppid (void);
-extern __pid_t __setsid (void);
-extern __uid_t __getuid (void);
-extern __uid_t __geteuid (void);
-extern __gid_t __getgid (void);
-extern __gid_t __getegid (void);
-extern int __getgroups (int __size, __gid_t __list[]);
+extern __pid_t __setsid (void) attribute_hidden;
+extern __uid_t __getuid (void) attribute_hidden;
+extern __uid_t __geteuid (void) attribute_hidden;
+extern __gid_t __getgid (void) attribute_hidden;
+extern __gid_t __getegid (void) attribute_hidden;
+extern int __getgroups (int __size, __gid_t __list[]) attribute_hidden;
 libc_hidden_proto (__getpgid)
-extern int __group_member (__gid_t __gid);
+extern int __group_member (__gid_t __gid) attribute_hidden;
 extern int __setuid (__uid_t __uid);
 extern int __setreuid (__uid_t __ruid, __uid_t __euid);
 extern int __setgid (__gid_t __gid);
@@ -123,17 +124,20 @@ libc_hidden_proto (__setresuid)
 libc_hidden_proto (__setresgid)
 extern __pid_t __vfork (void);
 libc_hidden_proto (__vfork)
-extern int __ttyname_r (int __fd, char *__buf, size_t __buflen);
-extern int __isatty (int __fd);
+extern int __ttyname_r (int __fd, char *__buf, size_t __buflen)
+     attribute_hidden;
+extern int __isatty (int __fd) attribute_hidden;
 extern int __link (const char *__from, const char *__to);
 extern int __symlink (const char *__from, const char *__to);
-extern ssize_t __readlink (const char *__path, char *__buf, size_t __len);
-extern int __unlink (const char *__name);
-extern int __gethostname (char *__name, size_t __len);
+extern ssize_t __readlink (const char *__path, char *__buf, size_t __len)
+     attribute_hidden;
+extern int __unlink (const char *__name) attribute_hidden;
+extern int __gethostname (char *__name, size_t __len) attribute_hidden;
 extern int __profil (unsigned short int *__sample_buffer, size_t __size,
-		     size_t __offset, unsigned int __scale);
-extern int __getdtablesize (void);
-extern int __brk (void *__addr);
+		     size_t __offset, unsigned int __scale)
+     attribute_hidden;
+extern int __getdtablesize (void) attribute_hidden;
+extern int __brk (void *__addr) attribute_hidden;
 extern int __close (int __fd);
 libc_hidden_proto (__close)
 extern int __libc_close (int __fd);
@@ -145,8 +149,8 @@ extern __pid_t __fork (void);
 libc_hidden_proto (__fork)
 extern int __getpagesize (void) __attribute__ ((__const__));
 libc_hidden_proto (__getpagesize)
-extern int __ftruncate (int __fd, __off_t __length);
-extern int __ftruncate64 (int __fd, __off64_t __length);
+extern int __ftruncate (int __fd, __off_t __length) attribute_hidden;
+extern int __ftruncate64 (int __fd, __off64_t __length) attribute_hidden;
 extern int __truncate (const char *path, __off_t __length);
 extern void *__sbrk (intptr_t __delta);
 libc_hidden_proto (__sbrk)
-- 
2.13.5

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 00/58] Hide internal functions in libc.so
  2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
                   ` (57 preceding siblings ...)
  2017-09-01 18:01 ` [PATCH 36/58] Hide internal __fopen_maybe_mmap function " H.J. Lu
@ 2017-09-01 18:16 ` Florian Weimer
  2017-09-01 19:42   ` H.J. Lu
  2017-09-01 20:14   ` Joseph Myers
  58 siblings, 2 replies; 130+ messages in thread
From: Florian Weimer @ 2017-09-01 18:16 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha

On 09/01/2017 07:59 PM, H.J. Lu wrote:
> On x86,
> 
> # readelf -rW libc_pic.a | grep " __" | grep PLT32  | awk '{ print $5 }' | sort | uniq
> 
> shows that many internal functions are called via PLT in libc.so.  This
> series of patches hides internal functions to allow direct access within
> libc.so and libc.a without using GOT nor PLT.

I think we need to automate the generation of hidden attributes (or the
hidden aliases).

Any ideas how we can do this?

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 00/58] Hide internal functions in libc.so
  2017-09-01 18:16 ` [PATCH 00/58] Hide internal functions in libc.so Florian Weimer
@ 2017-09-01 19:42   ` H.J. Lu
  2017-09-01 20:14   ` Joseph Myers
  1 sibling, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-09-01 19:42 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On Fri, Sep 1, 2017 at 11:16 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>> On x86,
>>
>> # readelf -rW libc_pic.a | grep " __" | grep PLT32  | awk '{ print $5 }' | sort | uniq
>>
>> shows that many internal functions are called via PLT in libc.so.  This
>> series of patches hides internal functions to allow direct access within
>> libc.so and libc.a without using GOT nor PLT.
>
> I think we need to automate the generation of hidden attributes (or the
> hidden aliases).

I'd love to see it.

> Any ideas how we can do this?
>

It won't be easy.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 00/58] Hide internal functions in libc.so
  2017-09-01 18:16 ` [PATCH 00/58] Hide internal functions in libc.so Florian Weimer
  2017-09-01 19:42   ` H.J. Lu
@ 2017-09-01 20:14   ` Joseph Myers
  2017-09-18 13:59     ` Florian Weimer
  1 sibling, 1 reply; 130+ messages in thread
From: Joseph Myers @ 2017-09-01 20:14 UTC (permalink / raw)
  To: Florian Weimer; +Cc: H.J. Lu, libc-alpha

On Fri, 1 Sep 2017, Florian Weimer wrote:

> On 09/01/2017 07:59 PM, H.J. Lu wrote:
> > On x86,
> > 
> > # readelf -rW libc_pic.a | grep " __" | grep PLT32  | awk '{ print $5 }' | sort | uniq
> > 
> > shows that many internal functions are called via PLT in libc.so.  This
> > series of patches hides internal functions to allow direct access within
> > libc.so and libc.a without using GOT nor PLT.
> 
> I think we need to automate the generation of hidden attributes (or the
> hidden aliases).

I'm not convinced, for the present patch series.  An internal function 
needs to be declared somewhere anyway, with or without an explicit hidden 
attribute, so putting the attribute there when declaring the function 
doesn't really complicate things.  (I do think that if the attributes are 
explicit, there should also be a test that any external symbol in an 
object going into a shared library, that doesn't end up as a (defined or 
undefined) dynamic symbol in that shared library, is hidden, so that 
adding a non-hidden internal function is immediately visible as a test 
failure.)

> Any ideas how we can do this?

Well, an alternative to marking internal functions hidden would be to mark 
exported functions (mostly but not entirely declared in the public 
headers) as exported, and then build with -fvisibility=hidden.  But that's 
still a lot of declarations in source files.  Maybe for each public header 
you could compile an include of it with -D_GNU_SOURCE -aux-info to get a 
list of functions (like conform/GlibcConform.pm does) and automatically 
generate a header with a series of

extern __typeof (foo) foo __attribute__ ((__visibility__ ("default")));

declarations.  (Note -aux-info only covers functions, not variables, and 
the exported names may not always be the ones declared in the header.  The 
Versions files would be another source of information on what should be 
exported.)

Now, currently getting a list of all public headers requires recursing 
into each build subdirectory and doing something like the above would 
require such recursing before any of the rest of the build could start - 
and recursing into each subdirectory is serialized, and comparatively 
slow.  If it were helpful we could e.g. decide to put all public headers 
either in an include-public directory, or in sysdeps directories, so e.g. 
include-public/stdlib.h instead of stdlib/stdlib.h.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 18/58] Mark internal utmp functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 18/58] Mark internal utmp functions with attribute_hidden " H.J. Lu
@ 2017-09-02 20:58   ` Florian Weimer
  2017-10-01 21:14     ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: Florian Weimer @ 2017-09-02 20:58 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha

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

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822] H.J. Lu
@ 2017-09-03  8:21   ` Florian Weimer
  2017-09-03  9:11     ` Florian Weimer
  0 siblings, 1 reply; 130+ messages in thread
From: Florian Weimer @ 2017-09-03  8:21 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha

On 09/01/2017 07:59 PM, H.J. Lu wrote:
> diff --git a/include/stdlib.h b/include/stdlib.h
> index 2274790a2e..d0dcbf81c3 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -5,6 +5,10 @@
>  #endif
>  #include <stdlib/stdlib.h>
>  
> +/* __dso_handle is always defined by either crtbegin.o from GCC or our
> +   dso_handle.c.  */
> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));

This causes conform test failures.  You need to use __visibility__ here.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-03  8:21   ` Florian Weimer
@ 2017-09-03  9:11     ` Florian Weimer
  2017-09-03 13:42       ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: Florian Weimer @ 2017-09-03  9:11 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha

On 09/03/2017 10:21 AM, Florian Weimer wrote:
> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>> diff --git a/include/stdlib.h b/include/stdlib.h
>> index 2274790a2e..d0dcbf81c3 100644
>> --- a/include/stdlib.h
>> +++ b/include/stdlib.h
>> @@ -5,6 +5,10 @@
>>  #endif
>>  #include <stdlib/stdlib.h>
>>  
>> +/* __dso_handle is always defined by either crtbegin.o from GCC or our
>> +   dso_handle.c.  */
>> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));
> 
> This causes conform test failures.  You need to use __visibility__ here.

Or alternatively, move the declaration under #ifndef _ISOMAC.  That's
probably the better approach because __dso_handle is not part of the
installed headers.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 19/58] Mark internal stdlib functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 19/58] Mark internal stdlib functions with attribute_hidden " H.J. Lu
@ 2017-09-03  9:13   ` Florian Weimer
  2017-09-03 21:49     ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: Florian Weimer @ 2017-09-03  9:13 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha

On 09/01/2017 07:59 PM, H.J. Lu wrote:
> 	(__qecvt_r): Likewise.
> 	(__qfcvt_r): Likewise.

I think this change makes symbols vanish from the public ABI on various
architectures:

--- ../sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
2017-08-28 05:01:14.557643019 -0400
+++ /home/bmg/build/glibcs/powerpc64-linux-gnu/glibc/libc.symlist
2017-09-03 05:07:32.110128081 -0400
@@ -1383 +1382,0 @@ GLIBC_2.3 qecvt F
-GLIBC_2.3 qecvt_r F
@@ -1385 +1383,0 @@ GLIBC_2.3 qfcvt F
-GLIBC_2.3 qfcvt_r F
@@ -2198 +2195,0 @@ GLIBC_2.4 qecvt F
-GLIBC_2.4 qecvt_r F
@@ -2200 +2196,0 @@ GLIBC_2.4 qfcvt F
-GLIBC_2.4 qfcvt_r F

(I assume that the patch is identical to what is on the hjl/pr18822
branch, which is what I used for testing.)

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-03  9:11     ` Florian Weimer
@ 2017-09-03 13:42       ` H.J. Lu
  2017-09-04  7:23         ` Florian Weimer
  0 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-03 13:42 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On Sun, Sep 3, 2017 at 2:11 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 09/03/2017 10:21 AM, Florian Weimer wrote:
>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>> diff --git a/include/stdlib.h b/include/stdlib.h
>>> index 2274790a2e..d0dcbf81c3 100644
>>> --- a/include/stdlib.h
>>> +++ b/include/stdlib.h
>>> @@ -5,6 +5,10 @@
>>>  #endif
>>>  #include <stdlib/stdlib.h>
>>>
>>> +/* __dso_handle is always defined by either crtbegin.o from GCC or our
>>> +   dso_handle.c.  */
>>> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));
>>
>> This causes conform test failures.  You need to use __visibility__ here.

I am testing it.

> Or alternatively, move the declaration under #ifndef _ISOMAC.  That's
> probably the better approach because __dso_handle is not part of the
> installed headers.
>

No, we can't do that.  Some tests reference __dso_handle and _ISOMAC
isn't defined for tests.

BTW, hjl/pr18822 branch is what I am using.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 19/58] Mark internal stdlib functions with attribute_hidden [BZ #18822]
  2017-09-03  9:13   ` Florian Weimer
@ 2017-09-03 21:49     ` H.J. Lu
  2017-10-01 21:10       ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-03 21:49 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On Sun, Sep 3, 2017 at 2:13 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>       (__qecvt_r): Likewise.
>>       (__qfcvt_r): Likewise.
>
> I think this change makes symbols vanish from the public ABI on various
> architectures:
>
> --- ../sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
> 2017-08-28 05:01:14.557643019 -0400
> +++ /home/bmg/build/glibcs/powerpc64-linux-gnu/glibc/libc.symlist
> 2017-09-03 05:07:32.110128081 -0400
> @@ -1383 +1382,0 @@ GLIBC_2.3 qecvt F
> -GLIBC_2.3 qecvt_r F
> @@ -1385 +1383,0 @@ GLIBC_2.3 qfcvt F
> -GLIBC_2.3 qfcvt_r F
> @@ -2198 +2195,0 @@ GLIBC_2.4 qecvt F
> -GLIBC_2.4 qecvt_r F
> @@ -2200 +2196,0 @@ GLIBC_2.4 qfcvt F
> -GLIBC_2.4 qfcvt_r F
>
> (I assume that the patch is identical to what is on the hjl/pr18822
> branch, which is what I used for testing.)

I updated hjl/pr18822 branch and there are no regressions with
build-many-glibcs.py.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-03 13:42       ` H.J. Lu
@ 2017-09-04  7:23         ` Florian Weimer
  2017-09-04 21:20           ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: Florian Weimer @ 2017-09-04  7:23 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

On 09/03/2017 03:42 PM, H.J. Lu wrote:
> On Sun, Sep 3, 2017 at 2:11 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 09/03/2017 10:21 AM, Florian Weimer wrote:
>>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>>> diff --git a/include/stdlib.h b/include/stdlib.h
>>>> index 2274790a2e..d0dcbf81c3 100644
>>>> --- a/include/stdlib.h
>>>> +++ b/include/stdlib.h
>>>> @@ -5,6 +5,10 @@
>>>>  #endif
>>>>  #include <stdlib/stdlib.h>
>>>>
>>>> +/* __dso_handle is always defined by either crtbegin.o from GCC or our
>>>> +   dso_handle.c.  */
>>>> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));
>>>
>>> This causes conform test failures.  You need to use __visibility__ here.

>> Or alternatively, move the declaration under #ifndef _ISOMAC.  That's
>> probably the better approach because __dso_handle is not part of the
>> installed headers.
>>
> 
> No, we can't do that.  Some tests reference __dso_handle and _ISOMAC
> isn't defined for tests.

These tests should be moved to tests-internal, or __dso_handle should be
declared in a different header and the tests should include it.

As far as I understand it, the _ISOMAC mechanism is there to make the
include/ headers as close as possible to the installed headers, so
declaring things there which are not available after installation
partially invalidates in-tree testing.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 24/58] Hide __chmod and __mkdir [BZ #18822]
  2017-09-01 18:01 ` [PATCH 24/58] Hide __chmod and __mkdir " H.J. Lu
@ 2017-09-04  8:05   ` Florian Weimer
  0 siblings, 0 replies; 130+ messages in thread
From: Florian Weimer @ 2017-09-04  8:05 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha

On 09/01/2017 07:59 PM, H.J. Lu wrote:
> Hide internal __chmod and __mkdir functions to allow direct access
> within libc.so and libc.a without using GOT nor PLT.
> 
> 	[BZ #18822]
> 	* include/sys/stat.h (__chmod): Add libc_hidden_proto.
> 	(__mkdir): Likewise.
> 	* io/chmod.c (__chmod): Add libc_hidden_def.
> 	* io/mkdir.c (__mkdir): Likewise.
> 	* sysdeps/mach/hurd/chmod.c (__chmod): Likewise.
> 	* sysdeps/mach/hurd/mkdir.c (__mkdir): Likewise.
> 	* sysdeps/unix/sysv/linux/generic/chmod.c (__chmod): Likewise.
> 	* sysdeps/unix/sysv/linux/generic/mkdir.c (__mkdir): Likewise.

Looks good to me.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-04  7:23         ` Florian Weimer
@ 2017-09-04 21:20           ` H.J. Lu
  2017-09-12 15:57             ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-04 21:20 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

On Mon, Sep 4, 2017 at 12:22 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 09/03/2017 03:42 PM, H.J. Lu wrote:
>> On Sun, Sep 3, 2017 at 2:11 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>> On 09/03/2017 10:21 AM, Florian Weimer wrote:
>>>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>>>> diff --git a/include/stdlib.h b/include/stdlib.h
>>>>> index 2274790a2e..d0dcbf81c3 100644
>>>>> --- a/include/stdlib.h
>>>>> +++ b/include/stdlib.h
>>>>> @@ -5,6 +5,10 @@
>>>>>  #endif
>>>>>  #include <stdlib/stdlib.h>
>>>>>
>>>>> +/* __dso_handle is always defined by either crtbegin.o from GCC or our
>>>>> +   dso_handle.c.  */
>>>>> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));
>>>>
>>>> This causes conform test failures.  You need to use __visibility__ here.
>
>>> Or alternatively, move the declaration under #ifndef _ISOMAC.  That's
>>> probably the better approach because __dso_handle is not part of the
>>> installed headers.
>>>
>>
>> No, we can't do that.  Some tests reference __dso_handle and _ISOMAC
>> isn't defined for tests.
>
> These tests should be moved to tests-internal, or __dso_handle should be

We may not define _ISOMAC for these tests since it may introduce
many issues.

> declared in a different header and the tests should include it.

Here is an updated with include/dso_handle.h.  OK for master?

Thanks.


-- 
H.J.

[-- Attachment #2: 0001-Mark-__dso_handle-as-hidden-BZ-18822.patch --]
[-- Type: text/x-patch, Size: 8947 bytes --]

From 5fe846c5f6f2fac2ca94065573e52f541f6d53a9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 18 Aug 2017 09:52:52 -0700
Subject: [PATCH] Mark __dso_handle as hidden [BZ #18822]

Since __dso_handle is always defined by either crtbegin.o from GCC or
dso_handle.c, it should be marked as hidden and be passed directly.

	[BZ #18822]
	* dlfcn/modatexit.c (foo): Remove __dso_handle check.
	* dlfcn/modcxaatexit.c: Include <dso_handle.h>.
	(__dso_handle): Remove declaration.
	* dlfcn/tstatexit.c (__dso_handle): Removed.
	(main): Don't check __dso_handle.
	* dlfcn/tstcxaatexit.c (__dso_handle): Removed.
	(main): Don't check __dso_handle.
	* include/dso_handle.h: New file.
	* malloc/mtrace.c: Include <dso_handle.h>.
	(mtrace): Pass __dso_handle directly.
	* nptl/pthread_atfork.c: Include <dso_handle.h>.
	(__dso_handle): Remove declaration.
	(__pthread_atfork): Pass __dso_handle directly.
	* nptl/tst-atfork2mod.c: Include <dso_handle.h>.
	(__dso_handle): Removed.
	* posix/wordexp-test.c: Include <dso_handle.h>.
	(__dso_handle): Remove declaration.
	(__app_register_atfork): Pass __dso_handle directly.
	* stdlib/at_quick_exit.c: Include <dso_handle.h>.
	(__dso_handle): Remove declaration.
	(at_quick_exit): Pass __dso_handle directly.
	* stdlib/atexit.c: Include <dso_handle.h>.
	(__dso_handle): Remove declaration.
	(atexit): Pass __dso_handle directly.
	* stdlib/tst-tls-atexit-lib.c: Include <dso_handle.h>.
	(__dso_handle): Removed.
---
 dlfcn/modatexit.c           | 2 --
 dlfcn/modcxaatexit.c        | 2 +-
 dlfcn/tstatexit.c           | 8 --------
 dlfcn/tstcxaatexit.c        | 8 --------
 include/dso_handle.h        | 3 +++
 malloc/mtrace.c             | 4 ++--
 nptl/pthread_atfork.c       | 8 ++------
 nptl/tst-atfork2mod.c       | 2 +-
 posix/wordexp-test.c        | 5 ++---
 stdlib/at_quick_exit.c      | 8 ++------
 stdlib/atexit.c             | 9 ++-------
 stdlib/tst-tls-atexit-lib.c | 3 +--
 12 files changed, 16 insertions(+), 46 deletions(-)
 create mode 100644 include/dso_handle.h

diff --git a/dlfcn/modatexit.c b/dlfcn/modatexit.c
index e620d10c70..95c18dcbac 100644
--- a/dlfcn/modatexit.c
+++ b/dlfcn/modatexit.c
@@ -35,9 +35,7 @@ dummy (void)
 void
 foo (void *p)
 {
-  extern void *__dso_handle __attribute__ ((__weak__));
   printf ("This is %s\n", __FUNCTION__);
   atexit (dummy);
-  if (&__dso_handle) puts ("have dso handle"); else puts ("no dso handle");
   ip = p;
 }
diff --git a/dlfcn/modcxaatexit.c b/dlfcn/modcxaatexit.c
index fbda2f3c9f..917a97d813 100644
--- a/dlfcn/modcxaatexit.c
+++ b/dlfcn/modcxaatexit.c
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <dso_handle.h>
 
 extern void fluffy (void *p);
 extern void bar (void *p);
@@ -34,7 +35,6 @@ fluffy (void *p)
 void
 bar (void *p)
 {
-  extern void *__dso_handle;
   printf ("This is %s\n", __FUNCTION__);
   __cxa_atexit (fluffy, p, __dso_handle);
 }
diff --git a/dlfcn/tstatexit.c b/dlfcn/tstatexit.c
index 2073843b8f..e25a3f8000 100644
--- a/dlfcn/tstatexit.c
+++ b/dlfcn/tstatexit.c
@@ -20,8 +20,6 @@
 #include <stdlib.h>
 
 
-extern void *__dso_handle __attribute__ ((__weak__));
-
 int
 main (void)
 {
@@ -30,12 +28,6 @@ main (void)
   void (*fp) (void *);
   int v = 0;
 
-  if (&__dso_handle == NULL)
-    {
-      puts ("__dso_handle not available, cannot perform the test");
-      exit (0);
-    }
-
   h = dlopen (fname, RTLD_NOW);
   if (h == NULL)
     {
diff --git a/dlfcn/tstcxaatexit.c b/dlfcn/tstcxaatexit.c
index fde645c16b..37f25d63d4 100644
--- a/dlfcn/tstcxaatexit.c
+++ b/dlfcn/tstcxaatexit.c
@@ -19,8 +19,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-extern void *__dso_handle __attribute__ ((__weak__));
-
 int
 main (void)
 {
@@ -29,12 +27,6 @@ main (void)
   void (*fp) (void *);
   int v = 0;
 
-  if (&__dso_handle == NULL)
-    {
-      puts ("__dso_handle not available, cannot perform the test");
-      exit (0);
-    }
-
   h = dlopen (fname, RTLD_LAZY);
   if (h == NULL)
     {
diff --git a/include/dso_handle.h b/include/dso_handle.h
new file mode 100644
index 0000000000..d9c1ebbce4
--- /dev/null
+++ b/include/dso_handle.h
@@ -0,0 +1,3 @@
+/* __dso_handle is always defined by either crtbegin.o from GCC or our
+   dso_handle.c.  */
+extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
diff --git a/malloc/mtrace.c b/malloc/mtrace.c
index 6c362d9679..9eb2f5f1c7 100644
--- a/malloc/mtrace.c
+++ b/malloc/mtrace.c
@@ -34,6 +34,7 @@
 #include <_itoa.h>
 
 #include <libc-internal.h>
+#include <dso_handle.h>
 
 #include <libio/iolibio.h>
 #define setvbuf(s, b, f, l) _IO_setvbuf (s, b, f, l)
@@ -315,10 +316,9 @@ mtrace (void)
 #ifdef _LIBC
           if (!added_atexit_handler)
             {
-              extern void *__dso_handle __attribute__ ((__weak__));
               added_atexit_handler = 1;
               __cxa_atexit ((void (*)(void *))release_libc_mem, NULL,
-                            &__dso_handle ? __dso_handle : NULL);
+			    __dso_handle);
             }
 #endif
         }
diff --git a/nptl/pthread_atfork.c b/nptl/pthread_atfork.c
index dc2ea07887..f1aa2b3cf1 100644
--- a/nptl/pthread_atfork.c
+++ b/nptl/pthread_atfork.c
@@ -35,10 +35,7 @@
 
 #include "pthreadP.h"
 #include <fork.h>
-
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__,
-					  __visibility__ ("hidden")));
+#include <dso_handle.h>
 
 
 /* Hide the symbol so that no definition but the one locally in the
@@ -51,8 +48,7 @@ attribute_hidden
 __pthread_atfork (void (*prepare) (void), void (*parent) (void),
 		  void (*child) (void))
 {
-  return __register_atfork (prepare, parent, child,
-			    &__dso_handle == NULL ? NULL : __dso_handle);
+  return __register_atfork (prepare, parent, child, __dso_handle);
 }
 #ifndef __pthread_atfork
 extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
diff --git a/nptl/tst-atfork2mod.c b/nptl/tst-atfork2mod.c
index fe64046d3c..ea47d5825a 100644
--- a/nptl/tst-atfork2mod.c
+++ b/nptl/tst-atfork2mod.c
@@ -19,6 +19,7 @@
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <dso_handle.h>
 
 
 extern int val;
@@ -46,7 +47,6 @@ static void
 __attribute__ ((constructor))
 init (void)
 {
-  extern void *__dso_handle;
   printf ("dsohandle = %p\n", __dso_handle);
 
   if (pthread_atfork (prepare, parent, child) != 0)
diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c
index 17ae812346..c030a4d670 100644
--- a/posix/wordexp-test.c
+++ b/posix/wordexp-test.c
@@ -27,16 +27,15 @@
 #include <string.h>
 #include <wordexp.h>
 #include <libc-pointer-arith.h>
+#include <dso_handle.h>
 
 #define IFS " \n\t"
 
-extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden")));
 extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *);
 
 static int __app_register_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void))
 {
-  return __register_atfork (prepare, parent, child,
-			    &__dso_handle == NULL ? NULL : __dso_handle);
+  return __register_atfork (prepare, parent, child, __dso_handle);
 }
 
 /* Number of forks seen.  */
diff --git a/stdlib/at_quick_exit.c b/stdlib/at_quick_exit.c
index 3b74d0a688..0f1c1fde9e 100644
--- a/stdlib/at_quick_exit.c
+++ b/stdlib/at_quick_exit.c
@@ -33,18 +33,14 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <dso_handle.h>
 #include "exit.h"
 
 
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-
 /* Register FUNC to be executed by `quick_exit'.  */
 int
 attribute_hidden
 at_quick_exit (void (*func) (void))
 {
-  return __cxa_at_quick_exit ((void (*) (void *)) func,
-			      &__dso_handle == NULL ? NULL : __dso_handle);
+  return __cxa_at_quick_exit ((void (*) (void *)) func, __dso_handle);
 }
diff --git a/stdlib/atexit.c b/stdlib/atexit.c
index f28b6ba1b7..aaecb4a503 100644
--- a/stdlib/atexit.c
+++ b/stdlib/atexit.c
@@ -33,13 +33,9 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <dso_handle.h>
 #include "exit.h"
 
-
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-
 /* Register FUNC to be executed by `exit'.  */
 int
 #ifndef atexit
@@ -47,6 +43,5 @@ attribute_hidden
 #endif
 atexit (void (*func) (void))
 {
-  return __cxa_atexit ((void (*) (void *)) func, NULL,
-		       &__dso_handle == NULL ? NULL : __dso_handle);
+  return __cxa_atexit ((void (*) (void *)) func, NULL, __dso_handle);
 }
diff --git a/stdlib/tst-tls-atexit-lib.c b/stdlib/tst-tls-atexit-lib.c
index a227e4653c..06ec02f4ee 100644
--- a/stdlib/tst-tls-atexit-lib.c
+++ b/stdlib/tst-tls-atexit-lib.c
@@ -17,8 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
-
-extern void *__dso_handle;
+#include <dso_handle.h>
 
 typedef struct
 {
-- 
2.13.5


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-04 21:20           ` H.J. Lu
@ 2017-09-12 15:57             ` H.J. Lu
  2017-09-26 22:53               ` H.J. Lu
  0 siblings, 1 reply; 130+ messages in thread
From: H.J. Lu @ 2017-09-12 15:57 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On Mon, Sep 4, 2017 at 2:19 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Sep 4, 2017 at 12:22 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 09/03/2017 03:42 PM, H.J. Lu wrote:
>>> On Sun, Sep 3, 2017 at 2:11 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>>> On 09/03/2017 10:21 AM, Florian Weimer wrote:
>>>>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>>>>> diff --git a/include/stdlib.h b/include/stdlib.h
>>>>>> index 2274790a2e..d0dcbf81c3 100644
>>>>>> --- a/include/stdlib.h
>>>>>> +++ b/include/stdlib.h
>>>>>> @@ -5,6 +5,10 @@
>>>>>>  #endif
>>>>>>  #include <stdlib/stdlib.h>
>>>>>>
>>>>>> +/* __dso_handle is always defined by either crtbegin.o from GCC or our
>>>>>> +   dso_handle.c.  */
>>>>>> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));
>>>>>
>>>>> This causes conform test failures.  You need to use __visibility__ here.
>>
>>>> Or alternatively, move the declaration under #ifndef _ISOMAC.  That's
>>>> probably the better approach because __dso_handle is not part of the
>>>> installed headers.
>>>>
>>>
>>> No, we can't do that.  Some tests reference __dso_handle and _ISOMAC
>>> isn't defined for tests.
>>
>> These tests should be moved to tests-internal, or __dso_handle should be
>
> We may not define _ISOMAC for these tests since it may introduce
> many issues.
>
>> declared in a different header and the tests should include it.
>
> Here is an updated with include/dso_handle.h.  OK for master?
>
> Thanks.
>

Any comments or objections?

Thanks.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 00/58] Hide internal functions in libc.so
  2017-09-01 20:14   ` Joseph Myers
@ 2017-09-18 13:59     ` Florian Weimer
  0 siblings, 0 replies; 130+ messages in thread
From: Florian Weimer @ 2017-09-18 13:59 UTC (permalink / raw)
  To: Joseph Myers; +Cc: H.J. Lu, libc-alpha

On 09/01/2017 10:14 PM, Joseph Myers wrote:
> On Fri, 1 Sep 2017, Florian Weimer wrote:
> 
>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>> On x86,
>>>
>>> # readelf -rW libc_pic.a | grep " __" | grep PLT32  | awk '{ print $5 }' | sort | uniq
>>>
>>> shows that many internal functions are called via PLT in libc.so.  This
>>> series of patches hides internal functions to allow direct access within
>>> libc.so and libc.a without using GOT nor PLT.
>> I think we need to automate the generation of hidden attributes (or the
>> hidden aliases).
> I'm not convinced, for the present patch series.  An internal function
> needs to be declared somewhere anyway, with or without an explicit hidden
> attribute, so putting the attribute there when declaring the function
> doesn't really complicate things.  (I do think that if the attributes are
> explicit, there should also be a test that any external symbol in an
> object going into a shared library, that doesn't end up as a (defined or
> undefined) dynamic symbol in that shared library, is hidden, so that
> adding a non-hidden internal function is immediately visible as a test
> failure.)

I was concerned about cross-architecture variance in this area.

But I presume we can just add a hidden alias and add the export to the 
relevant sysdeps Versions files, so that's not an actual blocker for 
explicit specification of visibility.

So the main issue here is testing that we do not regression in the 
coverage of hidden declarations.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]
  2017-09-12 15:57             ` H.J. Lu
@ 2017-09-26 22:53               ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-09-26 22:53 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On 9/12/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Sep 4, 2017 at 2:19 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Sep 4, 2017 at 12:22 AM, Florian Weimer <fweimer@redhat.com>
>> wrote:
>>> On 09/03/2017 03:42 PM, H.J. Lu wrote:
>>>> On Sun, Sep 3, 2017 at 2:11 AM, Florian Weimer <fweimer@redhat.com>
>>>> wrote:
>>>>> On 09/03/2017 10:21 AM, Florian Weimer wrote:
>>>>>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>>>>>> diff --git a/include/stdlib.h b/include/stdlib.h
>>>>>>> index 2274790a2e..d0dcbf81c3 100644
>>>>>>> --- a/include/stdlib.h
>>>>>>> +++ b/include/stdlib.h
>>>>>>> @@ -5,6 +5,10 @@
>>>>>>>  #endif
>>>>>>>  #include <stdlib/stdlib.h>
>>>>>>>
>>>>>>> +/* __dso_handle is always defined by either crtbegin.o from GCC or
>>>>>>> our
>>>>>>> +   dso_handle.c.  */
>>>>>>> +extern void *__dso_handle __attribute__ ((visibility ("hidden")));
>>>>>>
>>>>>> This causes conform test failures.  You need to use __visibility__
>>>>>> here.
>>>
>>>>> Or alternatively, move the declaration under #ifndef _ISOMAC.  That's
>>>>> probably the better approach because __dso_handle is not part of the
>>>>> installed headers.
>>>>>
>>>>
>>>> No, we can't do that.  Some tests reference __dso_handle and _ISOMAC
>>>> isn't defined for tests.
>>>
>>> These tests should be moved to tests-internal, or __dso_handle should be
>>
>> We may not define _ISOMAC for these tests since it may introduce
>> many issues.
>>
>>> declared in a different header and the tests should include it.
>>
>> Here is an updated with include/dso_handle.h.  OK for master?
>>
>> Thanks.
>>
>
> Any comments or objections?
>
> Thanks.
>

I will check it in today.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 19/58] Mark internal stdlib functions with attribute_hidden [BZ #18822]
  2017-09-03 21:49     ` H.J. Lu
@ 2017-10-01 21:10       ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:10 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On 9/3/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Sep 3, 2017 at 2:13 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 09/01/2017 07:59 PM, H.J. Lu wrote:
>>>       (__qecvt_r): Likewise.
>>>       (__qfcvt_r): Likewise.
>>
>> I think this change makes symbols vanish from the public ABI on various
>> architectures:
>>
>> --- ../sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
>> 2017-08-28 05:01:14.557643019 -0400
>> +++ /home/bmg/build/glibcs/powerpc64-linux-gnu/glibc/libc.symlist
>> 2017-09-03 05:07:32.110128081 -0400
>> @@ -1383 +1382,0 @@ GLIBC_2.3 qecvt F
>> -GLIBC_2.3 qecvt_r F
>> @@ -1385 +1383,0 @@ GLIBC_2.3 qfcvt F
>> -GLIBC_2.3 qfcvt_r F
>> @@ -2198 +2195,0 @@ GLIBC_2.4 qecvt F
>> -GLIBC_2.4 qecvt_r F
>> @@ -2200 +2196,0 @@ GLIBC_2.4 qfcvt F
>> -GLIBC_2.4 qfcvt_r F
>>
>> (I assume that the patch is identical to what is on the hjl/pr18822
>> branch, which is what I used for testing.)
>
> I updated hjl/pr18822 branch and there are no regressions with
> build-many-glibcs.py.
>

I am checking it in now.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 18/58] Mark internal utmp functions with attribute_hidden [BZ #18822]
  2017-09-02 20:58   ` Florian Weimer
@ 2017-10-01 21:14     ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:14 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

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.

-- 
H.J.

[-- Attachment #2: 0017-Mark-internal-utmp-functions-with-attribute_hidden-B.patch --]
[-- Type: text/x-patch, Size: 4946 bytes --]

From 550efff5105253c16925a74da89d178a96bec7c0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sat, 19 Aug 2017 16:29:20 -0700
Subject: [PATCH 17/56] 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.
---
 include/utmp.h      | 14 +++++++++++---
 login/getutent.c    |  1 +
 login/getutent_r.c  |  2 ++
 login/getutid.c     |  1 +
 login/getutid_r.c   |  1 +
 login/getutline.c   |  1 +
 login/getutline_r.c |  1 +
 login/updwtmp.c     |  1 +
 8 files changed, 19 insertions(+), 3 deletions(-)

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)
-- 
2.13.6


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 02/58] Mark 3 *_internal functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 02/58] Mark 3 *_internal functions with attribute_hidden " H.J. Lu
@ 2017-10-01 21:21   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:21 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark __ptsname_internal, __mktime_internal and __fopen_internal with
> attribute_hidden to allow direct access to them within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/stdlib.h (__ptsname_internal): Add attribute_hidden.
> 	* include/time.h (__mktime_internal): Likewise.
> 	* libio/iolibio.h (__fopen_internal): Likewise.
> ---
>  include/stdlib.h | 2 +-
>  include/time.h   | 2 +-
>  libio/iolibio.h  | 3 ++-
>  3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/include/stdlib.h b/include/stdlib.h
> index c4a6e6f737..2274790a2e 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -78,7 +78,7 @@ extern char *__realpath (const char *__name, char
> *__resolved);
>  extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
>  # ifndef _ISOMAC
>  extern int __ptsname_internal (int fd, char *buf, size_t buflen,
> -			       struct stat64 *stp);
> +			       struct stat64 *stp) attribute_hidden;
>  # endif
>  extern int __getpt (void);
>  extern int __posix_openpt (int __oflag);
> diff --git a/include/time.h b/include/time.h
> index 9fb0e329a3..e8c07bbfea 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -54,7 +54,7 @@ extern void __tz_compute (time_t timer, struct tm *tm, int
> use_localtime)
>  extern time_t __mktime_internal (struct tm *__tp,
>  				 struct tm *(*__func) (const time_t *,
>  						       struct tm *),
> -				 time_t *__offset);
> +				 time_t *__offset) attribute_hidden;
>  extern struct tm *__localtime_r (const time_t *__timer,
>  				 struct tm *__tp) attribute_hidden;
>
> diff --git a/libio/iolibio.h b/libio/iolibio.h
> index f215fcef01..754d8b0650 100644
> --- a/libio/iolibio.h
> +++ b/libio/iolibio.h
> @@ -23,7 +23,8 @@ extern _IO_FILE *_IO_fopen (const char*, const char*);
>  extern _IO_FILE *_IO_old_fopen (const char*, const char*);
>  extern _IO_FILE *_IO_new_fopen (const char*, const char*);
>  extern _IO_FILE *_IO_fopen64 (const char*, const char*);
> -extern _IO_FILE *__fopen_internal (const char*, const char*, int);
> +extern _IO_FILE *__fopen_internal (const char*, const char*, int)
> +	attribute_hidden;
>  extern _IO_FILE *__fopen_maybe_mmap (_IO_FILE *) __THROW;
>  extern int _IO_fprintf (_IO_FILE*, const char*, ...);
>  extern int _IO_fputs (const char*, _IO_FILE*);
> --
> 2.13.5
>
>

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 01/58] Mark internal functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 01/58] Mark internal " H.J. Lu
@ 2017-10-01 21:37   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:37 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal functions with attribute_hidden to allow direct access to
> internal functions within libc.so and libc.a without using GOT nor PLT.
>
> Size comparison of libc.so:
>
> On x86-64:
>         text	   data	    bss	    dec	    hex
> Before: 1728577	  20584	  17088	1766249	 1af369
> After : 1728593	  20584	  17088	1766265	 1af379
>
> The only change is __gconv_release_shlib in iconv/gconv_dl.c is inlined
> since it is hidden, which increases the code size of gconv_dl.os by 18
> bytes.
>
> On i686:
>         text	   data	    bss	    dec	    hex
> Before: 1869039	  11444	  11112	1891595	 1cdd0b
> After : 1868635	  11444	  11112	1891191	 1cdb77
>
> The code size is decreased by avoiding GOT/PLT for hidden functions.
>
> 	[BZ #18822]
> 	* iconv/gconv_int.h (__gconv_open): Add attribute_hidden.
> 	(__gconv_close): Likewise.
> 	(__gconv): Likewise.
> 	(__gconv_find_transform): Likewise.
> 	(__gconv_lookup_cache): Likewise.
> 	(__gconv_compare_alias_cache): Likewise.
> 	(__gconv_load_cache): Likewise.
> 	(__gconv_get_path): Likewise.
> 	(__gconv_close_transform): Likewise.
> 	(__gconv_release_cache): Likewise.
> 	(__gconv_find_shlib): Likewise.
> 	(__gconv_release_shlib): Likewise.
> 	(__gconv_get_builtin_trans): Likewise.
> 	(__gconv_compare_alias): Likewise.
> 	* include/dlfcn.h (_dlerror_run): Likewise.
> 	* include/stdio.h (__fortify_fail_abort): Likewise.
> 	* include/time.h (__tz_compute): Likewise.
> 	(__strptime_internal): Likewise.
> 	* intl/gettextP.h (_nl_find_domain): Likewise.
> 	(_nl_load_domain): Likewise.
> 	(_nl_find_msg): Likewise.
> 	* intl/plural-exp.h (FREE_EXPRESSION): Likewise.
> 	(EXTRACT_PLURAL_EXPRESSION): Likewise.
> 	* locale/coll-lookup.h (__collidx_table_lookup): Likewise.
> 	* resolv/gai_misc.h (__gai_enqueue_request): Likewise.
> 	(__gai_find_request): Likewise.
> 	(__gai_remove_request): Likewise.
> 	(__gai_notify): Likewise.
> 	(__gai_notify_only): Likewise.
> 	* sysdeps/generic/aio_misc.h (__aio_sigqueue): Likewise.
> 	* sysdeps/generic/ldsodefs.h (_dl_fini): Likewise.
> 	(_dl_non_dynamic_init): Likewise.
> 	(_dl_aux_init): Likewise.
> 	* sysdeps/i386/machine-gmon.h (mcount_internal): Likewise.
> 	* sysdeps/unix/sysv/linux/i386/olddirent.h (__old_getdents64):
> 	Likewise.
> 	* wcsmbs/wcsmbsload.h (__wcsmbs_load_conv): Likewise.
> 	(__wcsmbs_clone_conv): Likewise.
> 	(__wcsmbs_named_conv): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden " H.J. Lu
@ 2017-10-01 21:39   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:39 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark __internal_statvfs[64] with attribute_hidden to allow direct access
> to them within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/fstatvfs.c: Include "internal_statvfs.h"
> 	instead of <sys/statvfs.h>.
> 	(__internal_statvfs): Removed.
> 	* sysdeps/unix/sysv/linux/fstatvfs64.c Include "internal_statvfs.h"
> 	instead of <sys/statvfs.h>.
> 	(__internal_statvfs64): Removed.
> 	* sysdeps/unix/sysv/linux/internal_statvfs.c: Include
> 	"internal_statvfs.h" instead of <sys/statvfs.h>.
> 	* sysdeps/unix/sysv/linux/internal_statvfs.h: New file.
> 	* sysdeps/unix/sysv/linux/statvfs.c Include "internal_statvfs.h"
> 	instead of <sys/statvfs.h>.
> 	(__internal_statvfs): Removed.
> 	* sysdeps/unix/sysv/linux/statvfs64.c Include "internal_statvfs.h"
> 	instead of <sys/statvfs.h>.
> 	(__internal_statvfs64): Removed.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 04/58] Mark ____wcsto*_l_internal functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 04/58] Mark ____wcsto*_l_internal " H.J. Lu
@ 2017-10-01 21:40   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:40 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark ____wcsto*_l_internal functions with attribute_hidden to allow
> direct access to them within libc.so and libc.a without using GOT nor
> PLT.
>
> 	[BZ #18822]
> 	* include/wchar.h (____wcstof_l_internal): New prototype.
> 	(____wcstod_l_internal): Likewise.
> 	(____wcstold_l_internal): Likewise.
> 	(____wcstol_l_internal): Likewise.
> 	(____wcstoul_l_internal): Likewise.
> 	(____wcstoll_l_internal): Likewise.
> 	(____wcstoull_l_internal): Likewise.
> 	(____wcstof128_l_internal): Likewise.
> 	* sysdeps/ieee754/float128/wcstof128.c
> 	(____wcstof128_l_internal): Removed.
> 	* sysdeps/ieee754/float128/wcstof128_l.c
> 	(____wcstof128_l_internal): Likewise.
> 	* wcsmbs/wcstod.c (____wcstod_l_internal): Likewise.
> 	* wcsmbs/wcstod_l.c (____wcstod_l_internal): Likewise.
> 	* wcsmbs/wcstof.c (____wcstof_l_internal): Likewise.
> 	* wcsmbs/wcstof_l.c (____wcstof_l_internal): Likewise.
> 	* wcsmbs/wcstol_l.c (____wcstol_l_internal): Likewise.
> 	* wcsmbs/wcstold.c (____wcstold_l_internal): Likewise.
> 	* wcsmbs/wcstold_l.c (____wcstold_l_internal): Likewise.
> 	* wcsmbs/wcstoll_l.c (____wcstoll_l_internal): Likewise.
> 	* wcsmbs/wcstoul_l.c (____wcstoul_l_internal): Likewise.
> 	* wcsmbs/wcstoull_l.c (____wcstoull_l_internal): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 05/58] Mark internal argp functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 05/58] Mark internal argp functions with attribute_hidden " H.J. Lu
@ 2017-10-01 21:42   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:42 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal argp functions with attribute_hidden to allow direct
> access to them within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* argp/argp-fmtstream.c: Include <argp-fmtstream.h>.
> 	* argp/argp-fs-xinl.c: Likewise.
> 	* argp/argp-help.c: Include <argp.h> and <argp-fmtstream.h>.
> 	* argp/argp-parse.c: Include <argp.h>.
> 	* argp/argp-xinl.c: Likewise.
> 	* include/argp-fmtstream.h: New file.
> 	* include/argp.h (__argp_error): Add attribute_hidden.
> 	(__argp_failure): Likewise.
> 	(__argp_input): Likewise.
> 	(__argp_state_help): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 06/58] Mark internal unistd functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 06/58] Mark internal unistd " H.J. Lu
@ 2017-10-01 21:43   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:43 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal unistd functions with attribute_hidden to allow direct
> access to them within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/unistd.h (__access): Add attribute_hidden.
> 	(__lseek64): Likewise.
> 	(__libc_pread64): Likewise.
> 	(__pipe2): Likewise.
> 	(__sleep): Likewise.
> 	(__chdir): Likewise.
> 	(__fchdir): Likewise.
> 	(__getcwd): Likewise.
> 	(__rmdir): Likewise.
> 	(__execvpe): Likewise.
> 	(__execve): Likewise.
> 	(__setsid): Likewise.
> 	(__getuid): Likewise.
> 	(__geteuid): Likewise.
> 	(__getgid): Likewise.
> 	(__getegid): Likewise.
> 	(__getgroups): Likewise.
> 	(__group_member): Likewise.
> 	(__ttyname_r): Likewise.
> 	(__isatty): Likewise.
> 	(__readlink): Likewise.
> 	(__unlink): Likewise.
> 	(__gethostname): Likewise.
> 	(__profil): Likewise.
> 	(__getdtablesize): Likewise.
> 	(__brk): Likewise.
> 	(__ftruncate): Likewise.
> 	(__ftruncate64): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 07/58] Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 07/58] Mark internal grp/pwd/shadow " H.J. Lu
@ 2017-10-01 21:44   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:44 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal grp/pwd/shadow functions with attribute_hidden to allow
> direct access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/grp.h (__fgetgrent_r): Add attribute_hidden.
> 	(__getgrgid_r): Likewise.
> 	(__getgrnam_r): Likewise.
> 	* include/pwd.h (__getpwuid_r): Likewise.
> 	(__getpwnam_r): Likewise.
> 	(__fgetpwent_r): Likewise.
> 	* include/shadow.h (__getspnam_r): Likewise.
> 	(__sgetspent_r): Likewise.
> 	(__fgetspent_r): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 09/58] Mark internal wchar functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 09/58] Mark internal wchar functions with attribute_hidden " H.J. Lu
@ 2017-10-01 21:45   ` H.J. Lu
  2017-11-13 10:16   ` Stefan Liebler
  1 sibling, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:45 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal wchar functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/wchar.h (__wcsnlen): Add attribute_hidden.
> 	(__wcscat): Likewise.
> 	(__btowc): Likewise.
> 	(__wcrtomb): Likewise.
> 	(__mbsrtowcs): Likewise.
> 	(__wcsrtombs): Likewise.
> 	(__mbsnrtowcs): Likewise.
> 	(__wcsnrtombs): Likewise.
> 	(__wcsncpy): Likewise.
> 	(__wcpncpy): Likewise.
> 	(__wmemcpy): Likewise.
> 	(__wmempcpy): Likewise.
> 	(__wmemmove): Likewise.
> 	(__wcschrnul): Likewise.
> 	(__vfwscanf): Likewise.
> 	(__vswprintf): Likewise.
> 	(__fwprintf): Likewise.
> 	(__vfwprintf): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 10/58] Mark internal gmp functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 10/58] Mark internal gmp " H.J. Lu
@ 2017-10-01 21:46   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 21:46 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal gmp functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/gmp.h: Declare internal functions only if _ISOMAC is
> 	undefined.
> 	(__mpn_extract_double): Add attribute_hidden.
> 	(__mpn_extract_long_double): Likewise.
> 	(__mpn_extract_float128): Likewise.
> 	(__mpn_construct_float): Likewise.
> 	(__mpn_construct_double): Likewise.
> 	(__mpn_construct_long_double): Likewise.
> 	(__mpn_construct_float128): Likewise.
> 	(mpn_add_1): Likewise.
> 	(mpn_addmul_1): Likewise.
> 	(mpn_add_n): Likewise.
> 	(mpn_cmp): Likewise.
> 	(mpn_divrem): Likewise.
> 	(mpn_lshift): Likewise.
> 	(mpn_mul): Likewise.
> 	(mpn_mul_1): Likewise.
> 	(mpn_rshift): Likewise.
> 	(mpn_sub_1): Likewise.
> 	(mpn_submul_1): Likewise.
> 	(mpn_sub_n): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 11/58] Mark internal nscd functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 11/58] Mark internal nscd " H.J. Lu
@ 2017-10-01 22:00   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:00 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> 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.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 12/58] Mark internal time functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 12/58] Mark internal time functions with attribute_hidden " H.J. Lu
@ 2017-10-01 22:01   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:01 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal time functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/time.h (__tzstring): Add attribute_hidden.
> 	(__tzfile_read): Likewise.
> 	(__tzfile_compute): Likewise.
> 	(__tzfile_default): Likewise.
> 	(__tzset_parse_tz): Likewise.
> 	(__offtime): Likewise.
> 	(__asctime_r): Likewise.
> 	(__tzset): Likewise.
> 	(__tz_convert): Likewise.
> 	(__getdate_r): Likewise.
> 	(__getclktck): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 14/58] Mark internal gshadow functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 14/58] Mark internal gshadow functions with attribute_hidden " H.J. Lu
@ 2017-10-01 22:02   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:02 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal gshadow functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/gshadow.h (__fgetsgent_r): Add attribute_hidden.
> 	(__sgetsgent_r): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 13/58] Mark internal statfs functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 13/58] Mark internal statfs " H.J. Lu
@ 2017-10-01 22:02   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:02 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal statfs functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/sys/statfs.h (__fstatfs): Add attribute_hidden.
> 	(__statfs64): Likewise.
> 	(__fstatfs64): Likewise.
> 	* include/sys/statvfs.h (__statvfs64): Likewise.
> 	(__fstatvfs64): Likewise.
> 	* sysdeps/unix/sysv/linux/pathconf.h (__statfs_link_max): Likewise.
> 	(__statfs_filesize_max): Likewise.
> 	(__statfs_symlinks): Likewise.
> 	(__statfs_chown_restricted): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 15/58] Mark internal stdio functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 15/58] Mark internal stdio functions " H.J. Lu
@ 2017-10-01 22:03   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:03 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal stdio functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/stdio.h (__fcloseall): Add attribute_hidden.
> 	(__getline): Likewise.
> 	(__path_search): Likewise.
> 	(__gen_tempname): Likewise.
> 	(__libc_message): Likewise.
> 	(__flockfile): Likewise.
> 	(__funlockfile): Likewise.
> 	(__fxprintf): Likewise.
> 	(__fxprintf_nocancel): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden " H.J. Lu
@ 2017-10-01 22:04   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:04 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal getXXXbyYYY functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/aliases.h (__getaliasbyname_r): Add attribute_hidden.
> 	* include/netdb.h (__gethostbyaddr_r): Likewise.
> 	(__gethostbyname_r): Likewise.
> 	(__gethostbyname2_r): Likewise.
> 	(__getnetbyaddr_r): Likewise.
> 	(__getnetbyname_r): Likewise.
> 	(__getservbyname_r): Likewise.
> 	(__getservbyport_r): Likewise.
> 	(__getprotobyname_r): Likewise.
> 	(__getprotobynumber_r): Likewise.
> 	(__getnetgrent_r): Likewise.
> 	* include/rpc/netdb.h (__getrpcbyname_r): Likewise.
> 	(__getrpcbynumber_r): Likewise.
> 	* nss/getXXbyYY.c (INTERNAL (REENTRANT_NAME)): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 17/58] Mark internal dirent functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 17/58] Mark internal dirent functions with attribute_hidden " H.J. Lu
@ 2017-10-01 22:23   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:23 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal dirent functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.  __readdir64
> is hidden with libc_hidden_proto and libc_hidden_def since the exported
> readdir64 is an alias of __readdir64.
>
> 	[BZ #18822]
> 	* include/dirent.h (__opendir): Always add attribute_hidden.
> 	(__fdopendir): Likewise.
> 	(__closedir): Likewise.
> 	(__readdir): Likewise.
> 	(__readdir64): Add libc_hidden_proto.
> 	* sysdeps/mach/hurd/readdir64.c (__readdir64): Add libc_hidden_def.
> 	* sysdeps/unix/sysv/linux/i386/readdir64.c (__readdir64): Likewise.
> 	* sysdeps/unix/sysv/linux/readdir64.c (__readdir64): Likewise.
> 	* sysdeps/unix/sysv/linux/wordsize-64/readdir.c (__GI___readdir64):
> 	New alias.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 22/58] Mark internal rpc functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 22/58] Mark internal rpc functions with attribute_hidden " H.J. Lu
@ 2017-10-01 22:24   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:24 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal rpc functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/rpc/rpc.h (__rpc_thread_variables): Add
> 	attribute_hidden.
> 	(__rpc_thread_svc_cleanup): Likewise.
> 	(__rpc_thread_clnt_cleanup): Likewise.
> 	(__rpc_thread_key_cleanup): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 23/58] Mark internal netlink functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 23/58] Mark internal netlink " H.J. Lu
@ 2017-10-01 22:25   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:25 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal netlink functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/netlinkaccess.h (__netlink_open): Add
> 	attribute_hidden.
> 	(__netlink_close): Likewise.
> 	(__netlink_free_handle): Likewise.
> 	(__netlink_request): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 26/58] Mark internal intl functions with attribute_hidden [BZ #18822]
  2017-09-01 18:01 ` [PATCH 26/58] Mark internal intl " H.J. Lu
@ 2017-10-01 22:25   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:25 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Mark internal intl functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* intl/gettextP.h (__dcngettext): Add attribute_hidden.
> 	(__dcigettext): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 20/58] Hide internal regex functions [BZ #18822]
  2017-09-01 18:01 ` [PATCH 20/58] Hide internal regex functions " H.J. Lu
@ 2017-10-01 22:27   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:27 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal regex functions to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/regex.h (__re_compile_fastmap): Add attribute_hidden.
> 	(__regcomp): Add libc_hidden_proto.
> 	(__regexec): Likewise.
> 	(__regfree): Likewise.
> 	* posix/regcomp.c (__regcomp): Add libc_hidden_def.
> 	(__regfree): Likewise.
> 	* posix/regexec.c (__regexec): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 25/58] Hide internal sysinfo functions [BZ #18822]
  2017-09-01 18:01 ` [PATCH 25/58] Hide internal sysinfo functions " H.J. Lu
@ 2017-10-01 22:29   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:29 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal sysinfo functions to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/sys/sysinfo.h (__get_nprocs_conf): Add
> 	libc_hidden_proto.
> 	(__get_nprocs): Likewise.
> 	(__get_phys_pages): Likewise.
> 	(__get_avphys_pages): Likewise.
> 	(__get_child_max): Add attribute_hidden.
> 	* misc/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def.
> 	(__get_nprocs): Likewise.
> 	(__get_phys_pages): Likewise.
> 	(__get_avphys_pages): Likewise.
> 	* sysdeps/mach/getsysstats.c (__get_nprocs_conf): Add
> 	libc_hidden_def.
> 	(__get_nprocs): Likewise.
> 	(__get_phys_pages): Likewise.
> 	(__get_avphys_pages): Likewise.
> 	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Add
> 	libc_hidden_def.
> 	(__get_nprocs_conf): Likewise.
> 	(__get_phys_pages): Likewise.
> 	(__get_avphys_pages): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 27/58] Hide internal __ioctl function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 27/58] Hide internal __ioctl " H.J. Lu
@ 2017-10-01 22:31   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:31 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __ioctl function to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> __GI___ioctl is defined when sysdeps/unix/syscalls.list is used to
> generate ioctl.  Otherwise libc_hidden_def is needed explicitly.
>
> 	[BZ #18822]
> 	* include/sys/ioctl.h (__ioctl): Add libc_hidden_proto.
> 	* misc/ioctl.c (__ioctl): Add libc_hidden_def.
> 	* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.
> 	* sysdeps/unix/sysv/linux/aarch64/ioctl.S (__ioctl): Likewise.
> 	* sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/powerpc/ioctl.c (__ioctl): Likewise.
> 	* sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S (__ioctl): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 28/58] Hide internal __malloc_check_init function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 28/58] Hide internal __malloc_check_init " H.J. Lu
@ 2017-10-01 22:32   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:32 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __malloc_check_init function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	* include/malloc.h (__malloc_check_init): Add attribute_hidden.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 29/58] Hide internal __mremap function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 29/58] Hide internal __mremap function " H.J. Lu
@ 2017-10-01 22:33   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:33 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __mremap function to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> __GI___mremap is defined when sysdeps/unix/syscalls.list is used to
> generate mremap.  Otherwise libc_hidden_def is needed explicitly.
>
> 	[BZ #18822]
> 	* include/sys/mman.h (__mremap): Add libc_hidden_proto.
> 	* sysdeps/unix/sysv/linux/m68k/mremap.S (__mremap): Add
> 	libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni [BZ #18822]
  2017-09-01 18:01 ` [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni " H.J. Lu
@ 2017-10-01 22:34   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:34 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __posix_spawn_file_actions_realloc and /__spawni functions
> to allow direct access within libc.so and libc.a without using GOT nor
> PLT.
>
> 	[BZ #18822]
> 	* posix/spawn_int.h (__posix_spawn_file_actions_realloc): Add
> 	attribute_hidden.
> 	(__spawni): Likewise.
> ---

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 31/58] Hide internal __strsep function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 31/58] Hide internal __strsep function " H.J. Lu
@ 2017-10-01 22:36   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:36 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __strsep function to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/string.h (__strsep): Add libc_hidden_proto.
> 	* string/strsep.c (__strsep): Add libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 32/58] Hide internal signal functions [BZ #18822]
  2017-09-01 18:01 ` [PATCH 32/58] Hide internal signal functions " H.J. Lu
@ 2017-10-01 22:37   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:37 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal signal functions to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> __GI___kill and __GI___sigaltstack are defined when syscalls.list is
> used to generate them.  Otherwise libc_hidden_def is needed explicitly.
>
> 	[BZ #18822]
> 	* include/signal.h (__kill): Add libc_hidden_proto.
> 	(__sigblock): Likewise.
> 	(__sigprocmask): Likewise.
> 	(__sigaltstack): Likewise.
> 	* signal/kill.c (__kill): Add libc_hidden_def.
> 	* signal/sigblock.c (__sigblock): Likewise.
> 	* signal/sigprocmask.c (__sigprocmask): Likewise.
> 	* sysdeps/mach/hurd/kill.c (__kill): Likewise.
> 	* sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise.
> 	* sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise.
> 	* sysdeps/posix/sigblock.c (__sigblock): Likewise.
> 	* sysdeps/unix/sysv/linux/alpha/sigprocmask.c (__sigprocmask):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask):
> 	Likewise.
> 	* sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
> 	(__sigprocmask): Likewise.
> 	* sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask):
> 	Likewise.
> 	* /sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
> 	(__sigprocmask): Likewise.
> 	* sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask):
> 	Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 33/58] Hide internal __sysinfo function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 33/58] Hide internal __sysinfo " H.J. Lu
@ 2017-10-01 22:38   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:38 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __sysinfo function to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/include/sys/sysinfo.h (__sysinfo): Add
> 	attribute_hidden.
>

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 34/58] Hide internal __assert_fail_base function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 34/58] Hide internal __assert_fail_base function " H.J. Lu
@ 2017-10-01 22:39   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:39 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __assert_fail_base function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/assert.h (__assert_fail_base): Add attribute_hidden.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 35/58] Hide internal __tdestroy function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 35/58] Hide internal __tdestroy " H.J. Lu
@ 2017-10-01 22:40   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:40 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __tdestroy function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/search.h (__tdestroy): Add libc_hidden_proto.
> 	* misc/tsearch.c (__tdestroy): Add libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 36/58] Hide internal __fopen_maybe_mmap function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 36/58] Hide internal __fopen_maybe_mmap function " H.J. Lu
@ 2017-10-01 22:41   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:41 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __fopen_maybe_mmap function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* libio/iolibio.h (__fopen_maybe_mmap): Add attribute_hidden.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 37/58] Hide internal __bsd_getpt function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 37/58] Hide internal __bsd_getpt function " H.J. Lu
@ 2017-10-01 22:42   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:42 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __bsd_getpt function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/getpt.c (__bsd_getpt): Add
> 	attribute_hidden.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h [BZ #18822]
  2017-09-01 18:01 ` [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h " H.J. Lu
@ 2017-10-01 22:43   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:43 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> 	[BZ #18822]
> 	* elf/dl-iteratephdr.c (hidden_proto (__dl_iterate_phdr)): Moved
> 	to ...
> 	* include/link.h (hidden_proto (__dl_iterate_phdr)): Here.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 39/58] Hide internal __get_sol function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 39/58] Hide internal __get_sol " H.J. Lu
@ 2017-10-01 22:44   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-01 22:44 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __get_sol function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/getsourcefilter.c: Include
> 	"getsourcefilter.h".
> 	* sysdeps/unix/sysv/linux/getsourcefilter.h: New file.
> 	* sysdeps/unix/sysv/linux/setsourcefilter.c: Include
> 	"getsourcefilter.h".
> 	(__get_sol): Removed.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 40/58] Hide internal __gettextparse function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 40/58] Hide internal __gettextparse " H.J. Lu
@ 2017-10-02  0:30   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:30 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __gettextparse function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/plural-exp.h: New file.
> 	* intl/plural-exp.c: Include <plural-exp.h> instead of
> 	"plural-exp.h".

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 41/58] Hide internal idna functions [BZ #18822]
  2017-09-01 18:01 ` [PATCH 41/58] Hide internal idna functions " H.J. Lu
@ 2017-10-02  0:32   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:32 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal idna functions to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/idna.h: New file.
> 	* inet/getnameinfo.c: Include <idna.h> instead of
> 	<libidn/idna.h>.
> 	(__idna_to_unicode_lzlz): Removed.
> 	* sysdeps/posix/getaddrinfo.c: Include <idna.h> instead of
> 	<libidn/idna.h>.
> 	(__idna_to_ascii_lz): Removed.
> 	(__idna_to_unicode_lzlz): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 42/58] Hide internal __ifreq function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 42/58] Hide internal __ifreq function " H.J. Lu
@ 2017-10-02  0:34   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:34 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __ifreq function to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/ifreq.h: New file.
> 	* sysdeps/generic/ifreq.h (__if_nextreq): Removed.
> 	(__ifreq): Likewise.
> 	* sysdeps/mach/hurd/ifreq.h (__if_nextreq): Removed.
> 	(__ifreq): Likewise.
>

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 43/58] Hide internal __hasmntopt function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 43/58] Hide internal __hasmntopt function " H.J. Lu
@ 2017-10-02  0:38   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:38 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __hasmntopt function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/mntent.h (__hasmntopt): Add libc_hidden_proto.
> 	* misc/mntent_r.c (__hasmntopt): Add libc_hidden_def.


Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 44/58] Hide internal __hash_string function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 44/58] Hide internal __hash_string function " H.J. Lu
@ 2017-10-02  0:40   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:40 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __hash_string function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* intl/hash-string.h (__hash_string): Add attribute_hidden.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 45/58] Hide internal __sched_setparam function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 45/58] Hide internal __sched_setparam function " H.J. Lu
@ 2017-10-02  0:42   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:42 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __sched_setparam function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> __GI___sched_setparam is defined when sysdeps/unix/syscalls.list is
> used to generate sched_setparam.  Otherwise libc_hidden_def is needed
> explicitly.
>
> 	[BZ #18822]
> 	* include/sched.h (__sched_setparam): Add libc_hidden_proto.
> 	* posix/sched_setp.c (__sched_setparam): Add libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 46/58] Hide internal __vstrfmon_l function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 46/58] Hide internal __vstrfmon_l " H.J. Lu
@ 2017-10-02  0:44   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:44 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __vstrfmon_l function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/monetary.h (__vstrfmon_l): Add attribute_hidden.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 47/58] Hide internal __setrlimit function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 47/58] Hide internal __setrlimit function " H.J. Lu
@ 2017-10-02  0:46   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:46 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __setrlimit function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/sys/resource.h (__setrlimit): Add libc_hidden_proto.
> 	* resource/setrlimit.c (__setrlimit): Add libc_hidden_def.
> 	* sysdeps/mach/hurd/setrlimit.c (__setrlimit): Likewise.
> 	* sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Likewise.
> 	* sysdeps/unix/sysv/linux/setrlimit64.c (__GI___setrlimit): New.
>

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 48/58] Hide internal __tcgetattr function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 48/58] Hide internal __tcgetattr " H.J. Lu
@ 2017-10-02  0:47   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:47 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __tcgetattr function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/termios.h (__tcgetattr): Add libc_hidden_proto.
> 	* sysdeps/unix/bsd/tcgetattr.c (__tcgetattr): Add
> 	libc_hidden_def.
> 	* sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Likewise.
> 	* termios/tcgetattr.c (__tcgetattr): Likewise.
>

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 49/58] Hide internal __nis_hash function [BZ #18822]
  2017-09-01 18:01 ` [PATCH 49/58] Hide internal __nis_hash function " H.J. Lu
@ 2017-10-02  0:49   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:49 UTC (permalink / raw)
  To: libc-alpha

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.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 50/58] Hide internal __setfpucw function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 50/58] Hide internal __setfpucw function " H.J. Lu
@ 2017-10-02  0:51   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:51 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __setfpucw function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/fpu_control.h (__setfpucw): Add attribute_hidden.
> ---

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 51/58] Hide internal __init_misc function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 51/58] Hide internal __init_misc function " H.J. Lu
@ 2017-10-02  0:53   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:53 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __init_misc function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/libc-internal.h (__init_misc): Add attribute_hidden.
>

Tested with build-many-glibcs.py.  I am checking it in.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 52/58] Hide internal __libc_print_version function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 52/58] Hide internal __libc_print_version " H.J. Lu
@ 2017-10-02  0:54   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:54 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __libc_print_version function to allow direct access
> within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* csu/version.c (__libc_print_version): Add attribute_hidden.


Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 53/58] Hide internal __moncontrol function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 53/58] Hide internal __moncontrol function " H.J. Lu
@ 2017-10-02  0:56   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:56 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __moncontrol function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* mon/gmon.c (__moncontrol): Add libc_hidden_proto and
> 	libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 54/58] Hide internal __new_exitfn function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 54/58] Hide internal __new_exitfn " H.J. Lu
@ 2017-10-02  0:57   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:57 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __new_exitfn function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* stdlib/exit.h (__new_exitfn): Add attribute_hidden.
> ---

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 55/58] Hide internal __new_getrlimit function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 55/58] Hide internal __new_getrlimit " H.J. Lu
@ 2017-10-02  0:59   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  0:59 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __new_getrlimit function to allow direct access within
> libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/getrlimit64.c (__new_getrlimit): Add
> 	attribute_hidden.
>

Tested with build-many-glibcs.py.  I am checking it in.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 56/58] Hide internal __glob64 function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 56/58] Hide internal __glob64 function " H.J. Lu
@ 2017-10-02  1:01   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  1:01 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __glob64 function to allow direct access within libc.so
> and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/glob.h (__glob64): Add libc_hidden_proto.
> 	* sysdeps/unix/sysv/linux/i386/glob64.c (__glob64): Add
> 	libc_hidden_def.
> ---

This is the patch I am checking in.  Tested with build-many-glibcs.py.

-- 
H.J.

[-- Attachment #2: 0054-Hide-internal-__glob64-function-BZ-18822.patch --]
[-- Type: text/x-patch, Size: 1387 bytes --]

From 36756b2e9f73e77d2e65488080f61494eca65bc0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 31 Aug 2017 05:38:44 -0700
Subject: [PATCH 54/56] Hide internal __glob64 function [BZ #18822]

Hide internal __glob64 function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/glob.h (__glob64): Add libc_hidden_proto.
	* sysdeps/unix/sysv/linux/glob64.c (__glob64): Add
	libc_hidden_def.
---
 include/glob.h                   | 1 +
 sysdeps/unix/sysv/linux/glob64.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/glob.h b/include/glob.h
index 228fe30ca8..1d2f78793e 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -12,6 +12,7 @@ extern int __glob_pattern_p (const char *__pattern, int __quote);
 extern int __glob64 (const char *__pattern, int __flags,
 		     int (*__errfunc) (const char *, int),
 		     glob64_t *__pglob);
+libc_hidden_proto (__glob64)
 #endif
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/glob64.c b/sysdeps/unix/sysv/linux/glob64.c
index 0189d1c77d..0239425e10 100644
--- a/sysdeps/unix/sysv/linux/glob64.c
+++ b/sysdeps/unix/sysv/linux/glob64.c
@@ -44,6 +44,7 @@
 strong_alias (__glob64, glob64)
 libc_hidden_def (glob64)
 # else
+libc_hidden_def (__glob64)
 versioned_symbol (libc, __glob64, glob64, GLIBC_2_27);
 libc_hidden_ver (__glob64, glob64)
 # endif
-- 
2.13.6


^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 57/58] Hide internal __sched_setaffinity_new function [BZ #18822]
  2017-09-01 18:00 ` [PATCH 57/58] Hide internal __sched_setaffinity_new " H.J. Lu
@ 2017-10-02  1:03   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  1:03 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __sched_setaffinity_new function to allow direct access
> within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/sched_setaffinity.c
> 	(__sched_setaffinity_new): Add libc_hidden_proto and
> 	libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.


-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 58/58] Hide internal fadvise64/fallocate64 functions [BZ #18822]
  2017-09-01 18:01 ` [PATCH 58/58] Hide internal fadvise64/fallocate64 functions " H.J. Lu
@ 2017-10-02  1:05   ` H.J. Lu
  0 siblings, 0 replies; 130+ messages in thread
From: H.J. Lu @ 2017-10-02  1:05 UTC (permalink / raw)
  To: libc-alpha

On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal fadvise64/fallocate64 functions to allow direct access
> within libc.so and libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* sysdeps/unix/sysv/linux/posix_fadvise64.c
> 	(__posix_fadvise64_l64): Add Add libc_hidden_proto and
> 	libc_hidden_def.
> 	* sysdeps/unix/sysv/linux/posix_fallocate64.c
> 	(__posix_fallocate64_l64): Likewise.

Tested with build-many-glibcs.py.  I am checking it in.

-- 
H.J.

^ permalink raw reply	[flat|nested] 130+ messages in thread

* Re: [PATCH 09/58] Mark internal wchar functions with attribute_hidden [BZ #18822]
  2017-09-01 18:00 ` [PATCH 09/58] Mark internal wchar functions with attribute_hidden " H.J. Lu
  2017-10-01 21:45   ` H.J. Lu
@ 2017-11-13 10:16   ` Stefan Liebler
  1 sibling, 0 replies; 130+ messages in thread
From: Stefan Liebler @ 2017-11-13 10:16 UTC (permalink / raw)
  To: libc-alpha

On 09/01/2017 07:59 PM, H.J. Lu wrote:
> Mark internal wchar functions with attribute_hidden to allow direct
> access within libc.so and libc.a without using GOT nor PLT.

On s390 (31bit) various debug/tst-*chk* testcases are failing as the 
tests are ending with a segmentation fault.
As some of the wchar functions are IFUNC, those are called via PLT,
but r12 is not loaded with the GOT-pointer. Then it e.g. branches to 
address zero which leads to the segmentation fault.

Please have a look at the patch "Use libc_hidden_proto / _def for hidden 
wchar ifunc symbols." 
(https://www.sourceware.org/ml/libc-alpha/2017-11/msg00391.html).

Bye.
Stefan

^ permalink raw reply	[flat|nested] 130+ messages in thread

end of thread, other threads:[~2017-11-13 10:16 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
2017-09-01 18:00 ` [PATCH 08/58] Mark __dso_handle as hidden [BZ #18822] H.J. Lu
2017-09-03  8:21   ` Florian Weimer
2017-09-03  9:11     ` Florian Weimer
2017-09-03 13:42       ` H.J. Lu
2017-09-04  7:23         ` Florian Weimer
2017-09-04 21:20           ` H.J. Lu
2017-09-12 15:57             ` H.J. Lu
2017-09-26 22:53               ` H.J. Lu
2017-09-01 18:00 ` [PATCH 18/58] Mark internal utmp functions with attribute_hidden " H.J. Lu
2017-09-02 20:58   ` Florian Weimer
2017-10-01 21:14     ` H.J. Lu
2017-09-01 18:00 ` [PATCH 01/58] Mark internal " H.J. Lu
2017-10-01 21:37   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 53/58] Hide internal __moncontrol function " H.J. Lu
2017-10-02  0:56   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 55/58] Hide internal __new_getrlimit " H.J. Lu
2017-10-02  0:59   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 54/58] Hide internal __new_exitfn " H.J. Lu
2017-10-02  0:57   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 19/58] Mark internal stdlib functions with attribute_hidden " H.J. Lu
2017-09-03  9:13   ` Florian Weimer
2017-09-03 21:49     ` H.J. Lu
2017-10-01 21:10       ` H.J. Lu
2017-09-01 18:00 ` [PATCH 04/58] Mark ____wcsto*_l_internal " H.J. Lu
2017-10-01 21:40   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 10/58] Mark internal gmp " H.J. Lu
2017-10-01 21:46   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 51/58] Hide internal __init_misc function " H.J. Lu
2017-10-02  0:53   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 12/58] Mark internal time functions with attribute_hidden " H.J. Lu
2017-10-01 22:01   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 07/58] Mark internal grp/pwd/shadow " H.J. Lu
2017-10-01 21:44   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 50/58] Hide internal __setfpucw function " H.J. Lu
2017-10-02  0:51   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 57/58] Hide internal __sched_setaffinity_new " H.J. Lu
2017-10-02  1:03   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 52/58] Hide internal __libc_print_version " H.J. Lu
2017-10-02  0:54   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 09/58] Mark internal wchar functions with attribute_hidden " H.J. Lu
2017-10-01 21:45   ` H.J. Lu
2017-11-13 10:16   ` Stefan Liebler
2017-09-01 18:00 ` [PATCH 56/58] Hide internal __glob64 function " H.J. Lu
2017-10-02  1:01   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden " H.J. Lu
2017-10-01 21:39   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 15/58] Mark internal stdio functions " H.J. Lu
2017-10-01 22:03   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 11/58] Mark internal nscd " H.J. Lu
2017-10-01 22:00   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 06/58] Mark internal unistd " H.J. Lu
2017-10-01 21:43   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 29/58] Hide internal __mremap function " H.J. Lu
2017-10-01 22:33   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 46/58] Hide internal __vstrfmon_l " H.J. Lu
2017-10-02  0:44   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 58/58] Hide internal fadvise64/fallocate64 functions " H.J. Lu
2017-10-02  1:05   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 37/58] Hide internal __bsd_getpt function " H.J. Lu
2017-10-01 22:42   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 27/58] Hide internal __ioctl " H.J. Lu
2017-10-01 22:31   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 41/58] Hide internal idna functions " H.J. Lu
2017-10-02  0:32   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 49/58] Hide internal __nis_hash function " H.J. Lu
2017-10-02  0:49   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 25/58] Hide internal sysinfo functions " H.J. Lu
2017-10-01 22:29   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 14/58] Mark internal gshadow functions with attribute_hidden " H.J. Lu
2017-10-01 22:02   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 23/58] Mark internal netlink " H.J. Lu
2017-10-01 22:25   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 13/58] Mark internal statfs " H.J. Lu
2017-10-01 22:02   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 26/58] Mark internal intl " H.J. Lu
2017-10-01 22:25   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 47/58] Hide internal __setrlimit function " H.J. Lu
2017-10-02  0:46   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 39/58] Hide internal __get_sol " H.J. Lu
2017-10-01 22:44   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 05/58] Mark internal argp functions with attribute_hidden " H.J. Lu
2017-10-01 21:42   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 45/58] Hide internal __sched_setparam function " H.J. Lu
2017-10-02  0:42   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 32/58] Hide internal signal functions " H.J. Lu
2017-10-01 22:37   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 02/58] Mark 3 *_internal functions with attribute_hidden " H.J. Lu
2017-10-01 21:21   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 42/58] Hide internal __ifreq function " H.J. Lu
2017-10-02  0:34   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 33/58] Hide internal __sysinfo " H.J. Lu
2017-10-01 22:38   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 20/58] Hide internal regex functions " H.J. Lu
2017-10-01 22:27   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 21/58] Hide __readv and __writev " H.J. Lu
2017-09-01 18:01 ` [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden " H.J. Lu
2017-10-01 22:04   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 43/58] Hide internal __hasmntopt function " H.J. Lu
2017-10-02  0:38   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 35/58] Hide internal __tdestroy " H.J. Lu
2017-10-01 22:40   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 40/58] Hide internal __gettextparse " H.J. Lu
2017-10-02  0:30   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 22/58] Mark internal rpc functions with attribute_hidden " H.J. Lu
2017-10-01 22:24   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 24/58] Hide __chmod and __mkdir " H.J. Lu
2017-09-04  8:05   ` Florian Weimer
2017-09-01 18:01 ` [PATCH 31/58] Hide internal __strsep function " H.J. Lu
2017-10-01 22:36   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 28/58] Hide internal __malloc_check_init " H.J. Lu
2017-10-01 22:32   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 48/58] Hide internal __tcgetattr " H.J. Lu
2017-10-02  0:47   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h " H.J. Lu
2017-10-01 22:43   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 34/58] Hide internal __assert_fail_base function " H.J. Lu
2017-10-01 22:39   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni " H.J. Lu
2017-10-01 22:34   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 44/58] Hide internal __hash_string function " H.J. Lu
2017-10-02  0:40   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 17/58] Mark internal dirent functions with attribute_hidden " H.J. Lu
2017-10-01 22:23   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 36/58] Hide internal __fopen_maybe_mmap function " H.J. Lu
2017-10-01 22:41   ` H.J. Lu
2017-09-01 18:16 ` [PATCH 00/58] Hide internal functions in libc.so Florian Weimer
2017-09-01 19:42   ` H.J. Lu
2017-09-01 20:14   ` Joseph Myers
2017-09-18 13:59     ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).