Commit Graph

32382 Commits

Author SHA1 Message Date
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
8369d216dc Hide internal __get_sol function [BZ #18822]
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.
2017-10-01 16:12:24 -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
3ee8209be7 Hide internal __bsd_getpt function [BZ #18822]
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.
2017-10-01 16:08:42 -07:00
H.J. Lu
6036fc38bf Hide internal __fopen_maybe_mmap function [BZ #18822]
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.
2017-10-01 16:07:47 -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
6e342af6e7 Hide internal __sysinfo function [BZ #18822]
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.
2017-10-01 16:05:28 -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
85b358949d Hide __posix_spawn_file_actions_realloc/__spawni [BZ #18822]
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.
2017-10-01 16:02:54 -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
2ff16592d8 Mark internal intl functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:58:20 -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
0389a6aaae Mark internal netlink functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:56:27 -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
a4338d994f Mark internal nscd functions with attribute_hidden [BZ #18822]
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.
2017-10-01 15:16:27 -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
3aff56444e Mark __internal_statvfs[64] with attribute_hidden [BZ #18822]
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.
2017-10-01 15:08:32 -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
John David Anglin
8da92e722c Fix return pointer save and PIC register restore in __getcontext and
__setcontext on hppa.

	* sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Save return
	pointer in frame.
	* sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext): Likewise.
	Correct offset used to restore PIC register.
2017-10-01 11:58:04 -04:00
John David Anglin
388784cfdd Fix hppa text relocations in libc.so
[BZ libc/22165]
	* sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Use PIC
	code to load address of __getcontext_ret when generating PIC code.
2017-09-30 19:02:57 -04:00
H.J. Lu
2000067a4b Add a test for non-PIE static executable
tst-tls1-static-non-pie is built with $(no-pie-ldflag) to make it a
non-PIE static executable, regardless if --enable-static-pie is used
to configure glibc.

	* elf/Makefile (tests-static-internal): Add
	tst-tls1-static-non-pie.
	(LDFLAGS-tst-tls1-static-non-pie): New.
	* elf/tst-tls1-static-non-pie.c: New file.
2017-09-30 01:39:32 -07:00
Joseph Myers
1e2bffd05c Use libm_alias_double for some dbl-64 functions.
Continuing the move of libm aliases to common macros that can create
_FloatN / _FloatNx aliases in future, this patch converts some dbl-64
functions to using libm_alias_double, thereby eliminating the need for
some ldbl-opt wrappers.

This patch deliberately limits what functions are converted so that it
can be verified by comparison of stipped binaries.  Specifically, atan
and tan are excluded because they first need converting to being weak
aliases; fma is omitted as it has additional complications with
versions in other directories (removing the ldbl-opt version can
e.g. cause the ldbl-128 version to be used instead of dbl-64); and
functions that have both dbl-64/wordsize-64 and ldbl-opt versions are
excluded because ldbl-opt currently always wraps dbl-64 function
versions, so changing those will result in platforms using both
ldbl-opt and dbl-64/wordsize-64 (i.e. alpha) starting to use the
dbl-64/wordsize-64 versions of those functions (which is good, as an
optimization, but still best separated from the present patch to get
better validation).

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

	* sysdeps/ieee754/dbl-64/s_asinh.c: Include <libm-alias-double.h>.
	(asinh): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_cbrt.c: Include <libm-alias-double.h>.
	(cbrt): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_copysign.c: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_erf.c: Include <libm-alias-double.h>.
	(erf): Define using libm_alias_double.
	(erfc): Likewise.
	* sysdeps/ieee754/dbl-64/s_expm1.c: Include <libm-alias-double.h>.
	(expm1): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_fabs.c: Include <libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_fromfp.c (fromfp): Define using
	libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_fromfp_main.c: Include
	<libm-alias-double.h>.
	* sysdeps/ieee754/dbl-64/s_fromfpx.c (fromfpx): Define using
	libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_getpayload.c: Include
	<libm-alias-double.h>.
	(getpayload): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_llrint.c: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_lrint.c: Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_nextup.c: Include
	<libm-alias-double.h>.
	(nextup): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_roundeven.c: Include
	<libm-alias-double.h>.
	(roundeven): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_setpayload.c (setpayload): Define using
	libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_setpayload_main.c: Include
	<libm-alias-double.h>.
	* sysdeps/ieee754/dbl-64/s_setpayloadsig.c (setpayloadsig): Define
	using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_sin.c: Include <libm-alias-double.h>.
	(cos): Define using libm_alias_double.
	(sin): Likewise.
	* sysdeps/ieee754/dbl-64/s_sincos.c: Include
	<libm-alias-double.h>.
	(sincos): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_tanh.c: Include <libm-alias-double.h>.
	(tanh): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_totalorder.c: Include
	<libm-alias-double.h>.
	(totalorder): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_totalordermag.c: Include
	<libm-alias-double.h>.
	(totalordermag): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_ufromfp.c (ufromfp): Define using
	libm_alias_double.
	* sysdeps/ieee754/dbl-64/s_ufromfpx.c (ufromfpx): Define using
	libm_alias_double.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c: Include
	<libm-alias-double.h>.
	(getpayload): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c: Include
	<libm-alias-double.h>.
	(roundeven): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c: Include
	<libm-alias-double.h>.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c: Include
	<libm-alias-double.h>.
	(totalorder): Define using libm_alias_double.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c: Include
	<libm-alias-double.h>.
	(totalordermag): Define using libm_alias_double.
	* sysdeps/ieee754/ldbl-opt/s_copysign.c (copysignl): Only define
	libc compat symbol here.
	* sysdeps/ieee754/ldbl-opt/s_asinh.c: Remove file.
	* sysdeps/ieee754/ldbl-opt/s_cbrt.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_erf.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_expm1.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_fabs.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_llrint.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_lrint.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_sin.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_sincos.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_tanh.c: Likewise.
2017-09-29 23:54:33 +00:00
H.J. Lu
8172aad937 arm: Update elf_machine_load_address for static PIE
When --enable-static-pie is used to configure glibc, we need to use
_dl_relocate_static_pie to compute load address in static PIE.

	* sysdeps/arm/dl-machine.h (elf_machine_load_address): Use
	_dl_relocate_static_pie instead of _dl_start to compute load
	address in static PIE.  Return 0 if _DYNAMIC is undefined for
	static executable.
2017-09-29 16:23:33 -07:00
H.J. Lu
54464e749d mips: Update elf_machine_load_address for static PIE
mips uses a local label to compute load address, which works with static
PIE.  We just need to return 0 if _DYNAMIC is undefined for static
executable.

	* sysdeps/mips/dl-machine.h (elf_machine_dynamic): Return 0 if
	_DYNAMIC is undefined for static executable.
2017-09-29 16:22:00 -07:00
H.J. Lu
f6c5e5bce0 arm: Check PIC instead of SHARED in start.S
Since start.o may be compiled as PIC, we should check PIC instead of
SHARED.

	* sysdeps/arm/start.S (_start): Check PIC instead of SHARED.
2017-09-29 16:20:39 -07:00
Joseph Myers
2f92505d20 Update x86_64 libm-test-ulps.
* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2017-09-29 18:03:48 +00:00
Wilco Dijkstra
bd8d53bb33 Use fabs(f/l) rather than __fabs
A few math functions still use __fabs(f/l) rather than fabs, which
means they won't be inlined. Rename them so they are inlined.
Also add -fno-builtin-fabsl to nofpu powerpc makefile to work around
BZ #29253.

	* sysdeps/ieee754/dbl-64/e_lgamma_r.c
	(__ieee754_lgamma_r): Use fabs rather than __fabs.
	* sysdeps/ieee754/dbl-64/e_log10.c (__ieee754_log10): Likewise.
	* sysdeps/ieee754/dbl-64/e_log2.c (__ieee754_log2): Likewise.
	* sysdeps/ieee754/flt-32/e_lgammaf_r.c
	(__ieee754_lgammaf_r): Use fabsf rather than __fabsf.
	* sysdeps/ieee754/flt-32/e_log10f.c (__ieee754_log10f): Likewise.
	* sysdeps/ieee754/flt-32/e_log2f.c (__ieee754_log2f): Likewise.
	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c
	(__ieee754_lgammal_r): Use fabsl rather than __fabsl.
	* sysdeps/ieee754/ldbl-128/e_log10l.c (__ieee754_log10l): Likewise.
	* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
	(__ieee754_lgammal_r): Use fabsl rather than __fabsl.
	* sysdeps/ieee754/ldbl-128ibm/e_log10l.c (__ieee754_log10l): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l): Likewise.
	* sysdeps/powerpc/nofpu/Makefile: Add -fno-builtin-fabsl for BZ #29253.
2017-09-29 18:54:24 +01:00