aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
2024-09-09AArch64: Optimize memsetWilco Dijkstra1-111/+84
Improve small memsets by avoiding branches and use overlapping stores. Use DC ZVA for copies over 128 bytes. Remove unnecessary code for ZVA sizes other than 64 and 128. Performance of random memset benchmark improves by 24% on Neoverse N1. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-09-09hppa: Update libm-test-ulpsJohn David Anglin1-21/+21
2024-09-09aarch64: Avoid redundant MOVs in AdvSIMD F32 logsJoe Ramsay3-45/+72
Since the last operation is destructive, the first argument to the FMA also has to be the first argument to the special-case in order to avoid unnecessary MOVs. Reorder arguments and adjust special-case bounds to facilitate this. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2024-09-06LoongArch: Fix macro redefined warning in tls-desc.Smengqinggang2-6/+15
Undef macro to avoid redefined warning.
2024-09-05i386: Update ulpsFlorian Weimer1-3/+3
As seen on an AMD Ryzen 9 7950X CPU when building with GCC 14 with SSE2 math.
2024-09-05powerpc64le: Build new strtod tests with long double ABI flags (bug 32145)Florian Weimer1-0/+4
This fixes several test failures: =====FAIL: stdlib/tst-strtod1i.out===== Locale tests all OK Locale tests all OK Locale tests strtold("1,5") returns -6,38643e+367 and not 1,5 strtold("1.5") returns 1,5 and not 1 strtold("1.500") returns 1 and not 1500 strtold("36.893.488.147.419.103.232") returns 1500 and not 3,68935e+19 Locale tests all OK =====FAIL: stdlib/tst-strtod3.out===== 0: got wrong results -2.5937e+4826, expected 0 =====FAIL: stdlib/tst-strtod4.out===== 0: got wrong results -6,38643e+367, expected 0 1: got wrong results 0, expected 1e+06 2: got wrong results 1e+06, expected 10 =====FAIL: stdlib/tst-strtod5i.out===== 0: got wrong results -6,38643e+367, expected 0 2: got wrong results 0, expected -0 4: got wrong results -0, expected 0 5: got wrong results 0, expected -0 6: got wrong results -0, expected 0 7: got wrong results 0, expected -0 8: got wrong results -0, expected 0 9: got wrong results 0, expected -0 10: got wrong results -0, expected 0 11: got wrong results 0, expected -0 12: got wrong results -0, expected 0 13: got wrong results 0, expected -0 14: got wrong results -0, expected 0 15: got wrong results 0, expected -0 16: got wrong results -0, expected 0 17: got wrong results 0, expected -0 18: got wrong results -0, expected 0 20: got wrong results 0, expected -0 22: got wrong results -0, expected 0 23: got wrong results 0, expected -0 24: got wrong results -0, expected 0 25: got wrong results 0, expected -0 26: got wrong results -0, expected 0 27: got wrong results 0, expected -0 Fixes commit 3fc063dee01da4f80920a14b7db637c8501d6fd4 ("Make __strtod_internal tests type-generic"). Suggested-by: Joseph Myers <josmyers@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-09-05Linux: readdir_r needs to report getdents failures (bug 32124)Florian Weimer1-1/+10
Upon error, return the errno value set by the __getdents call in __readdir_unlocked. Previously, kernel-reported errors were ignored. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-09-05i386: Update ulpsFlorian Weimer1-1/+1
As seen on an unspecified Intel system with glibc compiled with GCC 8.
2024-09-02linux: mips: Fix syscall_cancell build for __mips_isa_rev >= 6Adhemerval Zanella1-0/+4
Use beqzc instead of bnel. Checked with a mipsisa64r6el-n64-linux-gnu build and some nptl cancellation tests on qemu.
2024-08-30powerpc64: Fix syscall_cancel build for powerpc64le-linux-gnu [BZ #32125]Jeevitha Palanisamy1-1/+1
In __syscall_cancel_arch, there's a tail call to __syscall_do_cancel. On P10, since the caller uses the TOC and the callee is using PC-relative addressing, there's only a branch instruction with no NOPs to restore the TOC, which causes the build error. The fix involves adding the NOTOC directive to the branch instruction, informing the linker not to generate a TOC stub, thus resolving the issue.
2024-08-26x86: Enable non-temporal memset for Hygon processorsFeifei Wang2-3/+8
This patch uses 'Avoid_Non_Temporal_Memset' flag to access the non-temporal memset implementation for hygon processors. Test Results: hygon1 arch x86_memset_non_temporal_threshold = 8MB size new performance time / old performance time 1MB 0.994 4MB 0.996 8MB 0.670 16MB 0.343 32MB 0.355 hygon2 arch x86_memset_non_temporal_threshold = 8MB size new performance time / old performance time 1MB 1 4MB 1 8MB 1.312 16MB 0.822 32MB 0.830 hygon3 arch x86_memset_non_temporal_threshold = 8MB size new performance time / old performance time 1MB 1 4MB 0.990 8MB 0.737 16MB 0.390 32MB 0.401 For hygon arch with this patch, non-temporal stores can improve performance by 20% - 65%. Signed-off-by: Feifei Wang <wangfeifei@hygon.cn> Reviewed-by: Jing Li <lijing@hygon.cn> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-08-26x86: Add cache information support for Hygon processorsFeifei Wang1-0/+60
Add hygon branch in dl_init_cacheinfo function to initialize cache size variables for hygon processors. In the meanwhile, add handle_hygon() function to get cache information. Signed-off-by: Feifei Wang <wangfeifei@hygon.cn> Reviewed-by: Jing Li <lijing@hygon.cn> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-08-26x86: Add new architecture type for Hygon processorsFeifei Wang2-3/+17
Add a new architecture type arch_kind_hygon to spilt Hygon branch from AMD. This is to facilitate the Hygon processors to make settings that are suitable for its own characteristics. Signed-off-by: Feifei Wang <wangfeifei@hygon.cn> Reviewed-by: Jing Li <lijing@hygon.cn> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-08-25mach: Fix bogus negative returnSamuel Thibault1-0/+3
One can be very unlucky to call time_now first just before a second switch, and mach_msg sleep just a bit more enough for the second time_now call to count one second too many (or even more if scheduling is really unlucky). So we have to protect against returning a bogus negative value in such case.
2024-08-23powerpc64: Optimize strcpy and stpcpy for Power9/10Mahesh Bodapati1-53/+223
This patch modifies the current Power9 implementation of strcpy and stpcpy to optimize it for Power9 and Power10. No new Power10 instructions are used, so the original Power9 strcpy is modified instead of creating a new implementation for Power10. The changes also affect stpcpy, which uses the same implementation with some additional code before returning. Improvements compared to the old Power9 version: Use simple comparisons for the first ~512 bytes: The main loop is good for long strings, but comparing 16B each time is better for shorter strings. After aligning the address to 16 bytes, we unroll the loop four times, checking 128 bytes each time. There may be some overlap with the main loop for unaligned strings, but it is better for shorter strings. Loop with 64 bytes for longer bytes: Use 4 consecutive lxv/stxv instructions. Showed an average improvement of 13%. Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com> Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
2024-08-23nptl: Fix Race conditions in pthread cancellation [BZ#12683]Adhemerval Zanella40-102/+2280
The current racy approach is to enable asynchronous cancellation before making the syscall and restore the previous cancellation type once the syscall returns, and check if cancellation has happen during the cancellation entrypoint. As described in BZ#12683, this approach shows 2 problems: 1. Cancellation can act after the syscall has returned from the kernel, but before userspace saves the return value. It might result in a resource leak if the syscall allocated a resource or a side effect (partial read/write), and there is no way to program handle it with cancellation handlers. 2. If a signal is handled while the thread is blocked at a cancellable syscall, the entire signal handler runs with asynchronous cancellation enabled. This can lead to issues if the signal handler call functions which are async-signal-safe but not async-cancel-safe. For the cancellation to work correctly, there are 5 points at which the cancellation signal could arrive: [ ... )[ ... )[ syscall ]( ... 1 2 3 4 5 1. Before initial testcancel, e.g. [*... testcancel) 2. Between testcancel and syscall start, e.g. [testcancel...syscall start) 3. While syscall is blocked and no side effects have yet taken place, e.g. [ syscall ] 4. Same as 3 but with side-effects having occurred (e.g. a partial read or write). 5. After syscall end e.g. (syscall end...*] And libc wants to act on cancellation in cases 1, 2, and 3 but not in cases 4 or 5. For the 4 and 5 cases, the cancellation will eventually happen in the next cancellable entrypoint without any further external event. The proposed solution for each case is: 1. Do a conditional branch based on whether the thread has received a cancellation request; 2. It can be caught by the signal handler determining that the saved program counter (from the ucontext_t) is in some address range beginning just before the "testcancel" and ending with the syscall instruction. 3. SIGCANCEL can be caught by the signal handler and determine that the saved program counter (from the ucontext_t) is in the address range beginning just before "testcancel" and ending with the first uninterruptable (via a signal) syscall instruction that enters the kernel. 4. In this case, except for certain syscalls that ALWAYS fail with EINTR even for non-interrupting signals, the kernel will reset the program counter to point at the syscall instruction during signal handling, so that the syscall is restarted when the signal handler returns. So, from the signal handler's standpoint, this looks the same as case 2, and thus it's taken care of. 5. For syscalls with side-effects, the kernel cannot restart the syscall; when it's interrupted by a signal, the kernel must cause the syscall to return with whatever partial result is obtained (e.g. partial read or write). 6. The saved program counter points just after the syscall instruction, so the signal handler won't act on cancellation. This is similar to 4. since the program counter is past the syscall instruction. So The proposed fixes are: 1. Remove the enable_asynccancel/disable_asynccancel function usage in cancellable syscall definition and instead make them call a common symbol that will check if cancellation is enabled (__syscall_cancel at nptl/cancellation.c), call the arch-specific cancellable entry-point (__syscall_cancel_arch), and cancel the thread when required. 2. Provide an arch-specific generic system call wrapper function that contains global markers. These markers will be used in SIGCANCEL signal handler to check if the interruption has been called in a valid syscall and if the syscalls has side-effects. A reference implementation sysdeps/unix/sysv/linux/syscall_cancel.c is provided. However, the markers may not be set on correct expected places depending on how INTERNAL_SYSCALL_NCS is implemented by the architecture. It is expected that all architectures add an arch-specific implementation. 3. Rewrite SIGCANCEL asynchronous handler to check for both canceling type and if current IP from signal handler falls between the global markers and act accordingly. 4. Adjust libc code to replace LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET to use the appropriate cancelable syscalls. 5. Adjust 'lowlevellock-futex.h' arch-specific implementations to provide cancelable futex calls. Some architectures require specific support on syscall handling: * On i386 the syscall cancel bridge needs to use the old int80 instruction because the optimized vDSO symbol the resulting PC value for an interrupted syscall points to an address outside the expected markers in __syscall_cancel_arch. It has been discussed in LKML [1] on how kernel could help userland to accomplish it, but afaik discussion has stalled. Also, sysenter should not be used directly by libc since its calling convention is set by the kernel depending of the underlying x86 chip (check kernel commit 30bfa7b3488bfb1bb75c9f50a5fcac1832970c60). * mips o32 is the only kABI that requires 7 argument syscall, and to avoid add a requirement on all architectures to support it, mips support is added with extra internal defines. Checked on aarch64-linux-gnu, arm-linux-gnueabihf, powerpc-linux-gnu, powerpc64-linux-gnu, powerpc64le-linux-gnu, i686-linux-gnu, and x86_64-linux-gnu. [1] https://lkml.org/lkml/2016/3/8/1105 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-08-19elf: Make dl-fptr and dl-symaddr hppa specificAdhemerval Zanella2-46/+22
With ia64 removal, the function descriptor supports is only used by HPPA and new architectures do not seem leaning towards this design. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-08-19x86: Unifies 'strnlen-evex' and 'strnlen-evex512' implementations.Matthew Sterrett3-680/+469
This commit uses a common implementation 'strnlen-evex-base.S' for both 'strnlen-evex' and 'strnlen-evex512' This patch serves both to reduce the number of implementations, and it also does some small optimizations that benefit strnlen-evex and strnlen-evex512. All tests pass on x86. Benchmarks were taken on SKX. https://www.intel.com/content/www/us/en/products/sku/123613/intel-core-i97900x-xseries-processor-13-75m-cache-up-to-4-30-ghz/specifications.html Geometric mean for strnlen-evex over all benchmarks (N=10) was (new/old) 0.881 Geometric mean for strnlen-evex512 over all benchmarks (N=10) was (new/old) 0.953 Code Size Changes: strnlen-evex : +31 bytes strnlen-evex512 : +156 bytes Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-08-16nptl: Fix extraneous testing run by tst-rseq-nptl in the test driverMaciej W. Rozycki1-0/+9
Fix an issue with commit 8f4632deb354 ("Linux: rseq registration tests") and prevent testing from being run in the process of the test driver itself rather than just the test child where one has been forked. The problem here is the unguarded use of a destructor to call a part of the testing. The destructor function, 'do_rseq_destructor_test' is called implicitly at program completion, however because it is associated with the executable itself rather than an individual process, it is called both in the test child *and* in the test driver itself. Prevent this from happening by providing a guard variable that only enables test invocation from 'do_rseq_destructor_test' in the process that has first run 'do_test'. Consequently extra testing is invoked from 'do_rseq_destructor_test' only once and in the correct process, regardless of the use or the lack of of the '--direct' option. Where called in the controlling test driver process that has neved called 'do_test' the destructor function silently returns right away without taking any further actions, letting the test driver fail gracefully where applicable. This arrangement prevents 'tst-rseq-nptl' from ever causing testing to hang forever and never complete, such as currently happening with the 'mips-linux-gnu' (o32 ABI) target. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-08-15Report error if setaffinity wrapper fails (Bug 32040)Carlos O'Donell1-1/+1
Previously if the setaffinity wrapper failed the rest of the subtest would not execute and the current subtest would be reported as passing. Now if the setaffinity wrapper fails the subtest is correctly reported as faling. Tested manually by changing the conditions of the affinity call including setting size to zero, or checking the wrong condition. No regressions on x86_64. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-08-15x86: Add `Avoid_STOSB` tunable to allow NT memset without ERMSNoah Goldstein6-12/+53
The goal of this flag is to allow targets which don't prefer/have ERMS to still access the non-temporal memset implementation. There are 4 cases for tuning memset: 1) `Avoid_STOSB && Avoid_Non_Temporal_Memset` - Memset with temporal stores 2) `Avoid_STOSB && !Avoid_Non_Temporal_Memset` - Memset with temporal/non-temporal stores. Non-temporal path goes through `rep stosb` path. We accomplish this by setting `x86_rep_stosb_threshold` to `x86_memset_non_temporal_threshold`. 3) `!Avoid_STOSB && Avoid_Non_Temporal_Memset` - Memset with temporal stores/`rep stosb` 3) `!Avoid_STOSB && !Avoid_Non_Temporal_Memset` - Memset with temporal stores/`rep stosb`/non-temporal stores. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-08-15x86: Use `Avoid_Non_Temporal_Memset` to control non-temporal pathNoah Goldstein2-8/+23
This is just a refactor and there should be no behavioral change from this commit. The goal is to make `Avoid_Non_Temporal_Memset` a more universal knob for controlling whether we use non-temporal memset rather than having extra logic based on vendor. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-08-15x86: Fix bug in strchrnul-evex512 [BZ #32078]Noah Goldstein1-4/+4
Issue was we were expecting not matches with CHAR before the start of the string in the page cross case. The check code in the page cross case: ``` and $0xffffffffffffffc0,%rax vmovdqa64 (%rax),%zmm17 vpcmpneqb %zmm17,%zmm16,%k1 vptestmb %zmm17,%zmm17,%k0{%k1} kmovq %k0,%rax inc %rax shr %cl,%rax je L(continue) ``` expects that all characters that neither match null nor CHAR will be 1s in `rax` prior to the `inc`. Then the `inc` will overflow all of the 1s where no relevant match was found. This is incorrect in the page-cross case, as the `vmovdqa64 (%rax),%zmm17` loads from before the start of the input string. If there are matches with CHAR before the start of the string, `rax` won't properly overflow. The fix is quite simple. Just replace: ``` inc %rax shr %cl,%rax ``` With: ``` sar %cl,%rax inc %rax ``` The arithmetic shift will clear any matches prior to the start of the string while maintaining the signbit so the 1s can properly overflow to zero in the case of no matches. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-08-11ARC: Regenerate ULPsPavel Kozlov2-0/+81
Regenerate fpu and soft-fp ULPs. Based on results from HSDK-4xD board with GCC 14 build. Including new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
2024-08-09LoongArch: 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-08-09LoongArch: Regenerate ULPscaiyinyu1-32/+32
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f. Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
2024-08-08RISC-V: Regenerate ULPsJulian Zhu1-32/+32
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-08-08MIPS: Regenerate ULPsJulian Zhu2-51/+51
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f. Signed-off-by: Julian Zhu <jz531210@gmail.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-08-08powerpc64le: Update ulpsFlorian Weimer1-12/+12
Based on results from a POWER8 system with a GCC 8 build.
2024-08-08s390x: Update ulpsFlorian Weimer1-32/+32
Based on results from a z16 system with a GCC 8 build.
2024-08-07powerpc: Regenerate ULPs for soft-fpAdhemerval Zanella1-27/+27
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
2024-08-07powerpc: Update soft-fp ulpsAdhemerval Zanella1-30/+30
From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
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>