about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Remove NO_CTORS_DTORS_SECTIONS macroFlorian Weimer2020-05-1810-158/+3
| | | | | | | | | | | This was originally added to support binutils older than version 2.22: <https://sourceware.org/ml/libc-alpha/2010-12/msg00051.html> Since 2.22 is older than the minimum required binutils version for building glibc, we no longer need this. (The changes do not impact the statically linked startup code.)
* elf: Assert that objects are relocated before their constructors runFlorian Weimer2020-05-181-0/+6
| | | | | | | | | If we try to run constructors before relocation, this is always a dynamic linker bug. An assert is easier to notice than a call via an invalid function pointer (which may not even produce a valid call stack). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* powerpc: Optimized stpcpy for POWER9Anton Blanchard via Libc-alpha2020-05-186-21/+123
| | | | | | | | | | Add stpcpy support to the POWER9 strcpy. This is up to 40% faster on small strings and up to 90% faster on long relatively unaligned strings, compared to the POWER8 version. A few examples: __stpcpy_power9 __stpcpy_power8 Length 20, alignments in bytes 4/ 4: 2.58246 4.8788 Length 1024, alignments in bytes 1/ 6: 24.8186 47.8528
* powerpc: Optimized strcpy for POWER9Anton Blanchard via Libc-alpha2020-05-185-1/+182
| | | | | | | | | | This version uses VSX store vector with length instructions and is significantly faster on small strings and relatively unaligned large strings, compared to the POWER8 version. A few examples: __strcpy_power9 __strcpy_power8 Length 16, alignments in bytes 0/ 0: 2.52454 4.62695 Length 412, alignments in bytes 4/ 0: 11.6 22.9185
* x86: Move CET control to _dl_x86_feature_control [BZ #25887]H.J. Lu2020-05-189-68/+81
| | | | | | | | | | 1. Include <dl-procruntime.c> to get architecture specific initializer in rtld_global. 2. Change _dl_x86_feature_1[2] to _dl_x86_feature_1. 3. Add _dl_x86_feature_control after _dl_x86_feature_1, which is a struct of 2 bitfields for IBT and SHSTK control This fixes [BZ #25887].
* sunrpc/tst-udp-*: Fix timeout valueSamuel Thibault2020-05-162-9/+9
| | | | | | | | | | | Following on 00c3da43a ('sunrpc/tst-udp-timeout: Fix timeout value'). While e.g. 2.5 timeout can be represented exactly with doubles, time stamps may not be represented that exactly, and thus with coarse-grain clocks (e.g. 10ms) we may end up with 2.499-ish values due to rounding errors. * sunrpc/tst-udp-timeout.c (test_udp_server): Add more timeout slack. * sunrpc/tst-udp-nonblocking.c (do_test): Likewise.
* Linux: Remove remnants of the getcpu cacheFlorian Weimer2020-05-166-40/+1
| | | | | | The getcpu cache was removed from the kernel in Linux 2.6.24. glibc support from the sched_getcpu implementation was removed in commit dd26c44403582fdf10d663170f947dfe4b3207a0 ("Consolidate sched_getcpu").
* Update timezone code from tzcode 2020aPaul Eggert2020-05-156-327/+554
| | | | | | | | | | | This patch updates files coming from tzcode to tzcode 2020a. This is mostly for better support for Internet RFC 8536, by adding support to zic for the Expires line (new to tzcode 2020a), the -b option (new to 2019b) and the -r option (new to 2019a). One trivial change to other glibc was needed. * time/tzfile.c (__tzfile_read): Adjust to tzcode private.h renaming. * timezone/private.h, timezone/tzfile.h, timezone/version: * timezone/zdump.c, timezone/zic.c: Update from tzcode 2020a.
* aarch64: fix strcpy and strnlen for big-endian [BZ #25824]Lexi Shao2020-05-152-0/+10
| | | | | | | | | | | | | | | | | | | This patch fixes the optimized implementation of strcpy and strnlen on a big-endian arm64 machine. The optimized method uses neon, which can process 128bit with one instruction. On a big-endian machine, the bit order should be reversed for the whole 128-bits double word. But with instuction rev64 datav.16b, datav.16b it reverses 64bits in the two halves rather than reversing 128bits. There is no such instruction as rev128 to reverse the 128bits, but we can fix this by loading the data registers accordingly. Fixes 0237b61526e7("aarch64: Optimized implementation of strcpy") and 2911cb68ed3d("aarch64: Optimized implementation of strnlen"). Signed-off-by: Lexi Shao <shaolexi@huawei.com> Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* locale: Add transliteration for Geresh, Gershayim (U+05F3, U+05F4)Florian Weimer2020-05-151-0/+2
| | | | | | | ISO-8859-8-based locales will need this transliteration if the locale files contain these Unicode characters. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Fix string/tst-memmove-overflow to compile with GCC 7Florian Weimer2020-05-141-2/+2
| | | | | | | | | | GCC 8 relaxed what kind of expressions can be used in initializers, and the previous use of static const variables relied on that. Switch to wide (non-int) enum constants instead, which is another GCC extension that is more widely implemented. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Add arch-syscall.h dependency for generating sysd-syscalls fileguojinhui2020-05-141-0/+1
| | | | | | | | | | | | After using "make update-syscall-lists" to update arch-syscall.h for new kernel versions, sysd-syscalls will not be not be regenerated. This will cause a compile error because the new data is not being picked up. Fixes commit a1bd5f86739926469bbe0054b93305ff5905b070 ("Linux: Use system call tables during build"). Reviewed-by: Florian Weimer <fweimer@redhat.com>
* arm: XFAIL string/tst-memmove-overflow due to bug 25620Florian Weimer2020-05-132-2/+26
| | | | | | | Also reduce the amount of output in case of a large-scale mismatch in the copied data. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* elf: Remove redundant add_to_global_resize_failure call from dl_open_argsFlorian Weimer2020-05-121-5/+0
| | | | | | | | | | The second call does not do anything because the data structures have already been resized by the call that comes before the demarcation point. Fixes commit a509eb117fac1d764b15eba64993f4bdb63d7f3c ("Avoid late dlopen failure due to scope, TLS slotinfo updates [BZ #25112]"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* string: Add string/tst-memmove-overflow, a test case for bug 25620Florian Weimer2020-05-122-1/+156
| | | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* support: Add support_blob_repeat_allocate_sharedFlorian Weimer2020-05-123-20/+68
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: wait for pending setxid request also in detached thread (bug 25942)Andreas Schwab2020-05-121-5/+6
| | | | | | | | | | | | | There is a race between __nptl_setxid and exiting detached thread, which causes a deadlock on stack_cache_lock. The deadlock happens in this state: T1: setgroups -> __nptl_setxid (holding stack_cache_lock, waiting on cmdp->cntr == 0) T2 (detached, exiting): start_thread -> __deallocate_stack (waiting on stack_cache_lock) more threads waiting on stack_cache_lock in pthread_create For non-detached threads, start_thread waits for its own setxid handler to finish before exiting. Do this for detached threads as well.
* aarch64: Accept PLT calls to __getauxval within libc.soFlorian Weimer2020-05-121-0/+3
| | | | | | | | When using outline atomics (-moutline-atomics, the default for ARMv8-A starting with GCC 10), libgcc contains an ELF constructor which calls __getauxval. This code is built outside of glibc, so none of its internal PLT avoidance schemes can be applied to it. This change suppresses the elf/check-localplt failure.
* Use unsigned constants for ICMP6 filters [BZ #22489]Sergey2020-05-111-4/+4
| | | | | | | | The core problem here is that the filter array elements are unsigned but the computed constants are signed. This both causes a signededness conversion at the &= step and may cause undefined behavior if the MSB is being modified. This patch uses unsigned constants to avoid both cases. - DJ
* Linux: Enhance glibcsyscalls.py to support listing system callsFlorian Weimer2020-05-111-1/+83
| | | | | | | | | | | | | | | | | | | | | The script can now be called to query the definition status of system call numbers across all architectures, like this: $ python3 sysdeps/unix/sysv/linux/glibcsyscalls.py query-syscall sync_file_range sync_file_range2 sync_file_range: defined: aarch64 alpha csky hppa i386 ia64 m68k microblaze mips/mips32 mips/mips64/n32 mips/mips64/n64 nios2 riscv/rv64 s390/s390-32 s390/s390-64 sh sparc/sparc32 sparc/sparc64 x86_64/64 x86_64/x32 undefined: arm powerpc/powerpc32 powerpc/powerpc64 sync_file_range2: defined: arm powerpc/powerpc32 powerpc/powerpc64 undefined: aarch64 alpha csky hppa i386 ia64 m68k microblaze mips/mips32 mips/mips64/n32 mips/mips64/n64 nios2 riscv/rv64 s390/s390-32 s390/s390-64 sh sparc/sparc32 sparc/sparc64 x86_64/64 x86_64/x32 This command lists the headers containing the system call numbers: $ python3 sysdeps/unix/sysv/linux/glibcsyscalls.py list-headers The argument parser code is based on a suggestion from Adhemerval Zanella. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Suppress GCC 10 true positive warnings [BZ #25967]Martin Sebor2020-05-112-3/+30
| | | | | | | | | Suppress or avoid warnings in tests that exercise failure modes by making calls with invalid arguments. Reviewed-by: DJ Delorie <dj@redhat.com> Reviewed-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: Joseph Myers <joseph@codesourcery.com>
* POWER: Add context-synchronizing instructions to pkey_write [BZ #25954]Florian Weimer2020-05-111-1/+1
| | | | | | | | | | | | | | | | | | | Sandipan Das reported that, "The Power ISA mandates that all writes to the Authority Mask Register (AMR) must always be preceded as well as succeeded by a context-synchronizing instruction. This applies to both the privileged and unprivileged variants of the Move To AMR instruction. This [requirement] is from Table 6 of Chapter 11 in page 1134 of Power ISA 3.0B. The document can be found here: <https://ibm.ent.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv> " See this kernel patch submission: <https://lore.kernel.org/linuxppc-dev/5f65cf37be993760de8112a88da194e3ccbb2bf8.1588959697.git.sandipan@linux.ibm.com/>
* hurd: Add missing sigstate members initializationSamuel Thibault2020-05-111-1/+5
| | | | | * hurd/hurdsig.c (_hurd_thread_sigstate): Initialize critical_section_lock, active_resources, cancel, and cancel_hook fields.
* x86-64: Use RDX_LP on __x86_shared_non_temporal_threshold [BZ #25966]H.J. Lu2020-05-091-3/+3
| | | | | | | | | Since __x86_shared_non_temporal_threshold is defined as long int __x86_shared_non_temporal_threshold; and long int is 4 bytes for x32, use RDX_LP to compare against __x86_shared_non_temporal_threshold in assembly code.
* linux: Remove assembly umount2 implementationAdhemerval Zanella2020-05-085-20/+63
| | | | | | | | | | Only alpha and ia64 do not support __NR_umount2 (defined as __NR_umount), but recent kernel fixes (74cd2184833f for ia64, and 12b57c5c70f39 for alpha) add the required alias. Checked with a build against all affected ABIs. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* signal: Use <sigsetops.h> for sigemptyset, sigfillsetFlorian Weimer2020-05-082-7/+4
| | | | | This avoids changing the entire sigset_t structure. Updating the actually used part is sufficient.
* ckb_IQ, or_IN locales: Add missing reorder-end keywordsFlorian Weimer2020-05-082-0/+4
| | | | | | This suppresses a non-fatal error during locale building. Reviewed-by: Rafał Lużyński <digitalfreak@lingonborough.com>
* semaphore: consolidate arch headers into a generic oneVineet Gupta2020-05-0613-422/+2
| | | | | | | | | | | | | | | | | | This consolidates the copy-pasted arch specific semaphore header into single version (based on s390) which suffices 32-bit and and 64-bit arch/ABI based on the canonical WORDSIZE. For now I've left out arches which use alternate defines to choose for 32 vs 64-bit builds (aarch64, mips) which in theory can also use the same header. Passes build-many for aarch64-linux-gnu arm-linux-gnueabi arm-linux-gnueabihf riscv64-linux-gnu-rv64imac-lp64 riscv64-linux-gnu-rv64imafdc-lp64 x86_64-linux-gnu microblaze-linux-gnu nios2-linux-gnu Suggested-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use GCC 10 branch in build-many-glibcs.py.Joseph Myers2020-05-061-1/+1
| | | | | | | This updates the default GCC version used in build-many-glibcs.py when no version is specified explicitly. I'm replacing my bot using GCC 8 with one using GCC 10 (leaving the GCC 9 and GCC mainline bots running as at present).
* Document the internal _ and N_ macrosFlorian Weimer2020-05-061-8/+24
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Provide conversion helpers for struct __timex64Lukasz Majewski2020-05-051-0/+61
| | | | | | | | | | | | | | | Those functions allow easy conversion between Y2038 safe, glibc internal struct __timex64 and struct timex. Those functions are put in Linux specific sys/timex.h file, as putting them into glibc's local include/time.h would cause build break on HURD as it doesn't support struct timex related syscalls. Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: Introduce struct __timex64 - new internal glibc typeLukasz Majewski2020-05-051-0/+46
| | | | | | | | | | | | | | | | | | | The introduced glibc's 'internal' struct __timex64 is a copy of Linux kernel's struct __kernel_timex (v5.6) introduced for properly handling data for clock_adjtime64 syscall. As the struct's __kernel_timex size is the same as for archs with __WORDSIZE == 64, proper padding and data types conversion (i.e. long to long long) had to be added for architectures with __WORDSIZE == 32 && __TIMESIZE != 64. Moreover, it stores time in struct __timeval64 rather than struct timeval, which makes it Y2038-proof. Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: include: Move struct __timeval64 definition to a separate fileLukasz Majewski2020-05-052-14/+18
| | | | | | | | | | | | | | | The struct __timeval64's definition has been moved from ./include/time.h to ./include/struct___timeval64.h. This change would prevent from polluting other glibc namespaces (when headers are modified to support 64 bit time on architectures with __WORDSIZE==32). Now it is possible to just include definition of this particular structure when needed. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: nscd: Modify nscd_helper to use __clock_gettime64Lukasz Majewski2020-05-051-8/+9
| | | | | | | The nscd/nscd_helper.c uses __clock_gettime to get current time and on this basis calculate the relative timeout for poll. By using __clock_gettime64 on systems with __WORDSIZE == 32 && __TIMESIZE != 64 the timeout is correctly calculated after time_t overflow.
* y2038: inet: Convert inet deadline to support 64 bit timeLukasz Majewski2020-05-052-4/+5
| | | | | | | | | | | | | | | This change brings 64 bit time support to inet deadline related code for architectures with __WORDSIZE == 32 && __TIMESIZE != 64. It is also safe to replace struct timespec with struct __timespec64 in deadline related structures as: - The __deadline_to_ms () returns the number of miliseconds to deadline to be used with __poll (and hence it is a relative value). - To calculate the deadline from timeval (which will be converted latter) the uintmax_t type is used (unsinged long long int). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: hurd: Provide __clock_gettime64 functionLukasz Majewski2020-05-051-0/+14
| | | | | | | | | | | For Linux glibc ports the __TIMESIZE == 64 ensures proper aliasing for __clock_gettime64 (to __clock_gettime). When __TIMESIZE != 64 (like ARM32, PPC) the glibc expects separate definition of the __clock_gettime64. The HURD port only provides __clock_gettime, so this patch adds __clock_gettime64 as a tiny wrapper on it. Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* y2038: Export __clock_gettime64 to be usable in other librariesLukasz Majewski2020-05-051-0/+1
| | | | | | | In the glibc project calls to clock_gettime shall be replaced with __clock_gettime64, which is supporting 64 bit time. To allow that the __clock_gettime64 needs to be exported as a GLIBC_PRIVATE symbol.
* manual: Document the O_NOFOLLOW open flagFlorian Weimer2020-05-051-0/+7
|
* powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905]Paul E. Murphy2020-05-041-0/+2
| | | | | | | | | | | | | | | | strcmp is used while resolving PLT references. Vector registers should not be used during this. The P9 strcmp makes heavy use of vector registers, so it should be avoided in rtld. This prevents quiet vector register corruption when glibc is configured with --disable-multi-arch and --with-cpu=power9. This can be seen with test-float64x-compat_totalordermag during the first call into totalordermagf64x@GLIBC_2.27. Add a guard to fallback to the power8 implementation when building power9 strcmp for libraries other than libc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* float128: use builtin_signbitf128 alwaysPaul E. Murphy2020-05-042-19/+1
| | | | | | | | | The minimum GCC version has been raised to 6.2 for building glibc. Therefore, follow the advice inside the implementation and remove the GCC < 6 codepath. Likewise, remove the hidden_proto as all internal usages should inline now.
* improve out-of-bounds checking with GCC 10 attribute access [BZ #25219]Martin Sebor2020-05-049-82/+146
| | | | | | | | Adds the access attribute newly introduced in GCC 10 to the subset of function declarations that are already covered by _FORTIFY_SOURCE and that don't have corresponding GCC built-in equivalents. Reviewed-by: DJ Delorie <dj@redhat.com>
* nios2: delete sysdeps/unix/sysv/linux/nios2/kernel-features.hChung-Lin Tang2020-05-041-22/+0
| | | | | | Commit 06436acf819d9e6ada7be3ca977d5c0a23d3f138 created a kernel-features.h file with '#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64', which is wrong for Nios II. Deleting the header.
* powerpc: Rename argN to _argN in LOADARGS_N [BZ #25902]H.J. Lu2020-04-301-12/+12
| | | | | | LOADARGS_N in powerpc/sysdep.h uses argN as local variables. It breaks when argN is also a function argument. Rename argN to _argN to avoid conflict.
* locale/tst-localedef-path-norm: Don't create $(complocaledir)Carlos O'Donell2020-04-301-22/+19
| | | | | | | | | We automatically create $(complocaledir) in the testroot.root now and so we don't need to create it in the test. Tested on x86_64. Reviewed-by: DJ Delorie <dj@redhat.com>
* support: Set errno before testing it.Carlos O'Donell2020-04-302-1/+5
| | | | | | | | | | | | In test-conainer we should set errno to 0 before calling strtol, and check after with TEST_COMPARE. In tst-support_capture_subprocess we should set errno to 0 before checking it after the call to strtol. Tested on x86_64. Reviewed-by: DJ Delorie <dj@redhat.com>
* localedef: Add tests-container test for --no-hard-links.Carlos O'Donell2020-04-306-0/+154
| | | | | | | | | | | | | | | The new tst-localedef-hardlinks verifies that when compiling two locales (with default output directory) one with --no-hard-links and one without the option, results in the expected behaviour. When --no-hard-links is used the link counts on LC_CTYPE is 1, indicating that even thoug the two locale are identical (though different named source files and output direcotry) the localedef did not carry out the hard link optimization. Then when --no-hard-links is omitted the localedef hard link optimization is correctly carried out and for 2 compiled locales the link count for LC_CTYPE is 2. Reviewed-by: DJ Delorie <dj@redhat.com>
* test-container: Support $(complocaledir) and mkdirp.Carlos O'Donell2020-04-302-3/+42
| | | | | | | | | | | | | | | | | | | | | | | Expand the support infrastructure: - Create $(complocaledir) in the testroot.pristine to support localedef. - Add the variable $complocaledir to script support. - Add the script command 'mkdirp'. All localedef tests which run with default paths need to have the $(complocaledir) created in testroot.pristine. The localedef binary will not by itself create the default path, but it will write into the path. By adding this we can simplify the localedef tests. The variable $complocaledir is the value of the configured $(complocaledir) which is the location of the compiled locales that will be searched by the runtime by default. The command mkdirp will be available in script setup and will be equivalent to running `mkdir -p`. The variable and command can be used to write more complex tests. Reviewed-by: DJ Delorie <dj@redhat.com>
* i386: Remove unused variable in sysdeps/x86/cacheinfo.cFlorian Weimer2020-04-301-1/+1
| | | | | | | | | | | | Commit a98dc92dd1e278df4c501deb07985018bc2b06de ("x86: Add cache information support for Zhaoxin processors") introduced an unused variable warning in the default i686-linux-gnu build: In file included from ../sysdeps/i386/cacheinfo.c:3: ../sysdeps/x86/cacheinfo.c: In function 'init_cacheinfo': ../sysdeps/x86/cacheinfo.c:762:16: error: unused variable 'eax' [-Werror=unused-variable] 762 | unsigned int eax; | ^~~
* Add a C wrapper for prctl [BZ #25896]H.J. Lu2020-04-304-2/+44
| | | | | | | | | | | | Add a C wrapper to pass arguments in /* Control process execution. */ extern int prctl (int __option, ...) __THROW; to prctl syscall: extern int prctl (int, unsigned long int, unsigned long int, unsigned long int, unsigned long int);
* powerpc64le: Enable support for IEEE long doubleGabriel F. T. Gomes2020-04-307-0/+232
| | | | | | | | | | | | | | On platforms where long double may have two different formats, i.e.: the same format as double (64-bits) or something else (128-bits), building with -mlong-double-128 is the default and function calls in the user program match the name of the function in Glibc. When building with -mlong-double-64, Glibc installed headers redirect such calls to the appropriate function. Likewise, the internals of glibc are now built against IEEE long double. However, the only (minimally) notable usage of long double is difftime. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>