about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't use hidden visibility in libc.a with PIE on i386H.J. Lu2017-10-045-1/+26
| | | | | | | | | | | | | 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.
* Use $(DEFAULT-LDFLAGS-$(@F)) in +link-static-before-libcH.J. Lu2017-10-043-1/+11
| | | | | | | | | | | | | | Use $(LDFLAGS-$(@F)) with tst-tls1-static-non-pie may not be sufficient when static PIE is built by default. Use $(DEFAULT-LDFLAGS-$(@F)) in +link-static-before-libc to make sure that tst-tls1-static-non-pie is always built as non-PIE static executable and make sure that crt1.o is used with tst-tls1-static-non-pie. * Makeconfig (+link-static-before-libc): Use $(DEFAULT-LDFLAGS-$(@F)). * elf/Makefile (CRT-tst-tls1-static-non-pie): New. (LDFLAGS-tst-tls1-static-non-pie): Renamed to ... (DEFAULT-LDFLAGS-tst-tls1-static-non-pie): This.
* Add a test for main () in a shared objectH.J. Lu2017-10-044-2/+65
| | | | | | | | | | | | | | Verify that crt1.o can be used with main () in a shared object. * elf/Makefile (tests): Add tst-main1. (modules-names): Add tst-main1mod. ($(objpfx)tst-main1): New. (CRT-tst-main1): Likewise. (LDFLAGS-tst-main1): Likewise. (LDLIBS-tst-main1): Likewise. (tst-main1mod.so-no-z-defs): Likewise. * elf/tst-main1.c: New file. * elf/tst-main1mod.c: Likewise.
* test-math-iscanonical.cc: Return errors != 0H.J. Lu2017-10-042-1/+5
| | | | | | | Since not all non-zero error counts are errors, return errors != 0 instead. * math/test-math-iscanonical.cc (do_test): Return errors != 0.
* Use libm_alias_double for dbl-64 fma.Joseph Myers2017-10-045-15/+14
| | | | | | | | | | | | | | | | | | | This patch makes dbl-64 fma use libm_alias_double. The ldbl-opt version is removed. The sparc32 version no longer needs to handle compat symbols, while alpha needs a new wrapper to avoid getting the ldbl-128 version (where ldbl-opt is earlier in the list of sysdeps directories, so previously fma came from there). 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_fma.c: Include <libm-alias-double.h>. (fma): Define using libm_alias_double. * sysdeps/ieee754/ldbl-opt/s_fma.c: Remove file. * sysdeps/sparc/sparc32/fpu/s_fma.c: Do not include <math_ldbl_opt.h>. (fmal): Do not define as compat symbol here. * sysdeps/alpha/fpu/s_fma.c: New file.
* aarch64: don't use MIN in dl-machine.hSzabolcs Nagy2017-10-042-1/+6
| | | | | | | MIN is used, but param.h may not be included, so expand its single use inline. * sysdeps/aarch64/dl-machine.h (elf_machine_rela): Expand MIN.
* Restore sparc32 copysignl, fabsl, fmal compat symbols (bug 22229).Joseph Myers2017-10-049-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 32-bit SPARC libm should have compat symbols for copysignl (GLIBC_2.0), fabsl (GLIBC_2.0), fmal (GLIBC_2.1), pointing to the double functions; they were present in glibc 2.8, for example, but are now missing, probably when optimized SPARC function implementations were added without appropriate compat symbol handling. The same applies to copysignl in libc. This patch restores those compat symbols. Tested with build-many-glibcs.py for sparcv9-linux-gnu. [BZ #22229] * sysdeps/sparc/sparc32/fpu/s_copysign.S: Include <math_ldbl_opt.h> (copysignl): Define as compat symbol at version GLIBC_2_0 for libm and libc. * sysdeps/sparc/sparc32/fpu/s_fabs.S: Include <math_ldbl_opt.h>. (fabsl): Define as compat symbol at version GLIBC_2_0 for libm. * sysdeps/sparc/sparc32/fpu/s_fma.c: Include <math_ldbl_opt.h>. (fmal): Define as compat symbol at version GLIBC_2_1 for libm. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S: Include <math_ldbl_opt.h> (copysignl): Define as compat symbol at version GLIBC_2_0 for libm and libc. (compat_symbol): Undefine and redefine. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Include <math_ldbl_opt.h> (fabsl): Define as compat symbol at version GLIBC_2_0 for libm. (compat_symbol): Undefine and redefine. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c [HAVE_AS_VIS3_SUPPORT]: Include <math_ldbl_opt.h>. [HAVE_AS_VIS3_SUPPORT] (fmal): Define as compat symbol at version GLIBC_2_1 for libm. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Add GLIBC_2.0 copysignl symbol. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add GLIBC_2.0 copysignl and fabsl and GLIBC_2.1 fmal symbols.
* Remove alpha nearbyint wrapper.Joseph Myers2017-10-042-25/+4
| | | | | | | | | | | | | | Given my recent changes, sysdeps/alpha/fpu/s_nearbyint.c is no longer needed: it just includes the dbl-64/wordsize-64 version, which is the one that would be used anyway, and defines a compat symbol, duplicating the same compat symbol defined by the dbl-64/wordsize-64 version through use of libm_alias_double. Thus, this patch removes the redundant wrapper. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged for alpha. * sysdeps/alpha/fpu/s_nearbyint.c: Remove file.
* crypt: Adjust check-local-headers.sh for nspr4 include directory [BZ #17956]Florian Weimer2017-10-042-1/+6
|
* crypt: Use NSPR header files in addition to NSS header files [BZ #17956]Guido Trentalancia2017-10-045-6/+27
| | | | | | | | | When configuring and building GNU libc using the Mozilla NSS library for cryptography (--enable-nss-crypt option), also include the NSPR header files along with the Mozilla NSS library header files. Finally, when running the check-local-headers test, ignore the Mozilla NSPR library header files (used by the Mozilla NSS library).
* Move nss_compat from nis to nss subdir and install it unconditionallyAndreas Schwab2017-10-0411-46/+142
| | | | | | This has been tested that local lookup still works with and without an installed libnss_nis, and that NIS lookup works when libnss_nis is available.
* [BZ #22244] Fix yn(n,0) without SVID wrapperSzabolcs Nagy2017-10-043-8/+14
| | | | | | | | | | Without SVID compat wrapper yn(n,0) and ynf(n,0) does not raise the divide-by-zero excpetion and it may return inf with the wrong sign for n < 0. [BZ #22244] * sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_yn): Fix x == 0 case. * sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_ynf): Likewise.
* [BZ #22243] fix log2(0) and log(10) in downward roundingSzabolcs Nagy2017-10-043-2/+8
| | | | | | | | | On 64bit targets if the SVID compat wrapper is suppressed (e.g. static linking) then log2(0) and log10(0) returned inf instead of -inf. [BZ #22243] * sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c (__ieee754_log10): Use fabs. * sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c (__ieee754_log2): Likewise.
* i386: Use "movl main@GOT(%ebx), %eax" in start.SH.J. Lu2017-10-032-2/+10
| | | | | | | | | Don't use "leal main@GOTOFF(%ebx), %eax" since main may be in a shared object. Linker will convert "movl main@GOT(%ebx), %eax" to "leal main@GOTOFF(%ebx), %eax" if main is defined locally. * sysdeps/i386/start.S: Replace "leal main@GOT(%ebx), %eax" with "movl main@GOTOFF(%ebx), %eax".
* Revert x86: Allow undefined _DYNAMIC in static executableH.J. Lu2017-10-033-18/+11
| | | | | | | | | | | | This code is used in non-PIE static executable and static PIE. It checks if _DYNAMIC is undefined before using it to compute load address. But not all targets can convert access _DYNAMIC via GOT, which needs dynamic relocation, to PC-relative at link-time. * sysdeps/i386/dl-machine.h (elf_machine_load_address): Don't allow undefined _DYNAMIC in PIE libc.a. * sysdeps/x86_64/dl-machine.h (elf_machine_load_address): Likewse.
* mips: Don't check _DYNAMIC in elf_machine_load_addressH.J. Lu2017-10-032-5/+5
| | | | | | | | | Since mips can't convert access _DYNAMIC via GOT, which needs dynamic relocation, to PC-relative at link-time, don't check _DYNAMIC in elf_machine_load_address. * sysdeps/mips/dl-machine.h (elf_machine_load_address): Don't check _DYNAMIC.
* arm: Don't check _DYNAMIC in elf_machine_load_addressH.J. Lu2017-10-032-3/+5
| | | | | | | | | Since arm can't convert access _DYNAMIC via GOT, which needs dynamic relocation, to PC-relative at link-time, don't check _DYNAMIC in elf_machine_load_address. * sysdeps/arm/dl-machine.h (elf_machine_load_address): Don't check _DYNAMIC.
* test-math-iscanonical.cc: Replace bool with intH.J. Lu2017-10-032-1/+5
| | | | | | | | | | | Fix GCC 7 compilation error: test-math-iscanonical.cc: In function ‘void check_type()’: test-math-iscanonical.cc:33:11: error: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Werror=deprecated] errors++; ^~ * math/test-math-iscanonical.cc (error): Replace bool with int.
* Use libm_alias_double for dbl-64 modf.Joseph Myers2017-10-036-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes dbl-64 modf use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed, and the ldbl-opt version is changed to define the libc compat symbol only. Because of multiarch wrappers, the changed implementations are made not to define aliases at all if __modf is defined as a macro, as with other functions, so avoiding duplicate compat symbols while allowing those wrappers to be simplified. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * sysdeps/ieee754/dbl-64/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/ldbl-opt/s_modf.c (modfl): Only define libc compat symbol here. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c (weak_alias): Do not undefine and redefine. (strong_alias): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c (weak_alias): Likewise. (strong_alias): Likewise.
* Use libm_alias_double for dbl-64 logb.Joseph Myers2017-10-036-22/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes dbl-64 logb use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed, and the ldbl-opt version is removed. Because of multiarch wrappers, the changed implementations are made not to define aliases at all if __logb is defined as a macro, as with other functions, so avoiding duplicate compat symbols while allowing those wrappers to be simplified. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged (except on alpha where changes from using the wordsize-64 version are expected). * sysdeps/ieee754/dbl-64/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double, only if [!__logb]. * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c: Include <libm-alias-double.h>. (logb): Define using libm_alias_double, only if [!__logb]. * sysdeps/ieee754/ldbl-opt/s_logb.c: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-ppc32.c (weak_alias): Do not undefine and redefine. (strong_alias): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-ppc64.c (weak_alias): Likewise. (strong_alias): Likewise.
* tile: Check SHARED instead PIC for SYSCALL_ERROR_NAMEH.J. Lu2017-10-032-1/+6
| | | | | | | | For static PIE code, PIC is defined and SHARED is undefined. We should check SHARED instead PIC for SYSCALL_ERROR_NAME. * sysdeps/unix/sysv/linux/tile/sysdep.h (SYSCALL_ERROR_NAME): Check SHARED instead PIC.
* Use libm_alias_float for dbl-64 fmaf.Joseph Myers2017-10-032-1/+5
| | | | | | | | | | | This patch makes the implementation of fmaf in the dbl-64 directory use libm_alias float. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. * sysdeps/ieee754/dbl-64/s_fmaf.c: Include <libm-alias-float.h>. [!__fmaf] (fmaf): Define using libm_alias_float.
* Use libm_alias_double for dbl-64 frexp.Joseph Myers2017-10-034-15/+15
| | | | | | | | | | | | | | | | | | This patch makes dbl-64 frexp use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed; the ldbl-opt version is made to define only the libc frexpl compat symbol, now the generic code handles the libm compat symbol automatically. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. * sysdeps/ieee754/dbl-64/s_frexp.c: Include <libm-alias-double.h>. (frexp): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c: Include <libm-alias-double.h>. (frexp): Define using libm_alias_double. * sysdeps/ieee754/ldbl-opt/s_frexp.c (frexpl): Only define libc compat symbol here.
* Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm (bug 22235)Gabriel F. T. Gomes2017-10-037-5/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All representations of floating-point numbers in types with IEC 60559 binary exchange format are canonical. On the other hand, types with IEC 60559 extended formats, such as those implemented under ldbl-96 and ldbl-128ibm, contain representations that are not canonical. TS 18661-1 introduced the type-generic macro iscanonical, which returns whether a floating-point value is canonical or not. In Glibc, this type-generic macro is implemented using the macro __MATH_TG, which, when support for float128 is enabled, relies on __builtin_types_compatible_p to select between floating-point types. However, this use of iscanonical breaks C++ applications, because the builtin is only available in C mode. This patch provides a C++ implementation of iscanonical that relies on function overloading, rather than builtins, to select between floating-point types. Unlike the C++ implementations for iszero and issignaling, this implementation ignores __NO_LONG_DOUBLE_MATH. The double type always matches IEC 60559 double format, which is always canonical. Thus, when double and long double are the same (__NO_LONG_DOUBLE_MATH), iscanonical always returns 1 and is not implemented with __MATH_TG. Tested for powerpc64, powerpc64le and x86_64. [BZ #22235] * math/math.h: Trivial fix for unbalanced parentheses in comment. * math/Makefile [CXX] (tests): Add test-math-iscanonical.cc. (CFLAGS-test-math-iscanonical.cc): New variable. * math/test-math-iscanonical.cc: New file. * sysdeps/ieee754/ldbl-96/bits/iscanonical.h (iscanonical): Provide a C++ implementation based on function overloading, rather than using __MATH_TG, which uses C-only builtins. * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h (iscanonical): Likewise. * sysdeps/powerpc/powerpc64le/Makefile (CFLAGS-test-math-iscanonical.cc): New variable.
* Use libm_alias_double for more dbl-64 functions.Joseph Myers2017-10-0328-140/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes more dbl-64 functions use libm_alias_double to define function aliases. Specifically, it makes the change for functions with dbl-64/wordsize-64 versions, changing both the dbl-64 and dbl-64/wordsize-64 versions and removing the ldbl-opt wrappers. Functions are excluded from this patch if there are complications because of versions of those functions also present in libc, or architecture-specific wrappers round these files. Tested for x86_64, and with build-many-glibcs.py. Installed stripped shared libraries are unchanged except for alpha (where increased use of dbl-64/wordsize-64 files, where previously ldbl-opt files that wrapped dbl-64 files were used, was expected to result in different, better code). * sysdeps/ieee754/dbl-64/s_ceil.c: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_floor.c: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_llround.c: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_lround.c: Include <libm-alias-double.h>. (lround): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_nearbyint.c: Include <libm-alias-double.h>. (nearbyint): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_remquo.c: Include <libm-alias-double.h>. (remquo): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_rint.c: Include <libm-alias-double.h>. (rint): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_round.c: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_trunc.c: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. [_LP64] (lround): Likewise. * sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c: Include <libm-alias-double.h>. [!_LP64] (lround): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c: Include <libm-alias-double.h>. (nearbyint): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c: Include <libm-alias-double.h>. (remquo): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c: Include <libm-alias-double.h>. (rint): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_round.c: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double. * sysdeps/ieee754/ldbl-opt/s_ceil.c: Remove file. * sysdeps/ieee754/ldbl-opt/s_floor.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_llround.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_lround.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_nearbyint.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_remquo.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_rint.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_round.c: Likewise. * sysdeps/ieee754/ldbl-opt/s_trunc.c: Likewise.
* fix drem symbol for static linking and new targetsSzabolcs Nagy2017-10-034-0/+24
| | | | | | | | | | | The compat remainder code is no longer built for !LIBM_SVID_COMPAT targets, but the legacy drem, dremf and dreml symbols should be still defined since removing them may break existing code, so keep them as aliases in the non-compat remainder code. * math/w_remainder.c: New file. * math/w_remainderf.c: New file. * math/w_remainderl.c: New file.
* ld.so: Replace (&bootstrap_map) with BOOTSTRAP_MAPH.J. Lu2017-10-035-4/+16
| | | | | | | | | | | | | | | (&_dl_main_map) is used instead of (&bootstrap_map) to bootstrap static PIE. Define BOOTSTRAP_MAP with (&_dl_main_map) to avoid hardcode to (&bootstrap_map). * elf/rtld.c (BOOTSTRAP_MAP): New. (RESOLVE_MAP): Replace (&bootstrap_map) with BOOTSTRAP_MAP. * sysdeps/hppa/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Likewise. * sysdeps/ia64/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Likewise. * sysdeps/mips/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Likewise.
* Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDENSamuel Thibault2017-10-0315-14/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use libm_alias_double for dbl-64 atan, tan.Joseph Myers2017-10-025-20/+11
| | | | | | | | | | | | | | | | | | | This patch makes the dbl-64 atan and tan implementations use libm_alias_double, removing the corresponding ldbl-opt wrappers. Tested for x86_64, and with build-many-glibcs.py. Installed stripped shared libraries are unchanged on non-ldbl-opt platforms. For ldbl-opt configurations, the patch has the effect of causing compat_symbol to define atanl and tanl in terms of __atan and __tan instead of in terms of atan and tan, which is enough to change the installed stripped libm.so. * sysdeps/ieee754/dbl-64/s_atan.c: Include <libm-alias-double.h>. (atan): Define using libm_alias_double. * sysdeps/ieee754/dbl-64/s_tan.c: Include <libm-alias-double.h>. (tan): Define using libm_alias_double. * sysdeps/ieee754/ldbl-opt/s_atan.c: Remove file. * sysdeps/ieee754/ldbl-opt/s_tan.c: Likewise.
* Make dbl-64 atan and tan into weak aliases.Joseph Myers2017-10-0211-16/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the dbl-64 implementations of atan and tan into weak aliases of __atan and __tan, in preparation for making them use libm_alias_double. Consequent changes are made to the x86_64 multiarch versions wrapping round them (with the dbl-64 functions, like other such functions, being made not to define their aliases at all if __atan or __tan are defined as macros by an including file). Tested for x86_64, and with build-many-glibcs.py. * sysdeps/ieee754/dbl-64/s_atan.c (atan): Rename to __atan and define as weak alias of __atan. Do not define any aliases if [__atan]. [NO_LONG_DOUBLE] (__atanl): Define as strong alias of __atan. [NO_LONG_DOUBLE] (atanl): Define as weak alias of __atanl. * sysdeps/ieee754/dbl-64/s_tan.c (tan): Rename to __tan and define as weak alias of __tan. Do not define any aliases if [__tan]. [NO_LONG_DOUBLE] (__tanl): Define as strong alias of __tan. [NO_LONG_DOUBLE] (tanl): Define as weak alias of __tanl. * sysdeps/x86_64/fpu/multiarch/s_atan-avx.c (atan): Rename to __atan. * sysdeps/x86_64/fpu/multiarch/s_atan-fma.c (atan): Likewise. * sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c (atan): Likewise. * sysdeps/x86_64/fpu/multiarch/s_atan.c (atan): Rename to __atan and define as weak alias of __atan. * sysdeps/x86_64/fpu/multiarch/s_tan-avx.c (tan): Rename to __atan. * sysdeps/x86_64/fpu/multiarch/s_tan-fma.c (tan): Likewise. * sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c (tan): Likewise. * sysdeps/x86_64/fpu/multiarch/s_tan.c (tan): Rename to __tan and define as weak alias of __tan.
* fix gamma symbol for static linking and new targetsSzabolcs Nagy2017-10-024-0/+28
| | | | | | | | | | The lgamma compat code is no longer built for !LIBM_SVID_COMPAT targets, but the legacy gamma, gammaf and gammal symbols should be still defined, so make them aliases to the non-compat lgamma code. * math/w_lgamma.c: New file. * math/w_lgammaf.c: New file. * math/w_lgammal.c: New file.
* Do not wrap logf, log2f and powfSzabolcs Nagy2017-10-0213-6/+45
| | | | | | | | | | | | | | | | | | The new generic logf, log2f and powf code don't need wrappers any more, they set errno inline so only use the wrappers on targets that need it. * sysdeps/ieee754/flt-32/e_log2f.c (__log2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_logf.c (__logf): Likewise * sysdeps/ieee754/flt-32/e_powf.c (__powf): Likewise * sysdeps/ieee754/flt-32/w_log2f.c: New file. * sysdeps/ieee754/flt-32/w_logf.c: New file. * sysdeps/ieee754/flt-32/w_powf.c: New file. * sysdeps/i386/fpu/w_log2f.c: New file. * sysdeps/i386/fpu/w_logf.c: New file. * sysdeps/i386/fpu/w_powf.c: New file. * sysdeps/m68k/m680x0/fpu/w_log2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_logf.c: New file. * sysdeps/m68k/m680x0/fpu/w_powf.c: New file.
* Do not wrap expf and exp2fSzabolcs Nagy2017-10-0214-8/+50
| | | | | | | | | | | | | | | | | | | | | | | | | The new generic expf and exp2f code don't need wrappers any more, they set errno inline, so only use the wrappers on targets that need it. (If the wrapper is needed, then the top level wrapper code is included, otherwise empty w_exp*f.c is used to suppress the wrapper.) A powerpc64 expf implementation includes the expf c code directly which needed some changes. * sysdeps/ieee754/flt-32/e_exp2f.c (__exp2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_expf.c (__expf): Likewise * sysdeps/ieee754/flt-32/w_exp2f.c: New file. * sysdeps/ieee754/flt-32/w_expf.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Update for the new expf code. * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: New file. * sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_expf.c: New file. * sysdeps/i386/fpu/w_exp2f.c: New file. * sysdeps/i386/fpu/w_expf.c: New file. * sysdeps/i386/i686/fpu/multiarch/w_expf.c: New file. * sysdeps/x86_64/fpu/w_expf.c: New file.
* New symbol version for logf, log2f and powf without SVID compatSzabolcs Nagy2017-10-0237-14/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the logf, log2f and powf error handling semantics to only set errno accoring to POSIX rules. New symbol version is introduced at GLIBC_2.27. The old wrappers are kept for compat symbols. ia64 needed assembly change to have the new and compat versioned symbol map to the same function. All linux libm abilists are updated. * math/Versions (logf): New libm symbol at GLIBC_2.27. (log2f): Likewise. (powf): Likewise. * math/w_log2f.c: New file. * math/w_logf.c: New file. * math/w_powf.c: New file. * math/w_log2f_compat.c (__log2f_compat): For compat symbol only. * math/w_logf_compat.c (__logf_compat): Likewise. * math/w_powf_compat.c (__powf_compat): Likewise. * sysdeps/ia64/fpu/e_log2f.S: Add versioned symbols. * sysdeps/ia64/fpu/e_logf.S: Likewise. * sysdeps/ia64/fpu/e_powf.S: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* powerpc: Optimize memrchr for power8Rajalakshmi Srinivasaraghavan2017-10-026-3/+380
| | | | | | | Vectorized loops are used for sizes greater than 32B to improve performance over power7 optimization. This shows as an average of 25% improvement depending on the position of search character. The performance is same for shorter strings.
* Hide internal fadvise64/fallocate64 functions [BZ #18822]H.J. Lu2017-10-013-0/+13
| | | | | | | | | | | | 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.
* Hide internal __sched_setaffinity_new function [BZ #18822]H.J. Lu2017-10-012-0/+11
| | | | | | | | | | 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.
* Hide internal __glob64 function [BZ #18822]H.J. Lu2017-10-013-0/+9
| | | | | | | | | | 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.
* Hide internal __new_getrlimit function [BZ #18822]H.J. Lu2017-10-012-1/+8
| | | | | | | | | 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.
* Hide internal __new_exitfn function [BZ #18822]H.J. Lu2017-10-012-2/+7
| | | | | | | | 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.
* Hide internal __moncontrol function [BZ #18822]H.J. Lu2017-10-012-0/+8
| | | | | | | | | 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.
* Hide internal __libc_print_version function [BZ #18822]H.J. Lu2017-10-012-1/+6
| | | | | | | | 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.
* Hide internal __init_misc function [BZ #18822]H.J. Lu2017-10-012-1/+6
| | | | | | | | 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.
* Hide internal __setfpucw function [BZ #18822]H.J. Lu2017-10-012-1/+6
| | | | | | | | 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.
* Hide internal __nis_hash function [BZ #18822]H.J. Lu2017-10-012-0/+10
| | | | | | | | 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.
* Hide internal __tcgetattr function [BZ #18822]H.J. Lu2017-10-015-0/+13
| | | | | | | | | | | | 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.
* Hide internal __setrlimit function [BZ #18822]H.J. Lu2017-10-016-0/+16
| | | | | | | | | | | | 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.
* Hide internal __vstrfmon_l function [BZ #18822]H.J. Lu2017-10-012-1/+7
| | | | | | | | 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.
* Hide internal __sched_setparam function [BZ #18822]H.J. Lu2017-10-013-0/+8
| | | | | | | | | | | | | 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.
* Hide internal __hash_string function [BZ #18822]H.J. Lu2017-10-012-1/+7
| | | | | | | | 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.