Commit Graph

1165 Commits

Author SHA1 Message Date
Joseph Myers eda162dd8a Remove _Mlong_double_ etc. macros.
math.h has a macro _Mlong_double_ for the type to use when declaring
long double functions, and similar macros for other types.
math/Makefile uses -D_Mlong_double_=double in the case of long double
having the same ABI as double.

This originates with:

Mon Jul  8 13:37:40 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

        * math/math.h (_Mfloat_, _Mlong_double_): New macros, defined iff not
        already defined to float, long double.  Use those macros for _Mdouble_
        defns when including mathcalls.h.
        * math/Makefile [$(long-double-fcts) != yes] (CPPFLAGS): Append
        -D_Mlong_double_=double.

However, math.h stopped declaring long double functions in the case of
long double having the same ABI as double (and thus probably stopped
actually needing the Makefile definition of _Mlong_double_) with:

1998-11-05  Ulrich Drepper  <drepper@cygnus.com>

        * math/math.h: Unconditionally include bits/mathdef.h.  Declare
        long double functions only if __NO_LONG_DOUBLE_MATH is not
        defined.
        * sysdeps/generic/bits/mathdef.h: Define only if __USE_ISOC9X.
        Define __NO_LONG_DOUBLE_MATH.
        * sysdeps/m68k/fpu/bits/mathdef.h: Define only if __USE_ISOC9X.
        * sysdeps/i386/fpu/bits/mathdef.h: Likewise.

The declarations were since restored for compiling user code, but
remain absent when _LIBC is defined, which is sufficient to avoid
problems declaring function aliases of incompatible types.  Thus the
indirection through the _Mlong_double_ macro is not needed (probably
since that 1998 patch), and this patch removes _Mlong_double_ and
associated macros for other types, leaving only the macro _Mdouble_
which is actually used as the type for which a given inclusion of
<bits/mathcalls.h> should declared functions.

Tested for x86_64, and tested with build-many-glibcs.py that installed
stripped shared libraries are unchanged by this patch.

	* math/math.h [!_Mfloat_] (_Mfloat_): Do not define.
	[!_Mlong_double_] (_Mlong_double_): Likewise.
	[!_Mfloat16_] (_Mfloat16_): Likewise.
	[!_Mfloat32_] (_Mfloat32_): Likewise.
	[!_Mfloat64_] (_Mfloat64_): Likewise.
	[!_Mfloat128_] (_Mfloat128_): Likewise.
	[!_Mfloat32x_] (_Mfloat32x_): Likewise.
	[!_Mfloat64x_] (_Mfloat64x_): Likewise.
	[!_Mfloat128x_] (_Mfloat128x_): Likewise.
	(_Mdouble_): Define without indirection through those macros.
	* math/complex.h [!_Mfloat_] (_Mfloat_): Do not define.
	[!_Mfloat128_] (_Mfloat128_): Likewise.
	[_Mlong_double_] (_Mlong_double_): Likewise.
	(_Mdouble_): Define without indirection through those macros.
	* math/Makefile [$(long-double-fcts) != yes] (math-CPPFLAGS): Do
	not add -D_Mlong_double_=double.
	* include/math.h [_ISOMAC] (_Mlong_double_): Do not undefine.
	* math/test-signgam-finite-c99.c (_Mlong_double_): Likewise.
2017-10-30 20:58:51 +00:00
H.J. Lu a122dbfb2e Replace "if if " with "if " in comments
* include/alloc_buffer.h: Replace "if if " with "if " in
	comments.
	* sysdeps/mips/memcpy.S: Likkewise.
	* sysdeps/mips/memset.S: Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S:
	Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S:
	Likewise.
	* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S:
	Likewise.
2017-10-25 08:05:51 -07:00
Joseph Myers 13c92696d2 Use __f128 to define FLT128_* constants in include/float.h for old GCC.
When using compilers before GCC 7, include/float.h provides fallback
definitions of FLT128_* constants.  These definitions use 'Q' constant
suffixes, which works for configurations with _Float128 ABI-distinct
from long double, but not where it has the same ABI as long double.
This patch changes the definitions to use the __f128 macro from
<bits/floatn.h>, so allowing them to work in the non-distinct
_Float128 case (where they are used in building glibc tests, not for
building glibc itself) as well.

Tested (a) with build-many-glibcs.py with GCC 6 (installed stripped
shared libraries unchanged by the patch); (b) with
build-many-glibcs.py with GCC 6 together with the main patch to enable
float128 aliases; (c) for x86_64 with both GCC 6 and GCC 7.

	* include/float.h [!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 &&
	__GLIBC_USE (IEC_60559_TYPES_EXT)] (FLT128_MAX): Define using
	__f128.
	[!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE
	(IEC_60559_TYPES_EXT)] (FLT128_EPSILON): Likewise.
	[!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE
	(IEC_60559_TYPES_EXT)] (FLT128_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE
	(IEC_60559_TYPES_EXT)] (FLT128_TRUE_MIN): Likewise.
2017-10-17 20:16:01 +00:00
Carlos O'Donell 3480ddc40b shlib-compat: Update documentation of the compat_symbol_reference macro 2017-10-16 20:43:28 +02:00
Jonathan Wakely d6c064e914 Ensure C99 and C11 interfaces are available for C++ [BZ #21326]
This patch ensures that the C99 and C11 features required by C++ are
defined according to the value of the __cplusplus macro, and not just
because G++ always defines _GNU_SOURCE.  This will allow G++ to stop
defining _GNU_SOURCE some day, without causing the C99 and C11
interfaces to disappear for C++ programs.

	[BZ #21326]
	* include/features.h [__cplusplus >= 201103] (__USE_ISOC99): Define.
	[__cplusplus >= 201703] (__USE_ISOCXX17, __USE_ISOC11): Define.
	* math/Makefile (test-math-cxx11): New test.
	* math/test-math-cxx11.cc: New file.
2017-10-09 16:18:11 +02:00
H.J. Lu ee417882e0 Don't use hidden visibility in libc.a with PIE on i386
On i386, when multi-arch is enabled, all external functions must be
called via PIC PLT in PIE, which requires setting up EBX register,
since they may be IFUNC functions.

	* config.h.in (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New.
	* include/libc-symbols.h (__hidden_proto_hiddenattr): Add check
	for PIC and NO_HIDDEN_EXTERN_FUNC_IN_PIE.
	* sysdeps/i386/configure.ac (NO_HIDDEN_EXTERN_FUNC_IN_PIE): New
	AC_DEFINE if multi-arch is enabled.
	* sysdeps/i386/configure: Regenerated.
2017-10-04 17:18:42 -07:00
Samuel Thibault 3d1870fa33 Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN
On the Hurd, the rtld needs to see its own dumb versions of a few functions
(defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once
loaded. rtld should thus not have hidden attribute for these.  To achieve this,
the Hurd port used to just define NO_HIDDEN, which disables it completely. For
now, this changes that to disabling it for all rtld functions, for simplicity.

See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5

The ld.so numbers remain at

  8 .rel.plt      000000c8  00000c24  00000c24  00000c24  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .plt          000001a0  00000cf0  00000cf0  00000cf0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 .plt.got      00000010  00000e90  00000e90  00000e90  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 18 .got.plt      00000070  0002d000  0002d000  0002c000  2**2
                  CONTENTS, ALLOC, LOAD, DATA

which is about 3 times as much as on Linux.

The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls)

	* include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto,
	rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak,
	rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak,
	rtld_hidden_data_ver): Define to empty.
	* include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail,
	__assert_perror_fail): Likewise.
	* include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
	(__rewinddir): Likewise.
	* include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
	(__profile_frequency): Likewise.
	* include/setjmp.h (__sigsetjmp): Likewise.
	* include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction,
	__libc_sigaction): Likewise.
	* include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do
	not set hidden attribute.
	* include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup,
	__strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset,
	rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise.
	* include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat,
	__fxstat64, __lxstat, __lxstat64, __xstat, __xstat64,
	__fxstatat64): Likewise.
	* include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
	(__uname): Likewise.
	* include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
	(_itoa_upper_digits, _itoa_lower_digits): Likewise.
	* sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set.
	(NO_RTLD_HIDDEN): Set.
	* sysdeps/mach/hurd/configure: Refresh.
	* config.h.in: Refresh.
2017-10-03 01:33:38 +02:00
H.J. Lu c0769f7031 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.
2017-10-01 18:02:10 -07:00
H.J. Lu 7bfd08ac5b Hide internal __init_misc function [BZ #18822]
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.
2017-10-01 17:53:55 -07:00
H.J. Lu 0e1fd06cde Hide internal __setfpucw function [BZ #18822]
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.
2017-10-01 17:52:15 -07:00
H.J. Lu 87078544f2 Hide internal __tcgetattr function [BZ #18822]
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.
2017-10-01 17:48:24 -07:00
H.J. Lu dd3121df08 Hide internal __setrlimit function [BZ #18822]
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.
2017-10-01 17:46:54 -07:00
H.J. Lu 047d1a81fd Hide internal __vstrfmon_l function [BZ #18822]
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.
2017-10-01 17:45:07 -07:00
H.J. Lu fd331b1179 Hide internal __sched_setparam function [BZ #18822]
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.
2017-10-01 17:43:25 -07:00
H.J. Lu d19033298f Hide internal __hasmntopt function [BZ #18822]
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.
2017-10-01 17:37:42 -07:00
H.J. Lu b4744101f3 Hide internal __ifreq function [BZ #18822]
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.
2017-10-01 17:35:46 -07:00
H.J. Lu 43b7dfd1b6 Hide internal idna functions [BZ #18822]
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.
2017-10-01 17:33:22 -07:00
H.J. Lu 2c0cd8f81f Hide internal __gettextparse function [BZ #18822]
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".
2017-10-01 17:31:05 -07:00
H.J. Lu a0aef7830e Move hidden_proto (__dl_iterate_phdr) to include/link.h [BZ #18822]
__dl_iterate_phdr is hidden and should be accessed directly within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* elf/dl-iteratephdr.c (hidden_proto (__dl_iterate_phdr)): Moved
	to ...
	* include/link.h (hidden_proto (__dl_iterate_phdr)): Here.
2017-10-01 16:09:38 -07:00
H.J. Lu fe84fed048 Hide internal __tdestroy function [BZ #18822]
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.
2017-10-01 16:06:58 -07:00
H.J. Lu 048dd6813f Hide internal __assert_fail_base function [BZ #18822]
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.
2017-10-01 16:06:13 -07:00
H.J. Lu 6a088436d4 Hide internal signal functions [BZ #18822]
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.
2017-10-01 16:04:41 -07:00
H.J. Lu 78cf1d74d2 Hide internal __strsep function [BZ #18822]
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.
2017-10-01 16:03:41 -07:00
H.J. Lu 225f7eec85 Hide internal __mremap function [BZ #18822]
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.
2017-10-01 16:02:04 -07:00
H.J. Lu 372fe247b1 Hide internal __malloc_check_init function [BZ #18822]
Hide internal __malloc_check_init function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/malloc.h (__malloc_check_init): Add attribute_hidden.
2017-10-01 16:00:36 -07:00
H.J. Lu 9e5ee8b839 Hide internal __ioctl function [BZ #18822]
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.
2017-10-01 15:59:06 -07:00
H.J. Lu b5648377d9 Hide internal sysinfo functions [BZ #18822]
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.
2017-10-01 15:57:21 -07:00
H.J. Lu d48354d860 Mark internal rpc functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:55:15 -07:00
H.J. Lu d6daff1261 Hide __readv and __writev [BZ #18822]
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.
2017-10-01 15:54:10 -07:00
H.J. Lu b68f862056 Hide internal regex functions [BZ #18822]
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.
2017-10-01 15:53:15 -07:00
H.J. Lu 59c04e6763 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.
2017-10-01 15:51:56 -07:00
H.J. Lu 4587a421c5 Mark internal dirent functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:51:11 -07:00
H.J. Lu 9635ce6962 Mark internal getXXXbyYYY functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:21:00 -07:00
H.J. Lu 2e0a69097d Mark internal stdio functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:20:13 -07:00
H.J. Lu 94fd682c9b Mark internal gshadow functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:19:17 -07:00
H.J. Lu e1b33bba7c Mark internal statfs functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:18:25 -07:00
H.J. Lu b0f5678494 Mark internal time functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:17:32 -07:00
H.J. Lu a2ca165230 Mark internal gmp functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:15:30 -07:00
H.J. Lu 44af8a32c3 Mark internal wchar functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:14:33 -07:00
H.J. Lu 783cd767af Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:13:13 -07:00
H.J. Lu 7ec4b39ac4 Mark internal unistd functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:12:04 -07:00
H.J. Lu 8345a76018 Mark internal argp functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:10:27 -07:00
H.J. Lu c26dd7c600 Mark ____wcsto*_l_internal functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:09:28 -07:00
H.J. Lu 8bcdb7e0c5 Mark internal functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:07:23 -07:00
H.J. Lu 8ed3b64330 Mark internal stdlib functions with attribute_hidden [BZ #18822]
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.
	(__realpath): Add libc_hidden_proto.
	(__ecvt_r): Likewise.
	(__fcvt_r): Likewise.
	(__qecvt_r): Likewise.
	(__qfcvt_r): Likewise.
	* misc/efgcvt_r.c (cvt_symbol_1): Add libc_hidden_def (local).
	* stdlib/canonicalize.c (__realpath): Add libc_hidden_def.
2017-10-01 14:34:54 -07:00
H.J. Lu ef9b6f73f4 Mark 3 *_internal functions with attribute_hidden [BZ #18822]
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.
2017-10-01 14:34:40 -07:00
Samuel Thibault 4009ddc692 hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition
from `freeaddrinfo'.

`getifaddrs' and `freeifaddrs' are not in POSIX, they should not be
exposed along `freeaddrinfo' (through `__check_pf') which is POSIX.

	* include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations,
	and use libc_hidden_def on them.
	* inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on
	them.
	* sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise.
	* inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs
	instead of getifaddrs and freeifaddrs.
2017-09-28 01:05:18 +02:00
Samuel Thibault 64a4af28a6 hurd: Fix `seekdir' symbol exposition from `rewinddir'
`seekdir' is MISC || XOPEN, it should not be exposed along `rewinddir' which
is POSIX.

	* include/dirent.h (__seekdir): New declaration.
	* sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and
	redefine as weak alias.
	* sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead
	of seekdir.
2017-09-28 00:49:59 +02:00
Samuel Thibault 52a1f1814e hurd: Fix `revoke' symbol exposition from `unlockpt'
`revoke' is MISC only, it should not be exposed along `unlockpt' which is
XOPEN.

	* include/unistd.h (__revoke): New declaration.
	* misc/revoke.c (revoke): Rename to __revoke, and redefine as weak
	alias.
	* sysdeps/mach/hurd/revoke.c (revoke): Likewise.
	* sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of
	revoke.
2017-09-28 00:49:05 +02:00
Samuel Thibault 2c7bbfaf4e hurd: Fix dirfd symbol exposition from ftw
dirfd is XOPEN2K8 only, it should not be exposed along ftw which is earlier.

	* include/dirent.h (__dirfd): New declaration.
	* dirent/dirfd.c (dirfd): Rename to __dirfd, and redefine as weak
	alias.
	* sysdeps/posix/dirfd/dirfd.c (dirfd): Likewise.
	* sysdeps/mach/hurd/dirfd.c (dirfd): Likewise.
	* io/ftw.c (open_dir_stream, ftw_dir): Use __dirfd instead of dirfd.
2017-09-28 00:49:05 +02:00