aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
2024-08-07sparc: Regenerate ULPsAdhemerval Zanella1-31/+31
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
2024-08-07i386: Regenerate ULPsAdhemerval Zanella2-73/+73
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
2024-08-07arm: Regenerate ULPsAdhemerval Zanella1-20/+20
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
2024-08-07aarch64: Regenerate ULPsAdhemerval Zanella1-32/+32
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
2024-08-07sysdeps: Re-flow and sort multiline gnu/Makefile definitionsAdhemerval Zanella1-12/+42
2024-08-07AArch64: Improve generic strlenWilco Dijkstra1-12/+27
Improve performance by handling another 16 bytes before entering the loop. Use ADDHN in the loop to avoid SHRN+FMOV when it terminates. Change final size computation to avoid increasing latency. On Neoverse V1 performance of the random strlen benchmark improves by 4.6%. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-08-07added inputs giving large errors on x86_64 for new C23 functionsPaul Zimmermann1-43/+43
These functions are exp10m1, exp2m1, log10p1, log2p1. Also regenerated ulps on x86_64. For each format, there are 4 values, one for each rounding mode. (For the intel96 format, there are 8 values, 4 for Intel hardware, and 4 for AMD hardware. However, regen-ulps was only run on Intel. It should be run in a separate patch on a AMD x86_64.) Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-08-06LoongArch: Update Ulps.caiyinyu1-4/+4
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61. Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
2024-08-05elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717)Florian Weimer1-7/+1
The old code used l_init_called as an indicator for whether TLS initialization was complete. However, it is possible that TLS for an object is initialized, written to, and then dlopen for this object is called again, and l_init_called is not true at this point. Previously, this resulted in TLS being initialized twice, discarding any interim writes (technically introducing a use-after-free bug even). This commit introduces an explicit per-object flag, l_tls_in_slotinfo. It indicates whether _dl_add_to_slotinfo has been called for this object. This flag is used to avoid double-initialization of TLS. In update_tls_slotinfo, the first_static_tls micro-optimization is removed because preserving the initalization flag for subsequent use by the second loop for static TLS is a bit complicated, and another per-object flag does not seem to be worth it. Furthermore, the l_init_called flag is dropped from the second loop (for static TLS initialization) because l_need_tls_init on its own prevents double-initialization. The remaining l_init_called usage in resize_scopes and update_scopes is just an optimization due to the use of scope_has_map, so it is not changed in this commit. The isupper check ensures that libc.so.6 is TLS is not reverted. Such a revert happens if l_need_tls_init is not cleared in _dl_allocate_tls_init for the main_thread case, now that l_init_called is not checked anymore in update_tls_slotinfo in elf/dl-open.c. Reported-by: Jonathon Anderson <janderson@rice.edu> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-08-05elf: Clarify and invert second argument of _dl_allocate_tls_initFlorian Weimer1-3/+1
Also remove an outdated comment: _dl_allocate_tls_init is called as part of pthread_create. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-08-02x86: Tunables may incorrectly set Prefer_PMINUB_for_stringop (bug 32047)Florian Weimer1-0/+1
Fixes commit 5bcf6265f215326d14dfacdce8532792c2c7f8f8 ("x86: Disable non-temporal memset on Skylake Server"). Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-08-02x86: Add missing switch/case fall-through markers to init_cpu_featuresFlorian Weimer1-0/+2
The commits introducing these fall-throughs intended them to happen. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-08-01hurd: Fix missing pthread_ compat symbol in libcSamuel Thibault11-10/+70
5476f8cd2e68 ("htl: move pthread_self info libc.") and 9dfa2562162b ("htl: move pthread_equal into libc") to 1dc0bc8f0748 ("htl: move pthread_attr_setdetachstate into libc") moved some pthread_ symbols from libpthread.so to libc.so, but missed adding the compat version like 5476f8cd2e68 ("htl: move pthread_self info libc.") did: libc already had these symbols as forwards, but versioned GLIBC_2.21, while the symbols in libpthread.so were versioned GLIBC_2.12. To fix running executables built before this, we thus have to add the GLIBC_2.12 version, otherwise execution fails with e.g. /usr/lib/i386-gnu/libglib-2.0.so: symbol lookup error: /usr/lib/i386-gnu/libglib-2.0.so: undefined symbol: pthread_attr_setinheritsched, version GLIBC_2.12
2024-08-01Add mremap testsH.J. Lu4-0/+119
Add tests for MREMAP_MAYMOVE and MREMAP_FIXED. On Linux, also test MREMAP_DONTUNMAP. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-08-01linux: Update the mremap C implementation [BZ #31968]H.J. Lu1-1/+13
Update the mremap C implementation to support the optional argument for MREMAP_DONTUNMAP added in Linux 5.7 since it may not always be correct to implement a variadic function as a non-variadic function on all Linux targets. Return MAP_FAILED and set errno to EINVAL for unknown flag bits. This fixes BZ #31968. Note: A test must be added when a new flag bit is introduced. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-07-30Add F_DUPFD_QUERY from Linux 6.10 to bits/fcntl-linux.hAdhemerval Zanella1-0/+1
It was added by commit c62b758bae6af16 as a way for userspace to check if two file descriptors refer to the same struct file. Checked on aarch64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-07-30Update kernel version to 6.10 in header constant testsAdhemerval Zanella3-4/+4
This patch updates the kernel version in the tests tst-mman-consts.py, tst-mount-consts.py, and tst-pidfd-consts.py to 6.9. There are no new constants covered by these tests in 6.10. Tested with build-many-glibcs.py. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-07-30Update syscall lists for Linux 6.10Adhemerval Zanella27-3/+32
Linux 6.10 changes for syscall are: * mseal for all architectures. * map_shadow_stack for x32. * Replace sync_file_range with sync_file_range2 for csky (which fixes a broken sync_file_range usage). Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-07-29Mitigation for "clone on sparc might fail with -EFAULT for no valid reason" ↵Michael Karcher2-0/+6
(bz 31394) It seems the kernel can not deal with uncommitted stack space in the area intended for the register window when executing the clone() system call. So create a nested frame (proxy for the kernel frame) and flush it from the processor to memory to force committing pages to the stack before invoking the system call. Bug: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg62592.html Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31394 See-also: https://lore.kernel.org/sparclinux/62f9be9d-a086-4134-9a9f-5df8822708af@mkarcher.dialup.fu-berlin.de/ Signed-off-by: Michael Karcher <sourceware-bugzilla@mkarcher.dialup.fu-berlin.de> Reviewed-by: DJ Delorie <dj@redhat.com>
2024-07-27MIPS: Regenerate ulpsJulian Zhu2-5/+5
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61. Signed-off-by: Julian Zhu <jz531210@gmail.com>
2024-07-26nptl: Use <support/check.h> facilities in tst-setuid3Maciej W. Rozycki1-21/+16
Remove local FAIL macro in favor to FAIL_EXIT1 from <support/check.h>, which provides equivalent reporting, with the name of the file and the line number within of the failure site additionally included. Remove FAIL_ERR altogether and include ": %m" explicitly with the format string supplied to FAIL_EXIT1 as there seems little value to have a separate macro just for this. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-07-25sparc: Regenerate ULPsAdhemerval Zanella1-3/+3
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.
2024-07-25i386: Regenerate ULPsAdhemerval Zanella2-4/+4
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.
2024-07-25arm: Regenerate ULPsAdhemerval Zanella1-2/+2
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.
2024-07-25aarch64: Regenerate ULPsAdhemerval Zanella1-4/+4
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.
2024-07-25powerpc: Regenerate ULPs for soft-fpAdhemerval Zanella1-5/+5
From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.
2024-07-25powerpc: Update ulps for fpujeevitha1-6/+6
Adjust the ULPs for the log2p1 implementation.
2024-07-25riscv: Update ulpsKhem Raj1-4/+4
Generated with make regen-ulps using gcc14 on a visionfive2 SBC. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-07-25s390x: Regenerate ULPs.Stefan Liebler1-4/+4
Needed due to: "This patch adds larger ulp errors for the log2p1 function." commit 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61
2024-07-25x32/cet: Support shadow stack during startup for Linux 6.10H.J. Lu3-3/+8
Use RXX_LP in RTLD_START_ENABLE_X86_FEATURES. Support shadow stack during startup for Linux 6.10: commit 2883f01ec37dd8668e7222dfdb5980c86fdfe277 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Mar 15 07:04:33 2024 -0700 x86/shstk: Enable shadow stacks for x32 1. Add shadow stack support to x32 signal. 2. Use the 64-bit map_shadow_stack syscall for x32. 3. Set up shadow stack for x32. Add the map_shadow_stack system call to <fixup-asm-unistd.h> and regenerate arch-syscall.h. Tested on Intel Tiger Lake with CET enabled x32. There are no regressions with CET enabled x86-64. There are no changes in CET enabled x86-64 _dl_start_user. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-07-25x86-64: Remove sysdeps/x86_64/x32/dl-machine.hH.J. Lu2-87/+16
Remove sysdeps/x86_64/x32/dl-machine.h by folding x32 ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT and RTLD_START into sysdeps/x86_64/dl-machine.h. There are no regressions on x86-64 nor x32. There are no changes in x86-64 _dl_start_user. On x32, _dl_start_user changes are <_dl_start_user>: mov %eax,%r12d + mov %esp,%r13d mov (%rsp),%edx mov %edx,%esi - mov %esp,%r13d and $0xfffffff0,%esp mov 0x0(%rip),%edi # <_dl_start_user+0x14> lea 0x8(%r13,%rdx,4),%ecx Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-07-24hppa: Update libm-test-ulpsJohn David Anglin1-7/+8
2024-07-22This patch adds larger ulp errors for the log2p1 function.Paul Zimmermann1-5/+5
Changes in v2: - added larger error for long double on AMD reported by Adhemerval (https://sourceware.org/pipermail/libc-alpha/2024-June/157755.html) Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-07-19linux: Trivial test output fix in tst-pkeyAndreas K. Hüttel1-1/+1
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-07-19linux: Also check pkey_get for ENOSYS on tst-pkey (BZ 31996)Adhemerval Zanella1-1/+7
The powerpc pkey_get/pkey_set support was only added for 64-bit [1], and tst-pkey only checks if the support was present with pkey_alloc (which does not fail on powerpc32, at least running a 64-bit kernel). Checked on powerpc-linux-gnu. [1] https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a803367bab167f5ec4fde1f0d0ec447707c29520 Reviewed-By: Andreas K. Huettel <dilfridge@gentoo.org>
2024-07-19powerpc: Update soft-fp ulpsAdhemerval Zanella1-0/+103
Results based on regen-ulps using gcc 11.2.1 on a POWER8 machine.
2024-07-19Fix usage of _STACK_GROWS_DOWN and _STACK_GROWS_UP defines [BZ 31989]John David Anglin1-1/+1
Signed-off-by: John David Anglin <dave.anglin@bell.net> Reviewed-By: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-07-19x32: xfail elf/tst-platform-1 [BZ #22363]H.J. Lu1-0/+6
Xfail elf/tst-platform-1 on x32 since kernel passes i686 in AT_PLATFORM. See https://sourceware.org/bugzilla/show_bug.cgi?id=22363 Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-07-17Revert "LoongArch: Add cfi instructions for _dl_tlsdesc_dynamic"Andreas K. Hüttel5-258/+373
We're in freeze for the 2.40 release. This reverts commit 43224b1379d60b1ad98d29ef3d7905d55f828a9f. Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-07-17htl: Fix __pthread_init_thread declaration and definitionSamuel Thibault2-2/+3
0e75c4a4634f ("hurd: Fix pthread_self() without libpthread") added a declaration for ___pthread_init_thread instead of __pthread_init_thread, and missed defining the external hidden symbol.
2024-07-17hurd: Fix pthread_self() without libpthreadSamuel Thibault3-11/+12
5476f8cd2e68 ("htl: move pthread_self info libc.") moved the htl pthread_self() function from libpthread to libc, replacing the previous libc stub that just returns 0. And 53da64d1cf36 ("htl: Initialize ___pthread_self early") added initialization code which is needed before being able to call pthread_self. It is currently in libpthread, and thus never called before programs can call pthread_self from libc, which then segfaults when accessing _pthread_self()->thread. This moves the initialization to libc itself, as initialized variables, so pthread_self can always be called fine.
2024-07-17LoongArch: Add cfi instructions for _dl_tlsdesc_dynamicmengqinggang5-373/+258
In _dl_tlsdesc_dynamic, there are three 'addi.d sp, sp, -size' instructions to allocate stack size for Float/LSX/LASX registers. Every 'addi.d sp, sp, -size' needs a cfi_adjust_cfa_offset because of sp is used to compute CFA. But only one 'addi.d sp, sp, -size' will be run according to HWCAP value. And all cfi_adjust_cfa_offset will be executed in stack unwinding, it result in incorrect CFA. Change _dl_tlsdesc_dynamic to _dl_tlsdesc_dynamic, _dl_tlsdesc_dynamic_lsx and _dl_tlsdesc_dynamic_lasx. Conflicting cfi instructions can be distributed to the three functions. And cfi instructions can correspond to stack down instructions.
2024-07-16x86: Disable non-temporal memset on Skylake ServerNoah Goldstein5-12/+26
The original commit enabling non-temporal memset on Skylake Server had erroneous benchmarks (actually done on ICX). Further benchmarks indicate non-temporal stores may in fact by a regression on Skylake Server. This commit may be over-cautious in some cases, but should avoid any regressions for 2.40. Tested using qemu on all x86_64 cpu arch supported by both qemu + GLIBC. Reviewed-by: DJ Delorie <dj@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-07-16Add pthread_getname_np and pthread_setname_np for HurdFlavio Cruz7-13/+226
We use thread_get_name and thread_set_name to get and set the thread name, so nothing is stored in the thread structure since these functions are supposed to be called sparingly. One notable difference with Linux is that the thread name is up to 32 chars, whereas Linux's is 16. Also added a mach_RPC_CHECK to check for the existing of gnumach RPCs.
2024-07-14math: Update alpha ulpsAndreas K. Hüttel1-0/+48
Linux alphadev 6.9.8-gentoo-alpha #1 Sun Jul 7 00:45:49 EDT 2024 alpha EV68CB Titan GNU/Linux gcc (Gentoo 14.1.1_p20240622 p2) 14.1.1 20240622 GNU ld (Gentoo 2.42 p6) 2.42.0 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-07-12tests: XFAIL audit tests failing on all mips configurations, bug 29404Andreas K. Hüttel1-0/+9
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-07-11s390x: Fix segfault in wcsncmp [BZ #31934]Stefan Liebler1-9/+1
The z13/vector-optimized wcsncmp implementation segfaults if n=1 and there is only one character (equal on both strings) before the page end. Then it loads and compares one character and misses to check n again. The following load fails. This patch removes the extra load and compare of the first character and just start with the loop which uses vector-load-to-block-boundary. This code-path also checks n. With this patch both tests are passing: - the simplified one mentioned in the bugzilla 31934 - the full one in Florian Weimer's patch: "manual: Document a GNU extension for strncmp/wcsncmp" (https://patchwork.sourceware.org/project/glibc/patch/874j9eml6y.fsf@oldenburg.str.redhat.com/): On s390x-linux-gnu (z16), the new wcsncmp test fails due to bug 31934. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-07-09Linux: Make __rseq_size useful for feature detection (bug 31965)Florian Weimer3-10/+31
The __rseq_size value is now the active area of struct rseq (so 20 initially), not the full struct size including padding at the end (32 initially). Update misc/tst-rseq to print some additional diagnostics. Reviewed-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2024-07-08math: Update m68k ULPsAndreas K. Hüttel1-90/+361
This hasn't been looked at for a loong time (already guessing from the number of missing entries), and it ain't pretty. There are some 9-ulps results for float. - ZaZaZebra (qemu-system-m68k clone of PowerBook 190 system) - GCC 13.3.1 20240614 (Gentoo 13.3.1_p20240614 p17) - ld GNU ld (Gentoo 2.42 p6) 2.42.0 - Linux ZaZaZebra 4.19.0-5-m68k #1 Gentoo 4.19.37-5 (2019-06-19) m68k 68040 68040 GNU/Linux - manual build - ../glibc/configure --enable-fortify-source --prefix=/usr - Tested by Immolo (via Andreas K. Hüttel) Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-07-04elf: Make dl-rseq-symbols Linux onlyAdhemerval Zanella2-0/+68
And avoid a Hurd build failures. Checked on x86_64-linux-gnu.