about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Fix clog10_downward ulps on hppa.John David Anglin2017-11-112-2/+6
| | | | | | 2017-11-11 John David Anglin <danglin@gcc.gnu.org> * sysdeps/hppa/fpu/libm-test-ulps: Update clog10_downward ulps.
* resolv: More precise checks in res_hnok, res_dnok [BZ #22409] [BZ #22412]Florian Weimer2017-11-114-97/+157
| | | | | | | | res_hnok rejected some host names used on the Internet, such as www-.example.com. res_hnok and res_dnok failed to perform basic syntax checking on DNS domain names. Also fix res_mailok, res_ownok.
* resolv: ns_name_pton should report trailing \ as error [BZ #22413]Florian Weimer2017-11-113-0/+18
|
* resolv: Add tst-ns_name_ptonFlorian Weimer2017-11-113-0/+211
|
* resolv: Add tst-res_hnokFlorian Weimer2017-11-113-0/+161
|
* resolv: Use test framework in tst-resolv-networkFlorian Weimer2017-11-112-2/+11
| | | | | The main function was left in place by accident when the test was imported.
* Add jmp_buf-macros.hH.J. Lu2017-11-0926-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined. Since jmp_buf is target specific, jmp_buf-macros.h is added for each Linux target. A new target must provides its own jmp_buf-macros.h. TODO: Hurd needs to provide a jmp_buf-macros.h. Tested with build-many-glibcs.py. * include/setjmp.h [!_ISOMAC]: Include <stddef.h> and <jmp_buf-macros.h>. [!_ISOMAC] (STR_HELPER): New. [!_ISOMAC] (STR): Likewise. [!_ISOMAC] (TEST_SIZE): Likewise. [!_ISOMAC] (TEST_ALIGN): Likewise. [!_ISOMAC] (TEST_OFFSET): Likewise. [!_ISOMAC] Add _Static_assert to check sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf. * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise.
* Handle more _FloatN, _FloatNx types in include/float.h.Joseph Myers2017-11-072-16/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch adds support in include/float.h. This header defines macros for _Float128 properties when using compilers before GCC 7 that lack those macros in <float.h>. For testing _Float32 / _Float64 / _Float32x / _Float64x functions with older compilers, such macros need to be defined for those types as well; for the older compilers, those types will always be typedefs for another type, so the definitions can be in terms of the macros for that other type. Tested for x86_64. * include/float.h [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MANT_DIG): New macro. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_TRUE_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MANT_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_TRUE_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MANT_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_TRUE_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MANT_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_TRUE_MIN): Likewise.
* Handle more _FloatN, _FloatNx types in type-generic strtod tests.Joseph Myers2017-11-073-12/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch adds support to type-generic strtod tests. GEN_STRTOD_TEST_FOREACH and STRTOD_TEST_FOREACH are made to handle the full set of such types. tst-strtod-round-skeleton.c is updated for those types it can handle without needing changes to the generator (i.e. those types that have already-handled formats). Tested for x86_64. * stdlib/tst-strtod.h (F16): New macro. (F32): Likewise. (F64): Likewise. (F32X): Likewise. (F64X): Likewise. (F128X): Likewise. (IF_FLOAT16): Likewise. (IF_FLOAT32): Likewise. (IF_FLOAT64): Likewise. (IF_FLOAT32X): Likewise. (IF_FLOAT64X): Likewise. (IF_FLOAT128X): Likewise. (GEN_TEST_STRTOD_FOREACH): Conditionally call macros for _Float16, _Float32, _Float64, _Float32x, _Float64x and _Float128x. (STRTOD_TEST_FOREACH): Likewise. * stdlib/tst-strtod-round-skeleton.c (CHOOSE_f32): New macro. (CHOOSE_f64): Likewise. (CHOOSE_f32x): Likewise. (CHOOSE_f64x): Likewise.
* Remove traces of tst-typesizesAndreas Schwab2017-11-072-2/+5
|
* mfe_MU, miq_NI locales: Escape slashes in d_fmt [BZ #22403]Mike FABIAN2017-11-073-2/+10
| | | | | | | | [BZ #22403] * localedata/locales/mfe_MU (LC_TIME): Fix wrong d_fmt, / needs to be escaped. * localedata/locales/miq_NI (LC_TIME): Fix wrong d_fmt, / needs to be escaped.
* an_ES, kab_DZ, om_ET locales: Escape slashes in d_fmt [BZ #22403]Claude Paroz2017-11-074-3/+13
| | | | | | | | | | [BZ #22403] * localedata/locales/an_ES (LC_TIME): Fix wrong d_fmt, / needs to be escaped. * localedata/locales/kab_DZ (LC_TIME): Fix wrong d_fmt, / needs to be escaped. * localedata/locales/om_ET (LC_TIME): Fix wrong d_fmt, / needs to be escaped.
* nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}Adhemerval Zanella2017-11-0723-12/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds two new internal defines to set the internal pthread_mutex_t layout required by the supported ABIS: 1. __PTHREAD_MUTEX_NUSERS_AFTER_KIND which control whether to define __nusers fields before or after __kind. The preferred value for is 0 for new ports and it sets __nusers before __kind. 2. __PTHREAD_MUTEX_USE_UNION which control whether internal __spins and __list members will be place inside an union for linuxthreads compatibility. The preferred value is 0 for ports and it sets to not use an union to define both fields. It fixes the wrong offsets value for __kind value on x86_64-linux-gnu-x32. Checked with a make check run-built-tests=no on all afected ABIs. [BZ #22298] * nptl/allocatestack.c (allocate_stack): Check if __PTHREAD_MUTEX_HAVE_PREV is non-zero, instead if __PTHREAD_MUTEX_HAVE_PREV is defined. * nptl/descr.h (pthread): Likewise. * nptl/nptl-init.c (__pthread_initialize_minimal_internal): Likewise. * nptl/pthread_create.c (START_THREAD_DEFN): Likewise. * sysdeps/nptl/fork.c (__libc_fork): Likewise. * sysdeps/nptl/pthread.h (PTHREAD_MUTEX_INITIALIZER): Likewise. * sysdeps/nptl/bits/thread-shared-types.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New defines. (__pthread_internal_list): Check __PTHREAD_MUTEX_USE_UNION instead of __WORDSIZE for internal layout. (__pthread_mutex_s): Check __PTHREAD_MUTEX_NUSERS_AFTER_KIND instead of __WORDSIZE for internal __nusers layout and __PTHREAD_MUTEX_USE_UNION instead of __WORDSIZE whether to use an union for __spins and __list fields. (__PTHREAD_MUTEX_HAVE_PREV): Define also for __PTHREAD_MUTEX_USE_UNION case. * sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New defines. * sysdeps/alpha/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/arm/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/hppa/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/ia64/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/m68k/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/mips/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/nios2/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/s390/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/sh/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/sparc/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/tile/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. * sysdeps/x86/nptl/bits/pthreadtypes-arch.h (__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): Likewise. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Change tst-typesizes to _Static_assertAdhemerval Zanella2017-11-0737-148/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of rely on runtime check to assure correct pthread types size a better strategy would use _Static_assert to trigger an error on build time (and thus allowing to check to potentially ABI breakage on cross-compiling make check). This patch moves nptl/tst-typesizes.c to libpthread build time on each specific initialization routine and also remove some runtime redundant asserts for the same type sizes. Checked on x86_64-linux-gnu and with a build check for all affected ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf, hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu, mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu, s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu, sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32, tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32). * nptl/pthreadP.h (ASSERT_TYPE_SIZE, ASSERT_PTHREAD_INTERNAL_SIZE): New macros. * nptl/pthread_attr_init.c (__pthread_mutex_init): Add build time checks for expected input type size. * nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise. * nptl/pthread_barrierattr_init.c (pthread_barrierattr_init): Likewise. * nptl/pthread_cond_init.c (__pthread_cond_init): Likewise. * nptl/pthread_condattr_init.c (__pthread_condattr_init): Likewise. * nptl/pthread_mutex_init.c (__pthread_mutex_init): Likewise. * nptl/pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise. * nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise. * nptl/pthread_rwlockattr_init.c (pthread_rwlockattr_init): Likewise. * nptl/sem_init.c (__new_sem_init, __old_sem_init): Likewise * nptl/pthread_attr_destroy.c (__pthread_attr_destroy): Remove superflous runtime assert check. * nptl/pthread_attr_getaffinity.c (__pthread_attr_getaffinity_new): Likewise. * nptl/pthread_attr_getdetachstate.c (__pthread_attr_getdetachstate): Likewise. * nptl/pthread_attr_getguardsize.c (pthread_attr_getguardsize): Likewise. * nptl/pthread_attr_getinheritsched.c (__pthread_attr_getinheritsched): Likewise. * nptl/pthread_attr_getschedparam.c (__pthread_attr_getschedparam): Likewise. * nptl/pthread_attr_getschedpolicy.c (__pthread_attr_getschedpolicy): Likewise. * nptl/pthread_attr_getscope.c (__pthread_attr_getscope): Likewise. * nptl/pthread_attr_getstack.c (__pthread_attr_getstack): Likewise. * nptl/pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Likewise. * nptl/pthread_attr_getstacksize.c (__pthread_attr_getstacksize): Likewise. * nptl/pthread_attr_setaffinity.c (__pthread_attr_setaffinity_new): Likewise. * nptl/pthread_attr_setdetachstate.c (__pthread_attr_setdetachstate): Likewise. * nptl/pthread_attr_setguardsize.c (pthread_attr_setguardsize): Likewise. * nptl/pthread_attr_setinheritsched.c (__pthread_attr_setinheritsched): Likewise. * nptl/pthread_attr_setschedparam.c (__pthread_attr_setschedparam): Likewise. * nptl/pthread_attr_setschedpolicy.c (__pthread_attr_setschedpolicy): Likewise. * nptl/pthread_attr_setscope.c (__pthread_attr_setscope): Likewise. * nptl/pthread_attr_setstack.c (__pthread_attr_setstack, __old_pthread_attr_setstack): Likewise. * nptl/pthread_attr_setstackaddr.c (__pthread_attr_setstackaddr): Likewise. * nptl/pthread_attr_setstacksize.c (__pthread_attr_setstacksize): Likewise. * nptl/pthread_getattr_default_np.c (pthread_getattr_default_np): Likewise. * nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Likewise. * nptl/pthread_setattr_default_np.c (pthread_setattr_default_np): Likewise. * nptl/tst-typesizes.c: Remove file. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add tests for internal pthread_mutex_t offsetsAdhemerval Zanella2017-11-0719-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new build test to check for internal fields offsets for user visible internal field. Although currently the only field which is statically initialized to a non zero value is pthread_mutex_t.__data.__kind value, the tests also check the offset of __kind, __spins, __elision (if supported), and __list internal member. A internal header (pthread-offset.h) is added to each major ABI with the reference value. Checked on x86_64-linux-gnu and with a build check for all affected ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf, hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu, mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu, s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu, sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32, tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32). * nptl/pthreadP.h (ASSERT_PTHREAD_STRING, ASSERT_PTHREAD_INTERNAL_OFFSET): New macro. * nptl/pthread_mutex_init.c (__pthread_mutex_init): Add build time checks for internal pthread_mutex_t offsets. * sysdeps/aarch64/nptl/pthread-offsets.h (__PTHREAD_MUTEX_NUSERS_OFFSET, __PTHREAD_MUTEX_KIND_OFFSET, __PTHREAD_MUTEX_SPINS_OFFSET, __PTHREAD_MUTEX_ELISION_OFFSET, __PTHREAD_MUTEX_LIST_OFFSET): New macro. * sysdeps/alpha/nptl/pthread-offsets.h: Likewise. * sysdeps/arm/nptl/pthread-offsets.h: Likewise. * sysdeps/hppa/nptl/pthread-offsets.h: Likewise. * sysdeps/i386/nptl/pthread-offsets.h: Likewise. * sysdeps/ia64/nptl/pthread-offsets.h: Likewise. * sysdeps/m68k/nptl/pthread-offsets.h: Likewise. * sysdeps/microblaze/nptl/pthread-offsets.h: Likewise. * sysdeps/mips/nptl/pthread-offsets.h: Likewise. * sysdeps/nios2/nptl/pthread-offsets.h: Likewise. * sysdeps/powerpc/nptl/pthread-offsets.h: Likewise. * sysdeps/s390/nptl/pthread-offsets.h: Likewise. * sysdeps/sh/nptl/pthread-offsets.h: Likewise. * sysdeps/sparc/nptl/pthread-offsets.h: Likewise. * sysdeps/tile/nptl/pthread-offsets.h: Likewise. * sysdeps/x86_64/nptl/pthread-offsets.h: Likewise. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Move <bits/mman-linux.h> to the Linux sysdeps directoryFlorian Weimer2017-11-073-11/+9
| | | | The header file is no longer used on anything but Linux.
* powerpc: Use latest optimization for internal function callsRajalakshmi Srinivasaraghavan2017-11-072-1/+6
| | | | | | | Update strcasestr-power8 to use power8 version of strnlen for calculating length. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* Optimize sighold implementationAdhemerval Zanella2017-11-062-8/+4
| | | | | | | | | | | | This patch simplifies sighold a bit by removing an extra sigprocmask and using SIG_BLOCK (which union of the current set and the set argument). Checked on x86_64-linux-gnu. * signal/sighold.c (sighold): Optimize implementation. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Zack Weinberg <zackw@panix.com>
* Cleanup Linux sigqueue implementationAdhemerval Zanella2017-11-062-8/+5
| | | | | | | | | | | | | | This patch simplify Linux sigqueue implementation by assuming __NR_rt_sigqueueinfo existence due minimum kernel requirement (it pre-dates Linux git inclusion for Linux 2.6.12). Checked on x86_64-linux-gnu. * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume __NR_rt_sigqueueinfo. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Zack Weinberg <zackw@panix.com>
* Simplify Linux sig{timed}wait{info} implementationsAdhemerval Zanella2017-11-065-118/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch simplifies sig{timed}wait{info} by: - Assuming __NR_rt_sigtimedwait existence on all architectures due minimum kernel version requirement (it pre-dates Linux git inclusion for Linux 2.6.12). - Call __sigtimedwait on both sigwait and sigwaitinfo. - Now that sigwait is based on an internal sigtimedwait call and it is present of both libc.so and libpthread.so we need to add an external private definition of __sigtimedwait for libpthread.so call. Checked on x86_64-linux-gnu. * sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add __sigtimedwait. * sysdeps/unix/sysv/linux/sigtimedwait.c: Simplify includes and assume __NR_rt_sigtimedwait. * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Call __sigtimedwait and add LIBC_CANCEL_HANDLED for cancellation marking. * sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Zack Weinberg <zackw@panix.com>
* arm: Implement memchr ifunc selection in CAdhemerval Zanella2017-11-069-285/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactor ARM memchr ifunc selector to a C implementation. No functional change is expected, including ifunc resolution rules. It also reorganize the ifunc options code: 1. The memchr_impl.S is renamed to memchr_neon.S and multiple compilation options (which route to armv6t2/memchr one) is removed. The code to build if __ARM_NEON__ is defined is also simplified. 2. A memchr_noneon is added (which as build along previous ifunc resolution) and includes the armv6t2 direct. 3. Same as 2. for loader object. Alongside the aforementioned changes, it also some cleanus: - Internal memchr definition (__GI_memcpy) is now a hidden symbol. - No need to create hidden definition for the ifunc variants. Checked on armv7-linux-gnueabihf and with a build for arm-linux-gnueabi, arm-linux-gnueabihf with and without multiarch support and with both GCC 7.1 and GCC mainline. * sysdeps/arm/armv7/multiarch/Makefile [$(subdir) = string] (sysdeps_routines): Add memchr_noneon. * sysdeps/arm/armv7/multiarch/ifunc-memchr.h: New file. * sysdeps/arm/armv7/multiarch/memchr_noneon.S: Likewise. * sysdeps/arm/armv7/multiarch/rtld-memchr.S: Likewise. * sysdeps/arm/armv7/multiarch/memchr.S: Remove file. * sysdeps/arm/armv7/multiarch/memchr.c: New file. * sysdeps/arm/armv7/multiarch/memchr_impl.S: Move to ... * sysdeps/arm/armv7/multiarch/memchr_neon.S: ... here. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* arm: Implement memcpy ifunc selection in CAdhemerval Zanella2017-11-0610-82/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactor ARM memcpy ifunc selector to a C implementation. No functional change is expected, including ifunc resolution rules. It also adds some cleanup: - Internal memcpy hidden definition (__GI_memcpy) is now a hidden symbol. - No need to create hidden definition for the ifunc variants. Checked on armv7-linux-gnueabihf and with a build for arm-linux-gnueabi, arm-linux-gnueabihf with and without multiarch support and with both GCC 7.1 and GCC mainline. I also checked with the some possible multiarch different configurations that trigger different memcpy buids (__ARM_NEON__ && !__SOFT_FP__, !__ARM_NEON__ && !__SOFT_FP__, and !__ARM_NEON__ && __SOFT_FP__). * sysdeps/arm/arm-ifunc.h: New file. * sysdeps/arm/armv7/multiarch/ifunc-memcpy.h: Likewise. * sysdeps/arm/armv7/multiarch/memcpy.c: Likewise. * sysdeps/arm/armv7/multiarch/memcpy_arm.S: Likewise. * sysdeps/arm/armv7/multiarch/rtld-memcpy.S: Likewise. * sysdeps/arm/armv7/multiarch/memcpy_neon.S [!__ARM_NEON__] (__memcpy_neon): Avoid create hidden alias. * sysdeps/arm/armv7/multiarch/memcpy_vfp.S [!__ARM_NEON_] (__memcpy_vfp): Likewise. * sysdeps/arm/armv7/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memcpy_arm. * sysdeps/arm/armv7/multiarch/memcpy.S: Remove file. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use newly built crt*.o files to build shared objects [BZ #22362]H.J. Lu2017-11-066-0/+43
| | | | | | | | | | | | | | | | | | | When multi-lib GCC is used to build glibc, the search order of GCC driver for crt*.o is -B*/`gcc -print-multi-directory`, the installed diretory, -B*/. This patch adds multi-lib support to csu/Makefile so that -B/glibc-build-directory/csu/ will pick up the newly built crt*.o. Tested on x86-64 for i686 and x32. [BZ #22362] * Makerules (make-link-multidir): New. * config.make.in (multidir): New. * configure.ac (libc_cv_multidir): New. AC_SUBST. * configure: Regenerated. * csu/Makefile [$(multidir) != .](multilib-extra-objs): New. [$(multidir) != .](extra-objs): Add $(multilib-extra-objs). [$(multidir) != .]($(addprefix $(objpfx)$(multidir)/, $(install-lib))): New target.
* Do not declare _Float128 support for powerpc64le -mlong-double-64 (bug 22402).Joseph Myers2017-11-062-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The powerpc bits/floatn.h declares _Float128 support to be present when the compiler supports it for powerpc64le. However, in the case where -mlong-double-64 is used, __MATH_TG does not actually support _Float128; it only supports _Float128 in the distinct-long-double case. This shows up as a build failure when building glibc mainline with GCC mainline, given the recently added sanity check in math.h for configurations supported by __MATH_TG, as the compat code for -mlong-double-64 fails to build. However, the bug was logically present before that change (including in 2.26), just less visible. This patch fixes the build failure by declaring _Float128 to be unsupported in that case. (Of course this can't actually stop users calling the type-generic macros with _Float128 arguments with -mlong-double-64, just as they could be called with other unsupported types on other platforms, but perhaps makes it less likely by making all the type-specific _Float128 interfaces invisible in that case.) Tested compilation for powerpc64le with build-many-glibcs.py. [BZ #22402] * sysdeps/powerpc/bits/floatn.h: Include <bits/long-double.h>. [__NO_LONG_DOUBLE_MATH] (__HAVE_FLOAT128): Define to 0.
* tpi_PG locale: Fix wrong d_fmtMike FABIAN2017-11-042-1/+6
|
* manual: Document the O_TMPFILE flagFlorian Weimer2017-11-042-0/+32
| | | | Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
* Handle more _FloatN, _FloatNx types in __MATH_TG.Joseph Myers2017-11-032-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch prepares __MATH_TG to handle more such types. Various unhandled cases, which do not correspond to any current glibc configuration, have explicit #errors added. _Float32 and _Float64x are then handled appropriately in the _Generic case, which is the only one, other than the cases where use of sizeof is sufficient, where they should ever be explicit types at the language level instead of typedefs. There is no need to handle _Float64 or _Float32x explicitly there because the default case calling a double function is correct for those types. Tested for x86_64. * math/math.h [__HAVE_DISTINCT_FLOAT16 || __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64 || __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X || __HAVE_DISTINCT_FLOAT128X]: Use #error. [__NO_LONG_DOUBLE_MATH && __HAVE_DISTINCT_FLOAT128]: Likewise. [__HAVE_DISTINCT_FLOAT128 && !__HAVE_GENERIC_SELECTION && __HAVE_FLOATN_NOT_TYPEDEF]: Likewise. [__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION] (__MATH_TG_F32): New macro. [__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION] (__MATH_TG_F64X): Likewise. [__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION] (__MATH_TG): Use __MATH_TG_F32 and __MATH_TG_F64X.
* Update translations from the Translation ProjectDmitry V. Levin2017-11-033-4/+9
| | | | | * po/de.po: Update translations. * po/ru.po: Likewise.
* manual: Document the linkat functionFlorian Weimer2017-11-042-1/+33
| | | | Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
* Handle more _FloatN, _FloatNx types in tgmath.h.Joseph Myers2017-11-032-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch improves how <tgmath.h> handles such types. Use of #error is added for cases of distinct types that are not supported by the header, to indicate that additional work on the header would be needed if, for example, _Float16 support were added to glibc. Given that #error, types with the same format as other types are handled automatically by the sizeof-based logic, so the only case needing special handling is that where _Float64x exists, has the same format as _Float128, does not have the same format as long double, and is not a typedef for _Float128. In this case (which will apply for powerpc64le once _Float64x support is added to glibc), the __builtin_types_compatible_p calls testing for _Float128 need corresponding calls testing for _Float64x, which this patch adds. Tested for x86_64. * math/tgmath.h [__HAVE_DISTINCT_FLOAT16 || __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64 || __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X || __HAVE_DISTINCT_FLOAT128X]: Use #error. [__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_F128): Handle _Float64x the same as _Float128. [__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_CF128): Likewise.
* Declare strtof, strfromf functions for more _FloatN, _FloatNx types.Joseph Myers2017-11-032-2/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch arranges for <stdlib.h> to declare strtof and strfromf functions for all such types, similarly to the declarations already present for _Float128. Tested for x86_64. * stdlib/stdlib.h [__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16): Declare. [__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32): Likewise. [__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64): Likewise. [__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32x): Likewise. [__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64x): Likewise. [__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof128x): Likewise. [__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf16): Likewise. [__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf32): Likewise. [__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf64): Likewise. [__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf32x): Likewise. [__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf64x): Likewise. [__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf128x): Likewise. [__USE_GNU && __HAVE_FLOAT16] (strtof16_l): Likewise. [__USE_GNU && __HAVE_FLOAT32] (strtof32_l): Likewise. [__USE_GNU && __HAVE_FLOAT64] (strtof64_l): Likewise. [__USE_GNU && __HAVE_FLOAT32X] (strtof32x_l): Likewise. [__USE_GNU && __HAVE_FLOAT64X] (strtof64x_l): Likewise. [__USE_GNU && __HAVE_FLOAT128X] (strtof128x_l): Likewise.
* aarch64: Guess L1 cache linesize for aarch64Richard Henderson2017-11-032-0/+59
| | | | | | | Using the cache hierarchy linesize minimum in CTR_EL0. See the comment within the code for rationale. * sysdeps/unix/sysv/linux/aarch64/sysconf.c: New file.
* aarch64: optimize _dl_tlsdesc_dynamic fast pathSzabolcs Nagy2017-11-032-54/+55
| | | | | | | | Remove some load/store instructions from the dynamic tlsdesc resolver fast path. This gives around 20% faster tls access in dlopened shared libraries (assuming glibc ran out of static tls space). * sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Optimize.
* arm: Remove lazy tlsdesc initialization related codeSzabolcs Nagy2017-11-035-209/+13
| | | | | | | | | | | | | | Lazy tlsdesc initialization is no longer used in the dynamic linker so all related code can be removed. * sysdeps/arm/dl-machine.h (elf_machine_runtime_setup): Remove DT_TLSDESC_GOT initialization. * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_lazy_resolver): Remove. (_dl_tlsdesc_resolve_hold): Likewise. * sysdeps/aarch64/dl-tlsdesc.h (_dl_tlsdesc_lazy_resolver): Remove. (_dl_tlsdesc_resolve_hold): Likewise. * sysdeps/aarch64/tlsdesc.c (_dl_tlsdesc_lazy_resolver_fixup): Remove. (_dl_tlsdesc_resolve_hold_fixup): Likewise.
* arm: Remove unnecessary volatile qualifierSzabolcs Nagy2017-11-032-2/+5
| | | | | | There is no reason to treat tlsdesc entries as volatile objects. * sysdeps/arm/dl-machine.h (elf_machine_rel): Remove volatile.
* [BZ #18572] arm: Disable lazy initialization of tlsdesc entriesSzabolcs Nagy2017-11-032-9/+21
| | | | | | | | | | | | | | | | | Follow up to https://sourceware.org/ml/libc-alpha/2015-11/msg00272.html Always do tls descriptor initialization at load time during relocation processing (as if DF_BIND_NOW were set for the binary) to avoid barriers at every tls access. This patch mimics bind-now semantics in the lazy relocation code of the arm target (elf_machine_lazy_rel). Ideally the static linker should be updated too to not emit tlsdesc relocs in DT_REL*, so elf_machine_lazy_rel is not called on them at all. [BZ #18572] * sysdeps/arm/dl-machine.h (elf_machine_lazy_rel): Do symbol binding non-lazily for R_ARM_TLS_DESC.
* [BZ #17078] arm: remove prelinker support for R_ARM_TLS_DESCSzabolcs Nagy2017-11-032-31/+10
| | | | | | | | | | | | | | | | | | | | | | | | This patch reverts commit 9c82da17b5794efebe005de2fd22d61a3ea4b58a Author: Maciej W. Rozycki <macro@codesourcery.com> Date: 2014-07-17 19:22:05 +0100 [BZ #17078] ARM: R_ARM_TLS_DESC prelinker support This only implemented support for the lazy binding case (and thus closed the bugzilla ticket prematurely), however tlsdesc on arm is not correct with lazy binding because there is a data race between the lazy initialization code and tlsdesc resolver functions. Lazy initialization of tlsdesc entries will be removed from arm to fix the data races and thus this half-finished prelinker support is no longer useful. [BZ #17078] * sysdeps/arm/dl-machine.h (elf_machine_rela): Remove the R_ARM_TLS_DESC case. (elf_machine_lazy_rel): Remove the prelink check.
* aarch64: Remove barriers from TLS descriptor functionsSzabolcs Nagy2017-11-035-342/+18
| | | | | | | | | | | | | | | | | | | | Remove ldar synchronization and most lazy TLSDESC initialization related code. * sysdeps/aarch64/dl-machine.h (elf_machine_runtime_setup): Remove DT_TLSDESC_GOT initialization. * sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_return_lazy): Remove. (_dl_tlsdesc_resolve_rela): Likewise. (_dl_tlsdesc_resolve_hold): Likewise. (_dl_tlsdesc_undefweak): Remove ldar. (_dl_tlsdesc_dynamic): Likewise. * sysdeps/aarch64/dl-tlsdesc.h (_dl_tlsdesc_return_lazy): Remove. (_dl_tlsdesc_resolve_rela): Likewise. (_dl_tlsdesc_resolve_hold): Likewise. * sysdeps/aarch64/tlsdesc.c (_dl_tlsdesc_resolve_rela_fixup): Remove. (_dl_tlsdesc_resolve_hold_fixup): Likewise. (_dl_tlsdesc_resolve_rela): Likewise. (_dl_tlsdesc_resolve_hold): Likewise.
* aarch64: Disable lazy symbol binding of TLSDESCSzabolcs Nagy2017-11-032-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always do TLS descriptor initialization at load time during relocation processing to avoid barriers at every TLS access. In non-dlopened shared libraries the overhead of tls access vs static global access is > 3x bigger when lazy initialization is used (_dl_tlsdesc_return_lazy) compared to bind-now (_dl_tlsdesc_return) so the barriers dominate tls access performance. TLSDESC relocs are in DT_JMPREL which are processed at load time using elf_machine_lazy_rel which is only supposed to do lightweight initialization using the DT_TLSDESC_PLT trampoline (the trampoline code jumps to the entry point in DT_TLSDESC_GOT which does the lazy tlsdesc initialization at runtime). This patch changes elf_machine_lazy_rel in aarch64 to do the symbol binding and initialization as if DF_BIND_NOW was set, so the non-lazy code path of elf/do-rel.h was replicated. The static linker could be changed to emit TLSDESC relocs in DT_REL*, which are processed non-lazily, but the goal of this patch is to always guarantee bind-now semantics, even if the binary was produced with an old linker, so the barriers can be dropped in tls descriptor functions. After this change the synchronizing ldar instructions can be dropped as well as the lazy initialization machinery including the DT_TLSDESC_GOT setup. I believe this should be done on all targets, including ones where no barrier is needed for lazy initialization. There is very little gain in optimizing for large number of symbolic tlsdesc relocations which is an extremely uncommon case. And currently the tlsdesc entries are only readonly protected with -z now and some hardennings against writable JUMPSLOT relocs don't work for TLSDESC so they are a security hazard. (But to fix that the static linker has to be changed.) * sysdeps/aarch64/dl-machine.h (elf_machine_lazy_rel): Do symbol binding and initialization non-lazily for R_AARCH64_TLSDESC.
* Mark lazy tlsdesc helper functions unused to avoid warningsSzabolcs Nagy2017-11-032-0/+7
| | | | | | | | These static functions are not needed if a target does not do lazy tlsdesc initialization. * elf/tlsdeschtab.h (_dl_tls_resolve_early_return_p): Mark unused. (_dl_tlsdesc_wake_up_held_fixups): Likewise.
* Declare wcstof functions for more _FloatN, _FloatNx types.Joseph Myers2017-11-022-1/+84
| | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch arranges for <wchar.h> to declare wcstof functions for all such types, similarly to the declarations already present for _Float128. Tested for x86_64. * wcsmbs/wchar.h [__HAVE_FLOAT16 && __USE_GNU] (wcstof16): Declare. [__HAVE_FLOAT32 && __USE_GNU] (wcstof32): Likewise. [__HAVE_FLOAT64 && __USE_GNU] (wcstof64): Likewise. [__HAVE_FLOAT32X && __USE_GNU] (wcstof32x): Likewise. [__HAVE_FLOAT64X && __USE_GNU] (wcstof64x): Likewise. [__HAVE_FLOAT128X && __USE_GNU] (wcstof128x): Likewise. [__HAVE_FLOAT16 && __USE_GNU] (wcstof16_l): Likewise. [__HAVE_FLOAT32 && __USE_GNU] (wcstof32_l): Likewise. [__HAVE_FLOAT64 && __USE_GNU] (wcstof64_l): Likewise. [__HAVE_FLOAT32X && __USE_GNU] (wcstof32x_l): Likewise. [__HAVE_FLOAT64X && __USE_GNU] (wcstof64x_l): Likewise. [__HAVE_FLOAT128X && __USE_GNU] (wcstof128x_l): Likewise.
* tpi_PG locale: fix syntax error [BZ #22382]Mike FABIAN2017-11-022-1/+14
| | | | | | [BZ #22382] * localedata/locales/tpi_PG (LC_TIME): Fix syntax error. * localedata/locales/tpi_PG: Add standard header.
* test-errno-linux: quotactl can fail with EPERM in containersFlorian Weimer2017-11-022-38/+50
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* stdio-common: Use array_length and array_end macrosFlorian Weimer2017-11-0215-42/+65
|
* <array_length.h>: New array_length and array_end macrosFlorian Weimer2017-11-022-0/+41
|
* Fix ChangeLog typoRafal Luzynski2017-11-021-1/+1
| | | | It's been confirmed by the original author: "01-31" should be "10-31".
* posix/tst-glob-tilde.c: Add test for bug 22332Florian Weimer2017-11-022-23/+37
|
* Include bits/cmathcalls.h for more _FloatN, _FloatNx types.Joseph Myers2017-11-012-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx type support, this patch arranges for <bits/cmathcalls.h> to be included by <complex.h> for each such type under conditions and with macros defined corresponding to those used for _Float128. Tested for x86_64. * math/complex.h [(__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Include <bits/cmathcalls.h> with appropriate macros defined and undefined. [(__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise. [(__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise. [(__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise. [(__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise. [(__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
* Clean up complex.h handling of float128.Joseph Myers2017-11-012-15/+21
| | | | | | | | | | | | | | | | | | | This patch cleans up the way complex.h handles inclusion of bits/cmathcalls.h for float128. The inclusion was between those for the types float and long double; the patch moves it after that for long double, matching how bits/mathcalls.h and bits/math-finite.h inclusions are ordered. There is no need for the undefine and define of _Mdouble_complex_ to be conditional, since __CFLOAT128 is always defined by bits/floatn.h when _Float128 is supported, so the patch removes the unnecessary conditionals. Tested for x86_64. * math/complex.h [(__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !LIBC)) && __GLIBC_USE (IEC_60559_TYPES_EXT)]: Move conditional code after that for long double. Do not condition define and undefine of _Mdouble_complex_ on [__CFLOAT128].
* x86: Add sysdeps/x86/sysdep.hH.J. Lu2017-11-014-85/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new header file, sysdeps/x86/sysdep.h, for common assembly code macros between i386 and x86-64. Tested on i686 and x86-64. There are no differences in outputs of "readelf -a" and "objdump -dw" on all glibc shared objects before and after the patch. * sysdeps/i386/sysdep.h: Include <sysdeps/x86/sysdep.h> instead of <sysdeps/generic/sysdep.h>. (ALIGNARG): Removed. (ASM_SIZE_DIRECTIVE): Likewise. (ENTRY): Likewise. (END): Likewise. (ENTRY_CHK): Likewise. (END_CHK): Likewise. (syscall_error): Likewise. (mcount): Likewise. (PSEUDO_END): Likewise. (L): Likewise. (atom_text_section): Likewise. * sysdeps/x86/sysdep.h: New file. * sysdeps/x86_64/sysdep.h: Include <sysdeps/x86/sysdep.h> instead of <sysdeps/generic/sysdep.h>. (ALIGNARG): Removed. (ASM_SIZE_DIRECTIVE): Likewise. (ENTRY): Likewise. (END): Likewise. (ENTRY_CHK): Likewise. (END_CHK): Likewise. (syscall_error): Likewise. (mcount): Likewise. (PSEUDO_END): Likewise. (L): Likewise. (atom_text_section): Likewise.