summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* sparc: Fix .udiv plt on libcAdhemerval Zanella2017-04-065-0/+15
| | | | | | | | | | | | | | | | | | | | With the removal of divdi3 object from sparcv9-linux-gnu build, its definition came from libgcc and its functions internall calls .udiv. Since glibc also exports these symbols for compatibility reasons, it will end up creating PLT calls internally in libc.so. To avoid it, this patch uses the linker option --wrap to replace all the internal libc.so .udiv calls to the wrapper __wrap_.udiv. Along with strong alias in the udiv implementations, it makes linker do local calls. Checked on sparcv9-linux-gnu. * sysdeps/sparc/sparc32/Makefile (libc.so-gnulib): New rule. * sysdeps/sparc/sparc32/sparcv8/udiv.S (.udiv): Make a strong_alias to __wrap_.udiv. * sysdeps/sparc/sparc32/sparcv9/udiv.S (.udiv): Likewise. * sysdeps/sparc/sparc32/udiv.S (.udiv): Likewise.
* Build divdi3 only for architecture that required itAdhemerval Zanella2017-04-0611-11/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As noted in [1], divdi3 object is only exported in a handful ABIs (i386, m68k, powerpc32, s390-32, and ia64), however it is built for all current architectures regardless. This patch refact the make rules for this object to so only the aforementioned architectures that actually require it builds it. Also, to avoid internal PLT calls to the exported symbol from the module, glibc uses an internal header (symbol-hacks.h) which is unrequired (and in fact breaks the build for architectures that intend to get symbol definitions from libgcc.a). The patch also changes it to create its own header (divdi3-symbol-hacks.h) and adjust the architectures that require it accordingly. I checked the build/check (with run-built-tests=no) on the following architectures (which I think must cover all supported ABI/builds) using GCC 6.3: aarch64-linux-gnu alpha-linux-gnu arm-linux-gnueabihf hppa-linux-gnu ia64-linux-gnu m68k-linux-gnu microblaze-linux-gnu mips64-n32-linux-gnu mips-linux-gnu mips64-linux-gnu nios2-linux-gnu powerpc-linux-gnu powerpc-linux-gnu-power4 powerpc64-linux-gnu powerpc64le-linux-gnu s390x-linux-gnu s390-linux-gnu sh4-linux-gnu sh4-linux-gnu-soft sparc64-linux-gnu sparcv9-linux-gnu tilegx-linux-gnu tilegx-linux-gnu-32 tilepro-linux-gnu x86_64-linux-gnu x86_64-linux-gnu-x32 i686-linux-gnu I only saw one regression on sparcv9-linux-gnu (extra PLT call to .udiv) which I address in next patch in the set. It also correctly build SH with GCC 7.0.1 (without any regression from c89721e25d). [1] https://sourceware.org/ml/libc-alpha/2017-03/msg00243.html * sysdeps/i386/symbol-hacks.h: New file. * sysdeps/m68k/symbol-hacks.h: New file. * sysdeps/powerpc/powerpc32/symbol-hacks.h: New file. * sysdeps/s390/s390-32/symbol-hacks.h: New file. * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = csu] (sysdep_routines): New rule: divdi3 object. [$(subdir) = csu] (sysdep-only-routines): Likewise. [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise. * sysdeps/unix/sysv/linux/m68k/Makefile [$(subdir) = csu] (sysdep_routines): Likewise. [$(subdir) = csu] (sysdep-only-routines): Likewise. [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile [$(subdir) = csu] (sysdep_routines): Likewise. [$(subdir) = csu] (sysdep-only-routines): Likewise. [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/Makefile [$(subdir) = csu] (sysdep_routines): Likewise. [$(subdir) = csu] (sysdep-only-routines): Likewise. [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise. * sysdeps/wordsize-32/Makefile: Remove file. * sysdeps/wordsize-32/symbol-hacks.h: Definitions move to ... * sysdeps/wordsize-32/divdi3-symbol-hacks.h: ... here.
* Define TEST_FUNCTION_ARGV in elf/tst-dlopen-aout.cH.J. Lu2017-04-052-1/+6
| | | | | * elf/tst-dlopen-aout.c (TEST_FUNCTION): Removed. (TEST_FUNCTION_ARGV): New.
* Update elf tests to use the support test driver.Wainer dos Santos Moschetta2017-04-0572-159/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced test-skeleton.c with support/test-driver.c and adjusted the tests accordinly. Checked on x86_64. * elf/next.c: Import support/test-driver.c instead of test-skeleton.c and delete TEST_FUNCTION macro definition. * elf/nodelete.c: Likewise. * elf/order2.c: Likewise. * elf/tst-_dl_addr_inside_object.c: Likewise. * elf/tst-addr1.c: Likewise. * elf/tst-align.c: Likewise. * elf/tst-align2.c: Likewise. * elf/tst-audit11.c: Likewise. * elf/tst-audit12.c: Likewise. * elf/tst-audit2.c: Likewise. * elf/tst-audit9.c: Likewise. * elf/tst-auxv.c: Likewise and define TEST_FUNCTION_ARGV macro. * elf/tst-deep1.c: Likewise. * elf/tst-dl-iter-static.c: Likewise. * elf/tst-dlmodcount.c: Likewise. * elf/tst-dlmopen1.c: Likewise. * elf/tst-dlmopen2.c: Likewise. * elf/tst-dlmopen3.c: Likewise. * elf/tst-dlopen-aout.c: Likewise. * elf/tst-dlopenrpath.c: Likewise. * elf/tst-dlsym-error.c: Likewise. * elf/tst-execstack-needed.c: Likewise. * elf/tst-execstack-prog.c: Likewise. * elf/tst-execstack.c: Likewise. * elf/tst-global1.c: Likewise. * elf/tst-gnu2-tls1.c: Likewise. * elf/tst-latepthread.c: Likewise. * elf/tst-leaks1.c: Likewise. * elf/tst-linkall-static.c: Likewise. (do_test): New function. * elf/tst-nodelete-opened.c: Likewise. * elf/tst-nodelete.cc: Likewise. * elf/tst-nodelete2.c: Likewise. * elf/tst-noload.c: Likewise. * elf/tst-null-argv.c: Likewise and define TEST_FUNCTION_ARGV marcro. * elf/tst-order-main.c: Likewise. * elf/tst-pathopt.c: Likewise. * elf/tst-pie2.c: Likewise. * elf/tst-piemod1.c: Likewise. * elf/tst-prelink.c: Likewise. * elf/tst-protected1a.c: Likewise. * elf/tst-protected1b.c: Likewise. * elf/tst-ptrguard1.c: Likewise, import getopt.h, and define _GNU_SOURCE macro. (cmdline_process_function): New function. * elf/tst-relsort1.c: Likewise. * elf/tst-stackguard1.c: Likewise, import getopt.h, and define _GNU_SOURCE macro. (cmdline_process_function): New function. * elf/tst-thrlock.c: Likewise. * elf/tst-tls-dlinfo.c: Likewise. * elf/tst-tls-manydynamic.c: Likewise and import support/xthread.h. * elf/tst-tls1.c: Likewise. * elf/tst-tls10.c: Likewise. * elf/tst-tls11.c: Likewise. * elf/tst-tls12.c: Likewise. * elf/tst-tls13.c: Likewise. * elf/tst-tls14.c: Likewise. * elf/tst-tls15.c: Likewise. * elf/tst-tls16.c: Likewise. * elf/tst-tls17.c: Likewise. * elf/tst-tls18.c: Likewise. * elf/tst-tls19.c: Likewise. * elf/tst-tls2.c: Likewise. * elf/tst-tls3.c: Likewise. * elf/tst-tls4.c: Likewise. * elf/tst-tls5.c: Likewise. * elf/tst-tls6.c: Likewise. * elf/tst-tls7.c: Likewise. * elf/tst-tls8.c: Likewise. * elf/tst-tls9.c: Likewise. * elf/tst-tlsalign-extern.c: Likewise. * elf/tst-tlsalign.c: Likewise. * elf/tst-unique1.c: Likewise. * elf/tst-unique2.c: Likewise. * elf/vismain.c: Likewise.
* Add page tests to string/test-strnlen.Wainer dos Santos Moschetta2017-04-052-0/+60
| | | | | | | | | | | | | | | | | | May be tricky for otimized implementations to handle strings around page boundary once, for instance, it is performed unaligned loads or when maxlen is used as a hint for vectorized loops. The test cases should unveil regression bugs on these cases. To some extend do_random_tests in string/test-strnlen tests strings placed at page end but it does not cover all cases. So this change adds tests which consists of placing strings of varying sizes ending at the page boundary. It also combines with different values of maxlen. Tested on ppc64le and x86_64. * string/test-strnlen.c (do_page_tests): New function to check length of strings ending at the page boundary. (test_main): Added call to the do_page_tests function.
* powerpc64: Add POWER8 strnlenWainer dos Santos Moschetta2017-04-056-5/+485
| | | | | | | | | | | | | | | | | | | | | | | | Added strnlen POWER8 otimized for long strings. It delivers same performance as POWER7 implementation for short strings. This takes advantage of reasonably performing unaligned loads and bit permutes to check the first 1-16 bytes until quadword aligned, then checks in 64 bytes strides until unsafe, then 16 bytes, truncating the count if need be. Likewise, the POWER7 code is recycled for less than 32 bytes strings. Tested on ppc64 and ppc64le. * sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add strnlen-power8. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c (strnlen): Add __strnlen_power8 to list of strnlen functions. * sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S: New file. * sysdeps/powerpc/powerpc64/multiarch/strnlen.c (__strnlen): Add __strnlen_power8 to ifunc list. * sysdeps/powerpc/powerpc64/power8/strnlen.S: New file.
* Update wcsmbs tests to use the support test driverWainer dos Santos Moschetta2017-04-049-16/+20
| | | | | | | | | | | | | | | | | Replaced test-skeleton.c with support/test-driver.c and adjusted the tests accordinly. Checked on x86_64-linux-gnu. * wcsmbs/tst-btowc.c: Import support/test-driver.c and remove the TEST_FUNCTION macro definition. * wcsmbs/tst-mbrtowc2.c: Likewise. * wcsmbs/tst-mbsrtowcs.c: Likewise. * wcsmbs/tst-wchar-h.c: Likewise. * wcsmbs/tst-wcpncpy.c: Likewise. * wcsmbs/tst-wcrtomb.c: Likewise. * wcsmbs/tst-wcsnlen.c: Likewise. * wcsmbs/tst-wcstof.c: Likewise.
* Remove CALL_THREAD_FCT macroAdhemerval Zanella2017-04-045-78/+6
| | | | | | | | | | | | | | | | This patch removes CALL_THREAD_FCT macro usage and its defition for x86. For 32 bits it usage is only for force 16 stack alignment, however stack is already explicit aligned in clone syscall. For 64 bits and x32 it just a function call and there is no need to code it with inline assembly. Checked on i686-linux-gnu, x86_64-linux-gnu, and x86_64-linux-gnu-x32. * nptl/pthread_create.c (START_THREAD_DEFN): Remove CALL_THREAD_FCT macro usage. * sysdeps/i386/nptl/tls.h (CALL_THREAD_FCT): Remove definition. * sysdeps/x86_64/nptl/tls.h (CALL_THREAD_FCT): Likewise. * sysdeps/x86_64/32/nptl/tls.h: Remove file.
* Remove __ASSUME_REQUEUE_PIAdhemerval Zanella2017-04-047-21/+14
| | | | | | | | | | | | | | | | | | | | | | The new cond var implementation (ed19993b5b0d) removed all the __ASSUME_{REQUEUE_PI,FUTEX_LOCK_PI} internal usage so there is no need to keep defining it. This patch removes all USE_REQUEUE_PI and __ASSUME_REQUEUE_PI. It is as follow up from BZ#18463. Checked with a build for x86_64-linux-gnu, arm-linux-gnueabhf, m68-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * nptl/pthreadP.h (USE_REQUEUE_PI): Remove ununsed macro. * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_REQUEUE_PI): Likewise. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_REQUEUE_PI): Likewise. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_REQUEUE_PI): Likewise. * sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_REQUEUE_PI): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_REQUEUE_PI): Likewise.
* resolv: Add tst-resolv-canonnameFlorian Weimer2017-04-043-0/+328
|
* nss_dns: Replace local declarations with declarations from a header fileFlorian Weimer2017-04-044-14/+16
|
* nss_dns: Remove superfluous dn_expand call from network handlingFlorian Weimer2017-04-042-5/+8
|
* resolv: Add test coverage for ns_name_unpack, ns_name_ntopFlorian Weimer2017-04-044-0/+863
|
* S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit.Stefan Liebler2017-04-042-4/+11
| | | | | | | | | | | | | | | | | | This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit. This ensures that r14 isn't used to save and restore r12 while r14 is clobbered by the bas-instruction. As note: r12 can't be added to clobber list as gcc would fail with: error: PIC register clobbered by ‘12’ in ‘asm’ For 64bit this fix was already done in 2004 in the commit b80af23ac6973e69df6cd23d221fa44fffb21e17. ChangeLog: * sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD): Clobber also r14.
* ChangeLog: fix BZ style to be consistent and match majority of existing codeMike Frysinger2017-04-034-24/+24
|
* posix_spawn: use a larger min stack for -fstack-check [BZ #21253]Mike Frysinger2017-04-032-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | When glibc is built with -fstack-check, trying to use posix_spawn can lead to segfaults due to gcc internally probing stack memory too far. The new spawn API will allocate a minimum of 1 page, but the stack checking logic might probe a couple of pages. When it tries to walk them, everything falls apart. The gcc internal docs [1] state the default interval checking is one page. Which means we need two pages (the current one, and the next probed). No target currently defines it larger. Further, it mentions that the default minimum stack size needed to recover from an overflow is 4/8KiB for sjlj or 8/12KiB for others. But some Linux targets (like mips and ppc) go up to 16KiB (and some non-Linux targets go up to 24KiB). Let's create each child with a minimum of 32KiB slack space to support them all, and give us future breathing room. No test is added as existing ones crash. Even a simple call is enough to trigger the problem: char *argv[] = { "/bin/ls", NULL }; posix_spawn(NULL, "/bin/ls", NULL, NULL, argv, NULL); [1] https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gccint/Stack-Checking.html
* Call the right helper function when setting mallopt M_ARENA_MAX (BZ #21338)Wladimir J. van der Laan2017-04-012-1/+7
| | | | | | | | | | | | Fixes a typo introduced in commit be7991c0705e35b4d70a419d117addcd6c627319. This caused mallopt(M_ARENA_MAX) as well as the environment variable MALLOC_ARENA_MAX to not work as intended because it set the wrong internal parameter. [BZ #21338] * malloc/malloc.c: Call do_set_arena_max for M_ARENA_MAX instead of incorrect do_set_arena_test
* Fix condition for inclusion of math-finite.h for long doubleGabriel F. T. Gomes2017-03-313-2/+7
| | | | | | | | | | The condition for declaration of long double functions in math-finite.h was #ifdef __MATH_DECLARE_LDOUBLE before the macroization of this file. After the macroization, it was incorreclty changed to #if __MATH_DECLARE_LDOUBLE, which broke the build for arm. * math/math.h: Fix check for __MATH_DECLARE_LDOUBLE. * math/bits/math-finite.h: Likewise.
* fts: Fix symbol redirect for fts_set [BZ #21289]Slava Barinov2017-03-312-1/+6
| | | | | In a 32-bit environment with _FILE_OFFSET_BITS=64, the __REDIRECT macro combined with __THROW generates an invalid C++ declaration.
* Fix more test-errno issuesAdhemerval Zanella2017-03-302-2/+12
| | | | | | | | | | | | | | | | | | This patch fixes some test-errno-linux unexpected returns for the tested syscalls on some older kernels (I saw it on a Linux 3.8 on armv7l). Basically: - inotify_add_watch: Linux v3.8 (676a0675c) removed the test to check at least one valid bit in flags (to return EINVAL). It was later added back in v3.9 (04df32fa1). - quotactl: returns ENOSYS for kernels not configured with CONFIG_QUOTA. Checked on x86_64-linux-gnu and armv7l-linux-gnueabihf. * sysdeps/unix/sysv/linux/test-errno-linux.c (do_test): Handle non expected inotify_add_watch and quotactl return.
* Change return type in the declaration of __ieee754_rem_pio2lGabriel F. T. Gomes2017-03-303-2/+9
| | | | | | | | | | | | | The implementation of __ieee754_rem_pio2l in ldbl-128, ldbl-128ibm, and ldbl-96 return the type int32_t, whereas math_private.h declares it as returning int. This patch changes the declaration to match the declaration in thoses directories, as well as it changes the stub implementation in math/e_rem_pio2l.c, similarly. * math/e_rem_pio2l.c (__ieee754_rem_pio2l): Change return type to int32_t. * sysdeps/generic/math_private.h: Declare __ieee754_rem_pio2l as returning int32_t.
* Macroize inclusion of math-finite.hGabriel F. T. Gomes2017-03-303-387/+140
| | | | | | | | | | | | | | | This patch macroizes the declarations in math/bits/math-finite.h similarly to what math/bits/mathcalls.h does. For each floating-point type, the file is included once in math/math.h. This will reduce the amount of repetitive boilerplate required when adding float128 versions of these declarations. Tested for powerpc64le and s390x. * math/math.h: Include bits/math-finite.h once per floating-point type. * math/bits/math-finite.h: Macroize all declarations by floating-point type.
* Fix i686 memchr overflow calculation (BZ#21182)Adhemerval Zanella2017-03-293-1/+15
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes the regression added by 23d2770 for final address overflow calculation. The subtraction of the considered size (16) at line 120 is at wrong place, for sizes less than 16 subsequent overflow check will not take in consideration an invalid size (since the subtraction will be negative). Also, the lea instruction also does not raise the carry flag (CF) that is used in subsequent jbe to check for overflow. The fix is to follow x86_64 logic from 3daef2c where the overflow is first check and a sub instruction is issued. In case of resulting negative size, CF will be set by the sub instruction and a NULL result will be returned. The patch also add similar tests reported in bug report. Checked on i686-linux-gnu and x86_64-linux-gnu. * string/test-memchr.c (do_test): Add BZ#21182 checks for address near end of a page. * sysdeps/i386/i686/multiarch/memchr-sse2.S (__memchr): Fix overflow calculation.
* Change TEST_NAME to memcpy to fix IFUNC testing of multiple versions.Steve Ellcey2017-03-282-2/+7
| | | | | * benchtests/bench-memcpy-random.c (TEST_NAME): Change to memcpy. (IMPL) Call with 1 instead of 0 as argument.
* Consolidate set* Linux implementationAdhemerval Zanella2017-03-2865-379/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the Linux setegid, seteuid, setgid, setgroups, setregid, setresgid, setresuid, setreuid, and setuid implementation on default sysdeps/unix/sysv/linux/set*.c implementation. It basically removes all the architecture define implementations and add support for __NR_set*32 syscall on Linux default implementation. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/arm/setegid.c: Remove file. * sysdeps/unix/sysv/linux/arm/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/arm/setgid.c: Likewise. * sysdeps/unix/sysv/linux/arm/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/arm/setregid.c: Likewise. * sysdeps/unix/sysv/linux/arm/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/arm/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/arm/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/arm/setuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setegid.c: Likewise. * sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/i386/setregid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setuid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setegid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setgid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setregid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/m68k/setuid.c: Likewise. * sysdeps/unix/sysv/linux/microblaze/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setegid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setgid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setregid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/setuid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setegid.c: Likewise. * sysdeps/unix/sysv/linux/sh/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setgid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/sh/setregid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/sh/setuid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setuid.c: Likewise. * sysdeps/unix/sysv/linux/setegid.c (setegid): Use INLINE_SYSCALL_ERROR_RETURN_VALUE. * sysdeps/unix/sysv/linux/seteuid.c (seteuid): Likewise. * sysdeps/unix/sysv/linux/setgid.c (setgid): Use __NR_setgid32 if defined. * sysdeps/unix/sysv/linux/setgroups.c (setgroups): Use __NR_setgroups32 if defined. * sysdeps/unix/sysv/linux/setregid.c (__setregid): Use __NR_setregid32 if defined. * sysdeps/unix/sysv/linux/setresgid.c (__setresgid): Use __NR_setresgid32 is defined. * sysdeps/unix/sysv/linux/setresuid.c (__setresuid): Use __NR_setresuid32 if defined. * sysdeps/unix/sysv/linux/setreuid.c (__setreuid): Use __NR_setreuid32 if defined. * sysdeps/unix/sysv/linux/setuid.c (__setuid): Use __NR_setuid32 if defined.
* localedata: hu_HU: fix multiple sorting bugs (bug 18934)Egmont Koblinger2017-03-285-145/+716
| | | | | | | | | | | | | | | | Fix the incorrect sorting order of a digraph and its geminated variant, regression introduced by a faulty fix to bug 13547 in commit b008d4c85619a753e441d7f473ba8af0db400bd6. Fix two inconsistencies in sorting unusual capitalization of digraphs (bug #18587). Enable DIACRIT_FORWARD to work around bug #17750. Sort foreign accents after the Hungarian ones. Add extensive unittests containing all the examples from The Rules of Hungarian Orthography and many more, including explanatory comments.
* Define more termios.h macros unconditionally for alpha (bug 21277).Joseph Myers2017-03-272-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | termios.h should define IUCLC for UNIX98 and older XSI standards. The sysdeps/unix/sysv/linux/alpha version defines it only if __USE_MISC, so causing some conform/ tests to fail. Other versions define it unconditionally (I* being a reserved namespace for this header); the API should be consistent between architectures in the absence of a clear reason for it to differ (and given that a symbol is part of the API on two architectures, I don't see any reason for the feature test macros required ever to differ between those architectures), so this patch makes the alpha version define it unconditionally as well. Two non-POSIX macros alongside it, IMAXBEL and IUTF8, are also defined unconditionally on other architectures, so this patch makes them consistent by defining them unconditionally on alpha as well. Tested (compilation only) with build-many-glibcs.py. [BZ #21277] * sysdeps/unix/sysv/linux/alpha/bits/termios.h (IUCLC): Define unconditionally. (IMAXBEL): Likewise. (IUTF8): Likewise.
* [AArch64] Update libm-test-ulpsSzabolcs Nagy2017-03-272-80/+92
| | | | * sysdeps/aarch64/libm-test-ulps: Update.
* Actually add bench-memcpy-randomSiddhesh Poyarekar2017-03-261-0/+157
| | | | git-add and commit the benchmark that Wilco posted on the list.
* Update old tunables framework document/script.Sunyeop Lee2017-03-244-14/+21
| | | | | | | | | | | Since commit 8b9e9c3c0bae497ad5e2d0ae2f333f62feddcc12, security_level replaces is_secure. There were some old files need to be updated. 2017-03-23 Sunyeop Lee <sunyeop97@gmail.com> * README.tunables: Updated descriptions. * elf/dl-tunables.list: Fixed typo: SXID_NONE -> NONE. * scripts/gen-tunables.awk: Updated the code related to the commit.
* Add a new randomized memcpy test for copies up to 256 bytes. The distributionWilco Dijkstra2017-03-232-1/+6
| | | | | | | | | | of the size and alignment is based on a trace of SPEC2006. Instead of repeating the same copy over and over again like the existing tests, it times several thousand different copies to more accurately estimate the overhead of branch prediction. * benchtests/Makefile (string-benchset): Add memcpy-random. * benchtests/bench-memcpy-random.c: New file.
* Change the order of function attributes in printf.hTulio Magno Quites Machado Filho2017-03-232-2/+8
| | | | | | | | | | | ISO C++ section 8.3.5 [dcl.fct] requires exception specifications to appear before attribute specifiers in function declarations. This patch fixes issues reported by stdio-common/check-installed-headers-cxx. * stdio-common/printf.h (register_printf_modifier): Change the order of __wur and __THROW. (register_printf_type): Likewise.
* Update string tests to use the support test driver.Wainer dos Santos Moschetta2017-03-2346-95/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced all imports of test-skeleton.c with support/test-driver.c. In some cases it was needed to adjust do_test to return int instead of static int since that is the method's signature expected by test-driver.c. Checked on x86_64. * string/test-string.h (TEST_FUNCTION): Use test_main instead of test_main (). (CMDLINE_PROCESS): Use function instead of defined macro. * debug/test-strcpy_chk.c: Import support/test-driver.c and also <suppport/support.h> to use set_fortify_handler(). * string/bug-envz1.c: Import support/test-driver.c instead of test-skeleton.c. * string/bug-strcoll2.c: Likewise. * string/bug-strtok1.c: Likewise. * string/stratcliff.c: Likewise. * string/test-ffs.c: Likewise. * string/test-memccpy.c: Likewise. * string/test-memchr.c: Likewise. * string/test-memcmp.c: Likewise. * string/test-memcpy.c: Likewise. * string/test-memmem.c: Likewise. * string/test-memmove.c: Likewise. * string/test-memrchr.c: Likewise. * string/test-memset.c: Likewise. * string/test-rawmemchr.c: Likewise. * string/test-strcasecmp.c: Likewise. * string/test-strcasestr.c: Likewise. * string/test-strcat.c: Likewise. * string/test-strchr.c: Likewise. * string/test-strcmp.c: Likewise. * string/test-strcpy.c: Likewise. * string/test-string.h: Likewise. * string/test-strlen.c: Likewise. * string/test-strncasecmp.c: Likewise. * string/test-strncat.c: Likewise. * string/test-strncmp.c: Likewise. * string/test-strncpy.c: Likewise. * string/test-strnlen.c: Likewise. * string/test-strpbrk.c: Likewise. * string/test-strrchr.c: Likewise. * string/test-strspn.c: Likewise. * string/test-strstr.c: Likewise. * string/tst-bswap.c: Likewise. * string/tst-cmp.c: Likewise. * string/tst-endian.c: Likewise. * string/tst-inlcall.c: Likewise. * string/tst-strcoll-overflow.c: Likewise. * string/tst-strfry.c: Likewise. * string/tst-strlen.c: Likewise. * string/tst-strtok.c: Likewise. * string/tst-strtok_r.c: Likewise. * string/tst-strxfrm.c: Likewise. * string/tst-strxfrm2.c: Likewise. * string/tst-svc.c: Likewise. * string/tst-svc2.c: Likewise.
* Another round of inclusion fixes for _ISOMAC testsuite.Zack Weinberg2017-03-225-5/+20
| | | | | | | | | * stdio-common/bug25.c: Include stdlib.h. * support/tst-support_format_dns_packet.c: Include stdio.h, stdlib.h, and string.h. * support/tst-support_record_failure.c: Include string.h. * support/tst-support_record_failure-2.sh: Adjust line number expectations and correct a typo in an error message.
* x86-64: Improve branch predication in _dl_runtime_resolve_avx512_opt [BZ #21258]H.J. Lu2017-03-213-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Skylake server, _dl_runtime_resolve_avx512_opt is used to preserve the first 8 vector registers. The code layout is if only %xmm0 - %xmm7 registers are used preserve %xmm0 - %xmm7 registers if only %ymm0 - %ymm7 registers are used preserve %ymm0 - %ymm7 registers preserve %zmm0 - %zmm7 registers Branch predication always executes the fallthrough code path to preserve %zmm0 - %zmm7 registers speculatively, even though only %xmm0 - %xmm7 registers are used. This leads to lower CPU frequency on Skylake server. This patch changes the fallthrough code path to preserve %xmm0 - %xmm7 registers instead: if whole %zmm0 - %zmm7 registers are used preserve %zmm0 - %zmm7 registers if only %ymm0 - %ymm7 registers are used preserve %ymm0 - %ymm7 registers preserve %xmm0 - %xmm7 registers Tested on Skylake server. [BZ #21258] * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve_opt): Define only if _dl_runtime_resolve is defined to _dl_runtime_resolve_sse_vex. * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_opt): Fallthrough to _dl_runtime_resolve_sse_vex.
* Regenerate INSTALL.Joseph Myers2017-03-212-0/+10
|
* Merge branch 'master' of ssh://sourceware.org/git/glibcThorsten Kukuk2017-03-212-1/+6
|\ | | | | | | | | Conflicts: ChangeLog
| * Fix failing test malloc/tst-interpose-nothread with GCC 7.Stefan Liebler2017-03-212-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test malloc/tst-interpose-nothread fails on s390x if built with GCC 7 and glibc commit "Remove the str(n)dup inlines from string/bits/string2.h. Although inlining" (ae65d4f3c3995279ca458c460ebf8bab1885fa03) with output: error: free: 0x3fffdffa010: invalid allocation index: 0 (not less than 0) The destructor check_for_allocations in malloc/tst-interpose-aux.c is called twice. One time after the test-child-process has finished successfully and once after the test-parent-process finishes. During the latter invocation, allocation_index == 0. GCC 7 is now inlining the free function and calls unconditionally fail in get_header as header->allocation_index (type == size_t) is always >= allocation_index (= 0). Before the mentioned commit above, strdup was replaced by strlen, malloc and memcpy. The malloc call was also inlined and allocation_index was set to one. This patch moves the already existing compiler barrier before the invocation of free. ChangeLog: * malloc/tst-interpose-aux.c (check_for_allocations): Move compiler barrier before free.
* | Deprecate libnsl by default (only shared library will beThorsten Kukuk2017-03-2148-81/+300
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build for backward compatibility, no linking possible) and disable building of libnss_compat, libnss_nis and libnss_nisplus, except --enable-obsolete-nsl option is given to configure. * config.h.in: Add LINK_OBSOLETE_NSL. * config.make.in: Add build-obsolete-nsl. * configure.ac: Add obsolete-nsl option. * include/libc-symbols.h: Define libnsl_hidden_nolink_def. * include/rpcsvc/yp.h: Add missing functions as libnsl_hidden_proto. * include/rpcsvc/nislib.h: Likewise. * include/rpcsvc/ypclnt.h: Likewise. * manual/install.texi: Document --enable-obsolete-nsl. * nis/Makefile: Build only libnsl by default (add build-obsolete-nsl). * nis/nis_add.c: Replace libnsl_hidden_def with libnsl_hidden_nolink_def. * nis/nis_addmember.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_clone_obj.c: Likewise. * nis/nis_defaults.c: Likeise. * nis/nis_domain_of_r.c: Likewise. * nis/nis_error.c: Likewise. * nis/nis_file.c: Likewise. * nis/nis_free.c: Likewise. * nis_local_names.c: Likewise. * nis/nis_lookup.c: Likewise. * nis/nis_modify.c: Likewise. * nis/nis_print.c: Likewise. * nis/nis_remove.c: Likewise. * nis/nis_table.c: Likewise. * nis/nis_util.c: Likewise. * nis/nis_xdr.c: Likewise. * nis/yp_xdr.c: Likewise. * nis/ypclnt.c: Likewise. * nis/ypupdate_xdr.c: Likewise. * nis/nis_checkpoint.c: Add libnsl_hidden_nolink_def to all functions. * nis/nis_clone_dir.c: Likewise. * nis/nis_clone_res.c: Likewise. * nis/nis_creategroup.c: Likewise. * nis/nis_destroygroup.c: Likewise. * nis/nis_domain_of.c: Likewise. * nis/nis_getservlist.c: Likewise. * nis/nis_ismember.c: Likewise. * nis/nis_mkdir.c: Likewise. * nis/nis_ping.c: Likewise. * nis/nis_print_group_entry.c: Likewise. * nis/nis_removemember.c: Likewise. * nis/nis_rmdir.c: Likewise. * nis/nis_server.c: Likewise. * nis/nis_subr.c: Likewise. * nis/nis_verifygroup.c: Likewise. Signed-off-by: Thorsten Kukuk <kukuk@suse.com>
* conformtest: Add x32 XFAILs for mq_attr element types (bug 21279).Joseph Myers2017-03-203-5/+15
| | | | | | | | | | | | | | | | | | POSIX specifies long as the type of elements of struct mq_attr. For x32, they are __syscall_slong_t (i.e. long long). This patch XFAILs the corresponding tests for x32 in the conformtest expectations (the bug should not be closed without an actual fix). Tested with build-many-glibcs.py. [BZ #21279] * sysdeps/unix/sysv/linux/x86_64/x32/Makefile [$(subdir) = conform] (conformtest-xfail-conds): Update comment. * conform/data/mqueue.h-data (mq_attr.mq_flags): XFAIL for x86_64-x32-linux. (mq_attr.mq_maxmsg): Likewise. (mq_attr.mq_msgsize): Likewise. (mq_attr.mq_curmsgs): Likewise.
* conformtest: Add mips XFAIL for struct stat st_rdev type (bug 21278).Joseph Myers2017-03-203-2/+9
| | | | | | | | | | | | | | MIPS o32 struct stat has the wrong type of st_rdev. This patch XFAILs that test in the conformtest expectations for this case (the bug should not be closed without an actual fix, however). Tested with build-many-glibcs.py. [BZ #21278] * sysdeps/unix/sysv/linux/mips/mips32/Makefile [$(subdir) = conform] (conformtest-xfail-conds): Update comment. * conform/data/sys/stat.h-data (stat.st_rdev): XFAIL for mips-o32-linux.
* Fix alpha termios.h NL2, NL3 namespace (bug 21268).Joseph Myers2017-03-202-2/+11
| | | | | | | | | | | | | | | sysdeps/unix/sysv/linux/alpha/bits/termios.h defines NL2 and NL3 for __USE_MISC || __USE_XOPEN. These should only be defined for __USE_MISC as they are not part of any standard namespace. This patch conditions them accordingly, matching the powerpc version of the header (the only other one in glibc that defines these macros). Tested (compilation only) with build-many-glibcs.py. [BZ #21268] * sysdeps/unix/sysv/linux/alpha/bits/termios.h (NL2): Define only if [__USE_MISC] (NL3): Likewise.
* posix_spawn: fix stack setup on ia64 [BZ #21275]Mike Frysinger2017-03-202-5/+14
| | | | | | | | | The ia64-specific clone2 call expects the base of the stack mapping and the stack size as sep arguments, not an initial stack value as on other stack-grows-down architectures. Reuse the stack-grows-up macro so we pass in the right stack base. Reported-by: Matt Turner <mattst88@gentoo.org>
* linux ttyname and ttyname_r: do not return wrong resultsChristian Brauner2017-03-194-8/+71
| | | | | | | | | | | | | If a link (say /proc/self/fd/0) pointing to a device, say /dev/pts/2, in a parent mount namespace is passed to ttyname, and a /dev/pts/2 exists (in a different devpts) in the current namespace, then it returns /dev/pts/2. But /dev/pts/2 is NOT the current tty, it is a different file and device. Detect this case and return ENODEV. Userspace can choose to take this as a hint that the fd points to a tty device but to act on the fd rather than the link. Signed-off-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* conformtest: XFAIL tv_nsec tests for x32 (bug 16437).Joseph Myers2017-03-186-4/+22
| | | | | | | | | | | | | | | | | This patch XFAILs the conformtest tv_nsec tests for x32 so that the incorrect type does not potentially hide other failures. As this is not a fix for the bug, it should remain open in Bugzilla. Tested (compilation only) with build-many-glibcs.py. [BZ #16437] * sysdeps/unix/sysv/linux/x86_64/x32/Makefile [$(subdir) = conform] (conformtest-xfail-conds): New variable. * conform/data/signal.h-data (timespec.tv_nsec): XFAIL for x86_64-x32-linux. * conform/data/sys/select.h-data (timespec.tv_nsec): Likewise. * conform/data/sys/stat.h-data (timespec.tv_nsec): Likewise. * conform/data/time.h-data (timespec.tv_nsec): Likewise.
* Fix sparc64 bits/setjmp.h namespace (bug 21261).Joseph Myers2017-03-183-21/+30
| | | | | | | | | | | | | | | | | | sysdeps/unix/sysv/linux/sparc/bits/setjmp.h defines 64-bit __jmp_buf with a load of identifiers that are not part of any standard namespace, resulting in conform/ tests failing. This patch fixes this by moving those identifiers to the implementation namespace, so enabling the conform/ tests to pass for sparc64. Tested (compilation only) for sparc64 with build-many-glibcs.py. [BZ #21261] * sysdeps/unix/sysv/linux/sparc/bits/setjmp.h [__WORDSIZE == 64 && !_ASM] (__sparc64_jmp_buf): Use reserved names for all fields. * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS): Update for jmp_buf field renaming. (_JMPBUF_UNWINDS_ADJ): Likewise.
* conformtest: Handle conditional XFAILs with allow-header.Joseph Myers2017-03-182-1/+6
| | | | | | | | | | | This patch fixes the conformtest handling of headers listed in allow-header to process xfail[cond]- in the expectations for those headers. Tested with build-many-glibcs.py. * conform/conformtest.pl: Handle xfail[cond]- in header mentioned with allow-header.
* Further harden glibc malloc metadata against 1-byte overflows.DJ Delorie2017-03-172-0/+7
| | | | | | | | | Additional check for chunk_size == next->prev->chunk_size in unlink() 2017-03-17 Chris Evans <scarybeasts@gmail.com> * malloc/malloc.c (unlink): Add consistency check between size and next->prev->size, to further harden against 1-byte overflows.
* Use CPU_FEATURES_CPU_P to check if AVX is availableH.J. Lu2017-03-172-2/+6
| | | | | | | Don't use bit_cpu_AVX directly. * sysdeps/x86/cpu-features.c (init_cpu_features): Check AVX with CPU_FEATURES_CPU_P.
* Make alpha termios.h define IXANY unconditionally (bug 21259).Joseph Myers2017-03-172-1/+5
| | | | | | | | | | | | | | | | | sysdeps/unix/sysv/linux/alpha/bits/termios.h defines IXANY only if __USE_MISC. But it's in the base standard for POSIX.1:2008, and XSI-shaded in previous standards. This patch makes the header define it unconditionally, like other versions of this header do (it's always reserved by standards that don't require it, so defining unconditionally is OK by the standards). Tested (compilation only) for alpha with build-many-glibcs.py. Note that there are still termios.h conformtest failures after this patch because of other issues with the alpha version of this header. [BZ #21259] * sysdeps/unix/sysv/linux/alpha/bits/termios.h (IXANY): Define unconditionally, not just for [__USE_MISC].