Commit Graph

42367 Commits

Author SHA1 Message Date
Florian Weimer 10a66a8e42 Remove <libc-tsd.h>
Use __thread variables directly instead.  The macros do not save any
typing.  It seems unlikely that a future port will lack __thread
variable support.

Some of the __libc_tsd_* variables are referenced from assembler
files, so keep their names.  Previously, <libc-tls.h> included
<tls.h>, which in turn included <errno.h>, so a few direct includes
of <errno.h> are now required.

Reviewed-by: Frédéric Bérat <fberat@redhat.com>
2025-05-16 19:53:09 +02:00
DJ Delorie 579f866881 manual: add sched_getcpu()
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-05-16 13:16:08 -04:00
Florian Weimer 6c9bb270d6 manual: Clarifications for listing directories
Support for seeking is limited.  Using the d_off and d_reclen members
of struct dirent is discouraged, especially with readdir.  Concurrent
modification of directories during iteration may result in duplicate
or missing etnries.
2025-05-16 16:47:02 +02:00
DJ Delorie 21e54f160f manual: add remaining CPU_* macros
Adds remaining CPU_* macros, including the CPU_*_S macros
for dynamic-sized cpu sets.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-05-15 16:25:17 -04:00
Andreas Schwab eb7a681b82 powerpc: Remove check for -mabi=ibmlongdouble
The -mabi=ibmlongdouble option has been added in gcc 4.2, thus can be
assumed to always exist.
2025-05-15 15:54:18 +02:00
Yury Khrustalev 251f932624 aarch64: update tests for SME
Add test that checks that ZA state is disabled after setjmp and sigsetjmp
Update existing SME test that uses setjmp

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-05-15 14:23:35 +01:00
Yury Khrustalev a7f6fd976c aarch64: Disable ZA state of SME in setjmp and sigsetjmp
Due to the nature of the ZA state, setjmp() should clear it in the
same manner as it is already done by longjmp.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-05-15 14:23:03 +01:00
Cupertino Miranda c6bf6d1897 benchtest: malloc tcache hotpath benchtest
Existing benchtests for malloc infrastructure seem to be rather generic
to test global malloc implementation performance.  This new benchtest
focus on reducing any non tcache related side effects, allowing to more
realistically predict performance impacts of tcache code changes.
The test was inpired in bench-[cm]alloc-thread code, with severe
simplifications:
 - forces single thread execution, reducing concurrency side-effects,
   like cache incoherence penalties due simultaneous writes to the same
   cache pages;
 - Focus on allocating and deallocating a single size for all the
   duration of the benchmark. Since all it does is allocate and
   deallocate, it will measure the tcache hotpath without any
   side-effects.
 - Allows to specify the allocation size as input argument.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-05-15 13:13:00 +00:00
Joseph Myers 06caf53adf Implement C23 rootn.
C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the rootn functions, which compute the Yth root of X for
integer Y (with a domain error if Y is 0, even if X is a NaN).  The
integer exponent has type long long int in C23; it was intmax_t in TS
18661-4, and as with other interfaces changed after their initial
appearance in the TS, I don't think we need to support the original
version of the interface.

As with pown and compoundn, I strongly encourage searching for worst
cases for ulps error for these implementations (necessarily
non-exhaustively, given the size of the input space).  I also expect a
custom implementation for a given format could be much faster as well
as more accurate, although the implementation is simpler than those
for pown and compoundn.

This completes adding to glibc those TS 18661-4 functions (ignoring
DFP) that are included in C23.  See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118592 regarding the C23
mathematical functions (not just the TS 18661-4 ones) missing built-in
functions in GCC, where such functions might usefully be added.

Tested for x86_64 and x86, and with build-many-glibcs.py.
2025-05-14 10:51:46 +00:00
Wilco Dijkstra 36189c76fb malloc: Improve performance of __libc_calloc
Improve performance of __libc_calloc by splitting it into 2 parts: first handle
the tcache fastpath, then do the rest in a separate tailcalled function.
This results in significant performance gains since __libc_calloc doesn't need
to setup a frame.

On Neoverse V2, bench-calloc-simple improves by 5.0% overall.
Bench-calloc-thread 1 improves by 24%.

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-05-14 09:22:32 +00:00
Stefan Liebler 0fc76d8762 S390: Use cfi_val_offset instead of cfi_escape.
Due to raising the minimum binutils version to version >=2.28,
the used cfi_escape for cfi_val_offset can now be ommitted.

Checked with "objdump -WF" / "objdump -Wf" that the previous
cfi_escape and the new cfi_val_offset are equal.
2025-05-14 10:35:55 +02:00
Stefan Liebler 4b1ffb828c powerpc64le: Remove configure check for objcopy >= 2.26.
Due to raising the minimum binutils version to >= 2.26, the configure
check for testing support of --update-section is not needed anymore.
Reviewed-by: Peter Bergner <bergner@tenstorrent.com>
2025-05-14 10:35:55 +02:00
Stefan Liebler e53ab20892 Raise the minimum binutils version to 2.39
The recent commit 27b96e069a raises the minimum
GCC version to 12.1 which was released in 2022.

The current minimum bintuils version 2.25 was released end of 2014.  This patch
now raises the minimum binutils version to 2.39 which was also released in 2022.

The hint for ARC is not needed anymore.

In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
PIE builds fail on binutils 2.37 and earlier, see:
https://sourceware.org/bugzilla/show_bug.cgi?id=28672
This patch keeps PIE unsupported and let the machine maintainers test and
enable it later.

In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
This patch keeps the check as is and let the machine maintainers check if it
still required.

According to Florian Weimer:
Having at least binutils 2.38 will allow us to assume that this linker
bug is fixed:
Bug 28743 - -z relro creats holes in the process image on GNU/Linux
<https://sourceware.org/bugzilla/show_bug.cgi?id=28743>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-05-14 10:35:55 +02:00
Paul Zimmermann ad966bc4ef added benchtest inputs for log2l 2025-05-13 15:07:41 +02:00
Paul Zimmermann aa4c600483 added benchtest inputs for expl 2025-05-13 15:06:18 +02:00
Yury Khrustalev 691edbdf77 aarch64: fix unwinding in longjmp
Previously, longjmp() on aarch64 was using CFI directives around the
call to __libc_arm_za_disable() after CFA was redefined at the start
of longjmp(). This may result in unwinding issues. Move the call and
surrounding CFI directives to the beginning of longjmp().

Suggested-by: Wilco Dijkstra <wilco.dijkstra@arm.com>
2025-05-13 13:00:57 +01:00
Paul Zimmermann 2d9f479f37 added benchtest inputs for powl
changes in v2:
* fixed the missing Makefile entry in the first version
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-05-13 11:10:17 +02:00
Paul Zimmermann 442ddedc07 added benchtest inputs for fmal 2025-05-13 10:58:41 +02:00
DJ Delorie f176bf2a06 manual: fix typo for sched_[sg]etattr
Originally added in 41a90f3f5f which says it's adding sched_getattr
and sched_setattr.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-05-12 17:07:23 -04:00
Wilco Dijkstra 25d37948c9 malloc: Improve malloc initialization
Move malloc initialization to __libc_early_init.  Use a hidden __ptmalloc_init
for initialization and a weak call to avoid pulling in the system malloc in a
static binary.  All previous initialization checks can now be removed.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-05-12 16:10:28 +00:00
Joseph Myers f451a02a8c Document all CLOCK_* values
The manual documents CLOCK_REALTIME and CLOCK_MONOTONIC but not other
CLOCK_* values.  Add documentation of the POSIX clocks
CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID, along with a
reference to the Linux man pages for the semantics of the
Linux-specific clocks supported (as with some other functionality
coming direct from the Linux kernel where the man pages can be
considered the main documentation).

Note: CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE and
CLOCK_MONOTONIC_COARSE are also defined in the toplevel bits/time.h,
as used for Hurd.  Nevertheless, I see no sign that the Hurd code in
glibc actually has any support for those clocks, so I think it is
correct to document them as Linux-specific (and to refer only to the
Linux man pages for their semantics).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-05-12 14:56:07 +00:00
David Lau eff1f680cf malloc: Improved double free detection in the tcache
The previous double free detection did not account for an attacker to
use a terminating null byte overflowing from the previous
chunk to change the size of a memory chunk is being sorted into.
So that the check in 'tcache_double_free_verify' would pass
even though it is a double free.

Solution:
Let 'tcache_double_free_verify' iterate over all tcache entries to
detect double frees.

This patch only protects from buffer overflows by one byte.
But I would argue that off by one errors are the most common
errors to be made.

Alternatives Considered:
  Store the size of a memory chunk in big endian and thus
  the chunk size would not get overwritten because entries in the
  tcache are not that big.

  Move the tcache_key before the actual memory chunk so that it
  does not have to be checked at all, this would work better in general
  but also it would increase the memory usage.

Signed-off-by: David Lau  <david.lau@fau.de>
Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-05-12 11:58:30 +00:00
panzhe0328 e83207c6e6 Correct spelling mistake in test file
There are some spelling mistakes in the test file. Fix them

Reviewed-by: guoce <guoce@kylinos.cn>
Signed-off-by: panzhe0328 <panzhe@kylinos.cn>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-05-12 13:26:57 +02:00
Samuel Thibault 2ae4ec56c2 hurd: Make rename refuse trailing slashes [BZ #32570]
As tested by Gnulib's renameatu module.

Reported by Collin Funk on
https://sourceware.org/bugzilla/show_bug.cgi?id=32570
2025-05-12 01:54:34 +02:00
Joseph Myers ae31254432 Implement C23 compoundn
C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the compoundn functions, which compute (1+X) to the
power Y for integer Y (and X at least -1).  The integer exponent has
type long long int in C23; it was intmax_t in TS 18661-4, and as with
other interfaces changed after their initial appearance in the TS, I
don't think we need to support the original version of the interface.

Note that these functions are "compoundn" with a trailing "n", *not*
"compound" (CORE-MATH has the wrong name, for example).

As with pown, I strongly encourage searching for worst cases for ulps
error for these implementations (necessarily non-exhaustively, given
the size of the input space).  I also expect a custom implementation
for a given format could be much faster as well as more accurate (I
haven't tested or benchmarked the CORE-MATH implementation for
binary32); this is one of the more complicated and less efficient
functions to implement in a type-generic way.

As with exp2m1 and exp10m1, this showed up places where the
powerpc64le IFUNC setup is not as self-contained as one might hope (in
this case, without the changes specific to powerpc64le, there were
undefined references to __GI___expf128).

Tested for x86_64 and x86, and with build-many-glibcs.py.
2025-05-09 15:17:27 +00:00
Adhemerval Zanella f66cb3c9eb hurd: Fix tst-stack2 test build on Hurd
It requires $(shared-thread-library).  Fixes 0c34259423.

Checked on a i686-gnu build.
2025-05-09 10:19:37 -03:00
Collin Funk b4495bd405 nss: remove undefined behavior and optimize getaddrinfo
On x86-64 and compiling with -O2 using stdc_leading_zeros compiles to
the bsr instruction.  The fls function removed by this patch is inlined
but still loops while checking each bit individually.

* nss/getaddrinfo.c: Include <stdbit.h>.
(fls): Remove function.  This function contains a left shift of 31 on an
'int' which is undefined.
(rfc3484_sort): Use stdc_leading_zeros instead of fls.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-05-06 13:31:59 -03:00
Adhemerval Zanella ac4e838289 powerpc: Remove POWER7 strncasecmp optimization
These routines are not extensively used (gnulib documentation even
recommend use a replacement [1]), and there is already a POWER8
version that uses proper vectorized instructions.

[1] https://www.gnu.org/software/gnulib/manual/gnulib.html#C-strings

Checked with a build for some powerpc variations.
Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
2025-05-06 13:31:01 -03:00
DJ Delorie 3270c50e48 manual: add more pthread functions
Add stubs and partial docs for many undocumented pthreads functions.
While neither exhaustive nor complete, gives minimal usage docs
for many functions and expands the pthreads chapters, making it
easier to continue improving this section in the future.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-05-05 22:42:26 -04:00
Stefan Liebler 4f6dae2195 S390: Add new s390 platform z17.
The glibc-hwcaps subdirectories are extended by "z17".  Libraries are loaded if
the z17 facility bits are active:
- Miscellaneous-instruction-extensions facility 4
- Vector-enhancements-facility 3
- Vector-Packed-Decimal-Enhancement Facility 3
- CPU: Concurrent-Functions Facility

tst-glibc-hwcaps.c is extended in order to test z17 via new marker6.
In case of running on a z17 with a kernel not recognizing z17 yet,
AT_PLATFORM will be z900 but vector-bit in AT_HWCAP is set.  This situation
is now recognized and this testcase does not fail.

A fatal glibc error is dumped if glibc was build with architecture
level set for z17, but run on an older machine (See dl-hwcap-check.h).
Note, you might get an SIGILL before this check if you don't use:
configure --with-rtld-early-cflags=-march=<older-machine>

ld.so --list-diagnostics now also dumps information about s390.cpu_features.

Independent from z17, the s390x kernel won't introduce new HWCAP-Bits if there
is no special handling needed in kernel itself.  For z17, we don't have new
HWCAP flags, but have to check the facility bits retrieved by
stfle-instruction.

Instead of storing all the stfle-bits (currently four 64bit values) in the
cpu_features struct, we now only store those bits, which are needed within
glibc itself.  Note that we have this list twice, one with original values and
the other one which can be filtered with GLIBC_TUNABLES=glibc.cpu.hwcaps.
Those new fields are stored in so far reserved space in cpu_features struct.
Thus processes started in between the update of glibc package and we e.g. have
a new ld.so and an old libc.so, won't crash. The glibc internal ifunc-resolvers
would not select the best optimized variant.

The users of stfle-bits are also updated:
- parsing of GLIBC_TUNABLES=glibc.cpu.hwcaps
- glibc internal ifunc-resolvers
- __libc_ifunc_impl_list
- sysconf
2025-05-05 10:30:55 +02:00
Joseph Myers 59f64a1f4f Correct test descriptors in libm-test-pown.inc
While working on implementing compoundn, I noticed that
libm-test-pown.inc was wrongly using TEST_ff_f and AUTO_TESTS_ff_f
when the actual types involved meant fL_f should be used instead of
ff_f; fix to use the correct descriptor strings for pown.  (These
strings affect how gen-libm-test.py generates a C file in some cases.
The structure type test_fL_f_data for expected results and the use of
RUN_TEST_LOOP_fL_f in the ALL_RM_TEST call were already correct.)

Tested for x86_64.  The generated libm-test-pown.c was actually
unchanged, but the old descriptor strings were still logically
incorrect.
2025-05-01 22:28:59 +00:00
Wilco Dijkstra 5d10174581 malloc: Inline tcache_try_malloc
Inline tcache_try_malloc into calloc since it is the only caller.  Also fix
usize2tidx and use it in __libc_malloc, __libc_calloc and _mid_memalign.
The result is simpler, cleaner code.

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-05-01 20:01:53 +00:00
Adhemerval Zanella 84977600da math: Fix UB on sinpif (BZ 32925)
The left shift overflows for 'int', use uint32_t instead.  It syncs
with CORE-MATH commit bbfabd99.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:20:28 -03:00
Adhemerval Zanella 7a0d7fb25c math: Fix UB on erfcf (BZ 32924)
The left shift overflows for 'int', use uint64_t instead.  It syncs
with CORE-MATH commit d0a2be200cbc1344d800d9ef0ebee9ad67dd3ad8.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:20:25 -03:00
Adhemerval Zanella 8eeb7de8a2 math: Fix UB on cospif (BZ 32923)
The left shift overflows for 'int', use uint32_t instead.  It syncs
with CORE-MATH commit bbfabd993a71b049c210b0febfd06d18369fadc1.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:20:16 -03:00
Adhemerval Zanella 7619c1b032 math: Fix UB on cbrtf (BZ 32922)
The left shift overflows for 'int64_t', use unsigned instead.  It syncs
with CORE-MATH commit f7c7408d1749ec2859ea249495af699359ae559b.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:20:10 -03:00
Adhemerval Zanella c8775c0423 math: Fix UB on sinhf (BZ 32921)
The left shift overflows for 'int', use uint64_t instead.  It syncs
with CORE-MATH commit bbfabd99.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:20:04 -03:00
Adhemerval Zanella de0c4adf94 math: Fix UB on logf (BZ 32920)
The left shift overflows for 'int', use a literal instead.  It syncs
with OPTIMIZED-ROUTINES commit 0f87f607b976820ef41fe64d004fe67dc7af8236.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:19:59 -03:00
Adhemerval Zanella 4a1b96bf52 math: Fix UB on coshf (BZ 32919)
The left shift overflows for 'int', use uint64_t instead.  It syncs
with CORE-MATH commit 4d6192d2.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:19:54 -03:00
Adhemerval Zanella 92f7b6061d math: Fix UB on atanhf (BZ 32918)
The left shift overflows for 'int', use unsigned instead.  It syncs
with CORE-MATH commit 4d6192d2.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-04-29 15:19:42 -03:00
Adhemerval Zanella 0c34259423 nptl: Fix pthread_getattr_np when modules with execstack are allowed (BZ 32897)
The BZ 32653 fix (12a497c716) kept the
stack pointer zeroing from make_main_stack_executable on
_dl_make_stack_executable.  However, previously the 'stack_endp'
pointed to temporary variable created before the call of
_dl_map_object_from_fd; while now we use the __libc_stack_end
directly.

Since pthread_getattr_np relies on correct __libc_stack_end, if
_dl_make_stack_executable is called (for instance, when
glibc.rtld.execstack=2 is set) __libc_stack_end will be set to zero,
and the call will always fail.

The __libc_stack_end zero was used a mitigation hardening, but since
52a01100ad it is used solely on
pthread_getattr_np code.  So there is no point in zeroing anymore.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Sam James <sam@gentoo.org>
2025-04-28 10:13:46 -03:00
Julian Zhu 4c966c0780 RISC-V: Use builtin for ffs and ffsll while supported extension available
Hardware ctz instructions are available in the RISC-V Zbb and XTheadBb extension. With special `-march` flags defined, we can generate more simplified code compared to the generic implementation of `ffs`/`ffsll`.

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-04-28 09:51:59 -03:00
Adhemerval Zanella 2be836fe44 stdio: Remove UB on printf_fp
The __printf_fp_buffer_1 issues count_leading_zeros with 0 argument,
which might leads to call __builtin_ctz depending of the ABI.
Replace with stdbit.h function instead.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
2025-04-28 09:51:59 -03:00
Cupertino Miranda 77930e0447 benchtest: Correct shell script related to bench-malloc-thread
This patch changes the shell script that selects which arguments are used
for the execution of bench-malloc-thread.
The problem seems to have been introduced in commit:

  commit 2d6427a63c
  Author: Wangyang Guo <wangyang.guo@intel.com>
  Date:   Fri Nov 29 16:05:35 2024 +0800
  benchtests: Add calloc test

With current condition, the following error "/bin/sh: 3: [[: not found"
occurs when executing `make bench BENCHSET="malloc-thread"` and the else
path is taken, using incorrect arguments for bench test execution.

Error is reproducible in Debian based distros.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-04-25 16:38:25 +02:00
H. Peter Anvin e04afb7177 linux/termio: remove <termio.h> and struct termio
The <termio.h> interface is absolutely ancient: it was obsoleted by
<termios.h> already in the first version of POSIX (1988) and thus
predates the very first version of Linux. Unfortunately, some constant
macros are used both by <termio.h> and <termios.h>; particularly
problematic is the baud rate constants since the termio interface
*requires* that the baud rate is set via an enumeration as part of
c_cflag.

In preparation of revamping the termios interface to support the
arbitrary baud rate capability that the Linux kernel has supported
since 2008, remove <termio.h> in the hope that no one still uses this
archaic interface.

Note that there is no actual code in glibc to support termio: it is
purely an unabstracted ioctl() interface.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-04-25 07:30:59 +02:00
Aurelien Jarno e78caeb4ff elf: tst-audit10: split AVX512F code into dedicated functions [BZ #32882]
"Recent" GCC versions (since commit fc62716fe8d1, backported to stable
branches) emit a vzeroupper instruction at the end of functions
containing AVX instructions. This causes the tst-audit10 test to fail
on CPUs lacking AVX instructions, despite the AVX512F check. The crash
occurs in the pltenter function of tst-auditmod10b.c.

Fix that by moving the code guarded by the check_avx512 function into
specific functions using the target ("avx512f") attribute. Note that
since commit 5359c3bc91 ("x86-64: Remove compiler -mavx512f check") it
is safe to assume that the compiler has AVX512F support, thus the
__AVX512F__ checks can be dropped.

Tested on non-AVX, AVX2 and AVX512F machines.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-04-22 23:39:59 +02:00
Joseph Myers 4e24e4d936 Add NT_ARM_GCS and NT_RISCV_TAGGED_ADDR_CTRL from Linux 6.13 to elf.h
Linux 6.13 adds new ELF note types NT_ARM_GCS and
NT_RISCV_TAGGED_ADDR_CTRL.  Add these to glibc's elf.h.

Tested for x86_64.
2025-04-22 17:02:23 +00:00
Joseph Myers cf9241107d Add AT_* constants from Linux 6.12
Linux 6.12 adds AT_RENAME_* aliases for RENAME_* flags for renameat2,
and also AT_HANDLE_MNT_ID_UNIQUE.  Add the first set of aliases to
stdio.h alongside the RENAME_* names, and AT_HANDLE_MNT_ID_UNIQUE to
bits/fcntl-linux.h.

Tested for x86_64.
2025-04-22 17:00:34 +00:00
Samuel Thibault 39183b953c hurd: Make symlink return EEXIST on existing target directory
8ef1791950 ("hurd: Fix EINVAL error on linking to a slash-trailing path
[BZ #32569]) made symlink return ENOTDIR, but the gnulib testsuite does
not recognize it for such a situation, and EEXIST is indeed more
comprehensible to users.
2025-04-21 23:08:17 +02:00
Samuel Thibault 0d99714680 hurd: Clear FP exceptions before calling signal handler
This avoids SIGFPE handlers (or code longjmp-ed to) getting disturbed by the
exception that generated it.

Note: gcc's unwinding depends on the rpc_wait_trampoline/trampoline exact
code, so we here avoid breaking it.
2025-04-21 20:01:37 +02:00