]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
32 hours agomanual: Fix some typos in the Threads chapter. master
Collin Funk [Wed, 28 Jan 2026 07:44:51 +0000 (23:44 -0800)] 
manual: Fix some typos in the Threads chapter.

32 hours agomanual: Fix some typos in the Low-Level Terminal Interface chapter.
Collin Funk [Wed, 28 Jan 2026 07:40:22 +0000 (23:40 -0800)] 
manual: Fix some typos in the Low-Level Terminal Interface chapter.

2 days agoriscv: Disable multiarch memset variants when !IS_IN(libc)
Yao Zihong [Mon, 26 Jan 2026 21:28:00 +0000 (15:28 -0600)] 
riscv: Disable multiarch memset variants when !IS_IN(libc)

This patch disables multiarch memset variants when !IS_IN(libc),
because rtld can only use a single fixed implementation.

Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 days agoriscv: Disable multiarch memcpy variants when !IS_IN(libc)
Yao Zihong [Mon, 26 Jan 2026 21:24:40 +0000 (15:24 -0600)] 
riscv: Disable multiarch memcpy variants when !IS_IN(libc)

This patch disables multiarch memcpy variants when !IS_IN(libc),
because rtld can only use a single fixed implementation.

Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 days agoposix: Run tst-wordexp-reuse-mem test
Florian Weimer [Mon, 26 Jan 2026 16:12:37 +0000 (17:12 +0100)] 
posix: Run tst-wordexp-reuse-mem test

The test was not properly scheduled for execution with a Makefile
dependency.

Fixes commit 80cc58ea2de214f85b0a1d902a3b668ad2ecb302 ("posix: Reset
wordexp_t fields with WRDE_REUSE (CVE-2025-15281 / BZ 33814").

3 days agomanual: Updates for the dynamic linker hardening recommendations
Florian Weimer [Mon, 26 Jan 2026 15:56:45 +0000 (16:56 +0100)] 
manual: Updates for the dynamic linker hardening recommendations

This update addresses text relocations, and clarifies
constructor/destructor priorities by mentioning the relevant
GCC attributes.

3 days agodlfcn: Add dlinfo request type RTLD_DI_ORIGIN_PATH (bug #24298)
Arjun Shankar [Mon, 26 Jan 2026 12:49:37 +0000 (13:49 +0100)] 
dlfcn: Add dlinfo request type RTLD_DI_ORIGIN_PATH (bug #24298)

The existing dlinfo request type RTLD_DI_ORIGIN used for querying the
value of the '$ORIGIN' dynamic string token is prone to buffer
overflows.

This commit adds a new request type named RTLD_DI_ORIGIN_PATH that
returns a pointer to the dynamic string token (i.e. the 'l_origin' field
in the link map) instead.  The dlinfo manual is updated with the new
request type, and the description of RTLD_DI_ORIGIN is updated to
recommend RTLD_DI_ORIGIN_PATH instead.

A test for the new request type is also added to tst-dlinfo.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 days agopo: Incorporate translatins (nl updated, ar new)
Andreas K. Hüttel [Mon, 26 Jan 2026 00:29:30 +0000 (01:29 +0100)] 
po: Incorporate translatins (nl updated, ar new)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoFix ldbl-128ibm ceill, floorl, roundl and truncl zero-sign handling
Aurelien Jarno [Tue, 20 Jan 2026 17:25:08 +0000 (18:25 +0100)] 
Fix ldbl-128ibm ceill, floorl, roundl and truncl zero-sign handling

When the result of ceill, floorl, roundl and truncl is zero, the sign of
the result must match the sign of the input. For the IBM 128-bit long
double format, the sign is determined by the high part.

Ensure the correct sign when the high part is the result of
computations, by copying the sign from the input high part to the output
high part. On POWER, this conveniently maps to the fcpsgn instruction.

In addition add test for the values provided in BZ #33623, and for the
opposite value when the result is 0.

Fixes: BZ #33623
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agomalloc: Correct Makefile sorting glitches
Florian Weimer [Sat, 24 Jan 2026 09:29:39 +0000 (10:29 +0100)] 
malloc: Correct Makefile sorting glitches

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agosupport: Reinitialize containers if /etc is present
Florian Weimer [Sat, 24 Jan 2026 09:29:39 +0000 (10:29 +0100)] 
support: Reinitialize containers if /etc is present

This prevents test failures because configuration file leftovers
unexpectedly change glibc for future tests.  Whether this
triggers depends on test execution order.

Adding postclean.req files manually (before this change) appears
too error-prone.

Reviewed-by: DJ Delorie <dj@redhat.com>
5 days agosupport: Add support_hardcoded_paths_in_test
Florian Weimer [Sat, 24 Jan 2026 09:29:22 +0000 (10:29 +0100)] 
support: Add support_hardcoded_paths_in_test

It indicates whether glibc was configured with
--enable-hardcoded-path-in-tests.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agosupport: Fix memory leaks in support_subprogram, support_subprogram_wait
Florian Weimer [Sat, 24 Jan 2026 09:29:22 +0000 (10:29 +0100)] 
support: Fix memory leaks in support_subprogram, support_subprogram_wait

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agostdlib: Do not run tst-system subtest with RLIMIT_NPROC as root
Florian Weimer [Sat, 24 Jan 2026 09:29:22 +0000 (10:29 +0100)] 
stdlib: Do not run tst-system subtest with RLIMIT_NPROC as root

RLIMIT_NPROC is typically ignored by root users with capabilities.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
5 days agoversion.h: Increase version number glibc-2.43.9000
Andreas K. Hüttel [Fri, 23 Jan 2026 22:51:31 +0000 (23:51 +0100)] 
version.h: Increase version number

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoNEWS: add 2.44 section
Andreas K. Hüttel [Fri, 23 Jan 2026 22:50:10 +0000 (23:50 +0100)] 
NEWS: add 2.44 section

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoCreate ChangeLog.old/ChangeLog.32 glibc-2.43
Andreas K. Hüttel [Fri, 23 Jan 2026 20:54:00 +0000 (21:54 +0100)] 
Create ChangeLog.old/ChangeLog.32

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoversion.h, include/features.h: Increase version number
Andreas K. Hüttel [Fri, 23 Jan 2026 20:49:16 +0000 (21:49 +0100)] 
version.h, include/features.h: Increase version number

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agocontrib.texi: Add missing accent
Andreas K. Hüttel [Fri, 23 Jan 2026 11:22:19 +0000 (12:22 +0100)] 
contrib.texi: Add missing accent

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agotst-cond23: add <support/test-driver.h> include
Aurelien Jarno [Sun, 18 Jan 2026 17:47:00 +0000 (18:47 +0100)] 
tst-cond23: add <support/test-driver.h> include

This is needed for the recently added EXIT_UNSUPPORTED return value.
Message-ID: <20260118174700.495539-1-aurelien@aurel32.net>

6 days agoinstall.texi, INSTALL: update versions
Andreas K. Hüttel [Thu, 22 Jan 2026 22:18:14 +0000 (23:18 +0100)] 
install.texi, INSTALL: update versions

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agocontrib.texi: Updates
Andreas K. Hüttel [Thu, 22 Jan 2026 22:11:05 +0000 (23:11 +0100)] 
contrib.texi: Updates

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agoNEWS: Insert list of fixed security advisories
Andreas K. Hüttel [Thu, 22 Jan 2026 21:00:10 +0000 (22:00 +0100)] 
NEWS: Insert list of fixed security advisories

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agoNEWS: Mention build issues due to const-preserving macros
Andreas K. Hüttel [Thu, 22 Jan 2026 16:20:55 +0000 (17:20 +0100)] 
NEWS: Mention build issues due to const-preserving macros

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agoNEWS: Insert list of fixed bugs
Andreas K. Hüttel [Thu, 22 Jan 2026 16:33:34 +0000 (17:33 +0100)] 
NEWS: Insert list of fixed bugs

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
7 days agoNEWS: Editorial changes
Andreas K. Hüttel [Thu, 22 Jan 2026 16:12:18 +0000 (17:12 +0100)] 
NEWS: Editorial changes

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
7 days agoNEWS: Additional items and minor consolidation
Andreas K. Hüttel [Thu, 22 Jan 2026 16:04:32 +0000 (17:04 +0100)] 
NEWS: Additional items and minor consolidation

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
7 days agoNEWS: Group ISO C23 related changes
Andreas K. Hüttel [Thu, 22 Jan 2026 11:56:58 +0000 (12:56 +0100)] 
NEWS: Group ISO C23 related changes

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
7 days agopo: Incorporate translations
Andreas K. Hüttel [Thu, 22 Jan 2026 11:44:43 +0000 (12:44 +0100)] 
po: Incorporate translations

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
7 days agoUpdate advisory text for GLIBC-SA-2026-0003
Adhemerval Zanella [Wed, 21 Jan 2026 16:38:46 +0000 (13:38 -0300)] 
Update advisory text for GLIBC-SA-2026-0003

Add all of the Fix-Commit lines for fixed branches.

Fixes were tested and committed up to glibc-2.31.

9 days agoAdd advisory text for CVE-2025-15281
Carlos O'Donell [Fri, 16 Jan 2026 23:46:43 +0000 (18:46 -0500)] 
Add advisory text for CVE-2025-15281

Explain the security issue and set context for the vulnerability to help
downstreams get a better understanding of the issue.

Reviewed-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
9 days agoposix: Reset wordexp_t fields with WRDE_REUSE (CVE-2025-15281 / BZ 33814)
Adhemerval Zanella [Thu, 15 Jan 2026 13:32:19 +0000 (10:32 -0300)] 
posix: Reset wordexp_t fields with WRDE_REUSE (CVE-2025-15281 / BZ 33814)

The wordexp fails to properly initialize the input wordexp_t when
WRDE_REUSE is used. The wordexp_t struct is properly freed, but
reuses the old wc_wordc value and updates the we_wordv in the
wrong position.  A later wordfree will then call free with an
invalid pointer.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
10 days agolibc.pot: regenerate
Andreas K. Hüttel [Mon, 19 Jan 2026 15:24:36 +0000 (16:24 +0100)] 
libc.pot: regenerate

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
10 days agoLinux: fix tst-copy_file_range-large failure in 32-bit glibc build on 64-bit kernel...
Xi Ruoyao [Thu, 15 Jan 2026 08:24:57 +0000 (16:24 +0800)] 
Linux: fix tst-copy_file_range-large failure in 32-bit glibc build on 64-bit kernel [BZ 33790]

Reported-by: H. J. Lu <hjl.tools@gmail.com>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Tested-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
10 days agoelf: Ignore LD_PROFILE if LD_PROFILE_OUTPUT is not set (bug 33797)
Florian Weimer [Thu, 15 Jan 2026 21:29:46 +0000 (22:29 +0100)] 
elf: Ignore LD_PROFILE if LD_PROFILE_OUTPUT is not set (bug 33797)

The previous default for LD_PROFILE_OUTPUT, /var/tmp, is insecure
because it's typically a 1777 directory, and other systems could
place malicious files there which interfere with execution.

Requiring the user to specify a profiling directory mitigates
the impact of bug 33797.  Clear LD_PROFILE_OUTPUT alongside
with LD_PROFILE.

Rework the test not to use predictable file names.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
12 days agohurd: make __thread_set_pcsptp align stack
Samuel Thibault [Sat, 17 Jan 2026 14:15:33 +0000 (15:15 +0100)] 
hurd: make __thread_set_pcsptp align stack

When cancelling a thread, __pthread_do_cancel forces calling call_exit,
but we need to align down the stack, so any further SSE use can work.

12 days agoUpdate advisory text for CVE-2026-0951
Carlos O'Donell [Fri, 16 Jan 2026 22:12:24 +0000 (17:12 -0500)] 
Update advisory text for CVE-2026-0951

Add all of the Fix-Commit lines for fixed branches.

Fixes were tested and committed up to glibc-2.32 (last actively
maintained branch).

13 days agoAdd advisory text for CVE-2026-0951
Carlos O'Donell [Fri, 16 Jan 2026 13:14:49 +0000 (08:14 -0500)] 
Add advisory text for CVE-2026-0951

Explain the security issue and set context for the vulnerability to help
downstreams get a better understanding of the issue.

Reviewed-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
13 days agoAdd advisory text for CVE-2026-0861
Siddhesh Poyarekar [Thu, 15 Jan 2026 22:03:38 +0000 (17:03 -0500)] 
Add advisory text for CVE-2026-0861

Explain the security issue and set context for the vulnerability to help
downstreams get a better understanding of the issue.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
13 days agoresolv: Fix NSS DNS backend for getnetbyaddr (CVE-2026-0915)
Carlos O'Donell [Thu, 15 Jan 2026 20:09:38 +0000 (15:09 -0500)] 
resolv: Fix NSS DNS backend for getnetbyaddr (CVE-2026-0915)

The default network value of zero for net was never tested for and
results in a DNS query constructed from uninitialized stack bytes.
The solution is to provide a default query for the case where net
is zero.

Adding a test case for this was straight forward given the existence of
tst-resolv-network and if the test is added without the fix you observe
this failure:

FAIL: resolv/tst-resolv-network
original exit status 1
error: tst-resolv-network.c:174: invalid QNAME: \146\218\129\128
error: 1 test failures

With a random QNAME resulting from the use of uninitialized stack bytes.

After the fix the test passes.

Additionally verified using wireshark before and after to ensure
on-the-wire bytes for the DNS query were as expected.

No regressions on x86_64.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
13 days agomemalign: reinstate alignment overflow check (CVE-2026-0861)
Siddhesh Poyarekar [Thu, 15 Jan 2026 11:06:40 +0000 (06:06 -0500)] 
memalign: reinstate alignment overflow check (CVE-2026-0861)

The change to cap valid sizes to PTRDIFF_MAX inadvertently dropped the
overflow check for alignment in memalign functions, _mid_memalign and
_int_memalign.  Reinstate the overflow check in _int_memalign, aligned
with the PTRDIFF_MAX change since that is directly responsible for the
CVE.  The missing _mid_memalign check is not relevant (and does not have
a security impact) and may need a different approach to fully resolve,
so it has been omitted.

CVE-Id: CVE-2026-0861
Vulnerable-Commit: 9bf8e29ca136094f73f69f725f15c51facc97206
Reported-by: Igor Morgenstern, Aisle Research
Fixes: BZ #33796
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
2 weeks agomalloc: Add tst-mallocfork to tests-exclude-threaded exception list
Arjun Shankar [Tue, 13 Jan 2026 16:59:26 +0000 (17:59 +0100)] 
malloc: Add tst-mallocfork to tests-exclude-threaded exception list

Commit 244c404ae85003f45aa491a50b6902655ee2df15 added -threaded-main and
-threaded-worker variants of several malloc tests with some exceptions.

tst-mallocfork calls fork from a signal handler, leading to sporadic
deadlocks when multi-threaded since fork is not AS-safe when
multi-threading.  This commit therefore adds tst-mallocfork to the
appropriate exception list.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 weeks agoaarch64: Fix LD_AUDIT with GCS in permissive mode
Adhemerval Zanella [Wed, 7 Jan 2026 16:52:39 +0000 (13:52 -0300)] 
aarch64: Fix LD_AUDIT with GCS in permissive mode

In permissive mode, during audit module handling, check_gcs is unaware
that it is handling audit modules rather than the binary itself.  It
causes the loader to fail to load the audit module, rather than
loading it and disabling GCS.

Also extends GCS tests with 4 LD_AUDIT tests:

1. tst-gcs-audit-disabled: checks if the audit module without GCS
   marking is loaded with default gcs support.

2. tst-gcs-audit-enforced: checks if the audit module without GCS
   marking is not loaded when GCS is enforced.

3. tst-gcs-audit-optional: checks if the audit module without GCS
   marking is loaded when GCS is optional.

4. tst-gcs-audit-override: check if the audit modules without GCS
   marking is loaded when GCS is overrided.

Checked on aarch64-linux-gnu with Linux 6.18 on Apple M4 emulated (for
BTI support) and on qemu 10.1.50 simulated (for GCS).

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
Tested-by: Yury Khrustalev <yury.khrustalev@arm.com>
2 weeks agoaarch64: Add LD_PRELOAD tests for GCS handling
Adhemerval Zanella [Wed, 7 Jan 2026 16:52:38 +0000 (13:52 -0300)] 
aarch64: Add LD_PRELOAD tests for GCS handling

There are modeled after the 'shared' tests subset and it adds 4 new
tests:

1. tst-gcs-preload-disabled: checks if GCS is disabled when a LD_PRELOAD
   module is used without GCS marking with default GCS support.

2. tst-gcs-preload-enforced-abort: chekcs if loader aborts startup when
   a LD_PRELOAD is used without GCS marking and GCS is enforced.

3. tst-gcs-preload-optional: checks if GCS is disabled when a LD_PRELOAD
   is used without GCS marking and GCS is optional.

4. tst-gcs-preload-override: checks if GCS is enabled when a LD_PRELOAD
   is used without GCS marking and GCS is overrided.

Checked on aarch64-linux-gnu with Linux 6.18 on Apple M4 emulated (for
BTI support) and on qemu 10.1.50 simulated (for GCS).

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
Tested-by: Yury Khrustalev <yury.khrustalev@arm.com>
2 weeks agoaarch64: Add LD_AUDIT tests for BTI handling
Adhemerval Zanella [Wed, 7 Jan 2026 16:52:37 +0000 (13:52 -0300)] 
aarch64: Add LD_AUDIT tests for BTI handling

This patch adds 3 new tests:

1. tst-bti-permissive-audit: checks that process runs when an LD_AUDIT module
   not marked with BTI but BTI is not enforced.

2. tst-bti-prot-audit: checks if the process correctly handles audit module with
   BTI marking when BTI is enforced.

3. tst-bti-unprot-audit: check if the process ignores an audit module without
   BTI marking when BTI is enforced.

Checked on aarch64-linux-gnu with Linux 6.18 on Apple M4 emulated (for
BTI support) and on qemu 10.1.50 simulated (for GCS).

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
Tested-by: Yury Khrustalev <yury.khrustalev@arm.com>
2 weeks agoaarch64: Add LD_PRELOAD tests for BTI handling
Adhemerval Zanella [Wed, 7 Jan 2026 16:52:36 +0000 (13:52 -0300)] 
aarch64: Add LD_PRELOAD tests for BTI handling

Add 3 new tests to check if LD_PRELOAD is correctly handled:

1. tst-bti-abort-unprot-preload: checks if the process is aborted if
   a LD_PRELOAD module without BTI marking is used and BTI is enforced.

2. tst-bti-dep-prot-preload: checks if the process works correctly if
   a LD_PRELOAD module with BTI marking is used and BTI is enforced.

3. tst-bti-permissive-preload: checks if the process works correctly
   if a LD_PRELOAD module with BTI marking is used and BTI is not
   enforced.

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
Tested-by: Yury Khrustalev <yury.khrustalev@arm.com>
2 weeks agoRevert "x86: Do not use __builtin_fpclassify for _Float64x/long double"
Adhemerval Zanella [Tue, 13 Jan 2026 14:19:29 +0000 (11:19 -0300)] 
Revert "x86: Do not use __builtin_fpclassify for _Float64x/long double"

This reverts commit 50112103993b042f52fb6afb0e4eee24fe4cb9af. It
breaks libstdc++ and other languages bootstrap.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 weeks agoRevert "x86: Do not use __builtin_isinf_sign for _Float64x/long double"
Adhemerval Zanella [Tue, 13 Jan 2026 14:19:28 +0000 (11:19 -0300)] 
Revert "x86: Do not use __builtin_isinf_sign for _Float64x/long double"

This reverts commit 999cd617cb7e40a2fa719e91fe1028c853ae14d5.  It
breaks libstdc++ and other languages bootstrap.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 weeks agoaarch64: update NEWS for 2.43 release
Yury Khrustalev [Mon, 12 Jan 2026 09:30:59 +0000 (09:30 +0000)] 
aarch64: update NEWS for 2.43 release

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2 weeks agoaarch64: Add LD_DEBUG=security to log BTI and GCS warnings
Yury Khrustalev [Tue, 6 Jan 2026 13:43:34 +0000 (13:43 +0000)] 
aarch64: Add LD_DEBUG=security to log BTI and GCS warnings

Introduce DL_DEBUG_SECURITY mask to enable messages related to
loading modules that lack certain target-dependent hardening
or security features.

Use this mask for warnings related to AArch64 BTI and GCS.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2 weeks agotst-if_nameindex.c: Fix minimum buffer size
Samuel Thibault [Mon, 12 Jan 2026 20:23:33 +0000 (21:23 +0100)] 
tst-if_nameindex.c: Fix minimum buffer size

The standard says that the buffer given to if_indextoname shall have at
least IF_NAMESIZE bytes.

2 weeks agoldbl-128ibm-compat: Add local aliases for printf family symbols
Sachin Monga [Mon, 12 Jan 2026 17:40:15 +0000 (12:40 -0500)] 
ldbl-128ibm-compat: Add local aliases for printf family symbols

When the compiler selects IEEE-128 long double ABI(-mabi=ieeelongdouble),
calls to printf, fprintf, sprintf and snprintf are redirected to the
__printfieee128, __fprintfieee128, __sprintfieee128 and __snprintfieee128
symbols respectively.  This causes "break printf" (and others) in
GDB to fail because the original symbol names do not exist as global
symbols in libc.so.6.

Fix this by adding local symbol aliases in the ieee128 compatibility
files so that the original symbol names are present in the symbol table
again.  This restores the expected GDB behavior ("break printf" works)
without requiring dynamic symbols or versioned compatibility symbols.

Suggested-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agomath: Fix powerpc64le -Os build after 6b7067460f
Adhemerval Zanella [Tue, 23 Dec 2025 17:31:06 +0000 (14:31 -0300)] 
math: Fix powerpc64le -Os build after 6b7067460f

The __USE_EXTERN_INLINES is gated __OPTIMIZE_SIZE__, so also gated
the alias required using the same logic.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 weeks agox86: Fix x86_64 build failure with -Os (BZ 33367)
Adhemerval Zanella [Tue, 23 Dec 2025 17:30:45 +0000 (14:30 -0300)] 
x86: Fix x86_64 build failure with -Os (BZ 33367)

The 13cfd77bf5 change broke the b5d88fa6c3 fix by removing the symbol
to __symbol redirections.  Although it works for -O2 with both gcc
and clang, with -Os without the redirection, the libcall might still
be issued.

This patch reinstates the b5d88fa6c3 fix, with a modification that
allows each ifunc variant to control which trunc to issue.  This is
required for clang, which defines HAVE_X86_INLINE_TRUNC to 1 (meaning
that trunc will always be lowered to the instruction on -Os).

Checked on x86_64-linux-gnu with -O2 and -Os with gcc-15 and clang-18.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 weeks agomath: Sync acosh from CORE-MATH
Adhemerval Zanella [Fri, 9 Jan 2026 14:56:51 +0000 (11:56 -0300)] 
math: Sync acosh from CORE-MATH

The CORE-MATH c423b9a3 commit made atanh to use a slight different
muldd_acc and polydd (which uses muldd_acc internally) compared
to previous version.

The new tests were suggested by Paul Zimmermann (although I did
not see any regression).

Checked on x86_64-linux-gnu, x86_64-linux-gnu-v3, aarch64-linux-gnu,
and i686-linux-gnu.

Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2 weeks agomath: Sync atanh from CORE-MATH
Adhemerval Zanella [Fri, 9 Jan 2026 14:56:50 +0000 (11:56 -0300)] 
math: Sync atanh from CORE-MATH

The CORE-MATH c423b9a3 commit made atanh to use a slight different
muldd_acc, mulddd, and polydd (which uses muldd_acc internally)
compare to asinh and acosh.

The new tests were suggested by Paul Zimmermann (although I did
not see any regression).

Checked on x86_64-linux-gnu, x86_64-linux-gnu-v3, aarch64-linux-gnu,
and i686-linux-gnu.

Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2 weeks agomath: Sync asinh from CORE-MATH
Adhemerval Zanella [Fri, 9 Jan 2026 14:56:49 +0000 (11:56 -0300)] 
math: Sync asinh from CORE-MATH

The CORE-MATH commit cd653cf7 fixes some issues for RNDZ (below).

testing double (without inline functions)
Failure: Test: asinh_towardzero (0x1.07888cc76eb3cp-4)
Result:
 is:          6.4294901954893124e-02   0x1.075a175321f74p-4
 should be:   6.4294901954893110e-02   0x1.075a175321f73p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.07888e17d0fep-4)
Result:
 is:          6.4294906839823556e-02   0x1.075a18a2d2922p-4
 should be:   6.4294906839823542e-02   0x1.075a18a2d2921p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.07888e344d64ep-4)
Result:
 is:          6.4294907253493294e-02   0x1.075a18bf3fed0p-4
 should be:   6.4294907253493280e-02   0x1.075a18bf3fecfp-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.07888e45219adp-4)
Result:
 is:          6.4294907497881415e-02   0x1.075a18d00b3f4p-4
 should be:   6.4294907497881401e-02   0x1.075a18d00b3f3p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.0788946685afp-4)
Result:
 is:          6.4294930288402857e-02   0x1.075a1eee32572p-4
 should be:   6.4294930288402843e-02   0x1.075a1eee32571p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.07889a0cffe1fp-4)
Result:
 is:          6.4294951293986671e-02   0x1.075a2491b07a9p-4
 should be:   6.4294951293986657e-02   0x1.075a2491b07a8p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.07889cddeccf9p-4)
Result:
 is:          6.4294961763186983e-02   0x1.075a276120993p-4
 should be:   6.4294961763186969e-02   0x1.075a276120992p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Failure: Test: asinh_towardzero (0x1.07889efd3a82bp-4)
Result:
 is:          6.4294969652980468e-02   0x1.075a297f4f503p-4
 should be:   6.4294969652980454e-02   0x1.075a297f4f502p-4
 difference:  1.3877787807814456e-17   0x1.0000000000000p-56
 ulp       :  1.0000
 max.ulp   :  0.0000
Maximal error of `asinh_towardzero'
 is      : 1 ulp
 accepted: 0 ulp

The muldd was renamed to muldd_acc to avoid deviate from CORE-MATH
(the symbol and logic in replicated on multiple implementation,
different than glibc we consolidate it on ddcoremath.h).

Checked on x86_64-linux-gnu, x86_64-linux-gnu-v3, aarch64-linux-gnu,
and i686-linux-gnu.

Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2 weeks agoaarch64: Fix error messages for GCS and BTI incompatible modules
Yury Khrustalev [Wed, 10 Dec 2025 15:06:47 +0000 (15:06 +0000)] 
aarch64: Fix error messages for GCS and BTI incompatible modules

When either program path of module name is empty, don't print an
empty string followed by a colon.

Also fix-up test for a static BTI binary to check error message
for this case.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2 weeks agohurd: Fix sigreturn clobbering some xmm registers
Samuel Thibault [Sun, 11 Jan 2026 01:00:25 +0000 (02:00 +0100)] 
hurd: Fix sigreturn clobbering some xmm registers

__sigreturn2 uses _hurd_sigstate_unlock after restoring the interrupted
xmm values, we thus need it not to touch xmm. It makes sense to inline
sigstate_is_global_rcv _hurd_sigstate_lock/unlock anyway. unlock calls
gsync_wake, so we need to avoid xmm there as well.

2 weeks agoLinux: test sizes larger than UINT_MAX for copy_file_range
Xi Ruoyao [Thu, 8 Jan 2026 07:27:55 +0000 (15:27 +0800)] 
Linux: test sizes larger than UINT_MAX for copy_file_range

If the kernel supports the COPY_FILE_RANGE_64 FUSE interface, we can
safely tests the large size values.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Tested-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agoUpdate the bundled <linux/fuse.h> userspace header from Linux 6.18
Xi Ruoyao [Thu, 8 Jan 2026 07:27:54 +0000 (15:27 +0800)] 
Update the bundled <linux/fuse.h> userspace header from Linux 6.18

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 weeks agoLinux: fix copy_file_range test on Linux >= 6.18
Xi Ruoyao [Thu, 8 Jan 2026 07:27:53 +0000 (15:27 +0800)] 
Linux: fix copy_file_range test on Linux >= 6.18

On Linux >= 6.18, the kernel submits the new COPY_FILE_RANGE_64
operation to the fuse implementation for large files.  There is a
fall-back routine to COPY_FILE_RANGE but it's only used if
COPY_FILE_RANGE_64 returns ENOSYS.

So, return ENOSYS instead of EIO for "unsupported" operations in order
to make the kernel do the correct thing for this case and maybe in case
that a new operation is added into the kernel fuse interface in the
future.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 weeks agoSwitch currency symbol for the bg_BG locale to euro
Florian Weimer [Thu, 8 Jan 2026 11:35:08 +0000 (12:35 +0100)] 
Switch currency symbol for the bg_BG locale to euro

Bulgaria joined the eurozone on 2026-01-01.

Suggested-by: Йордан Гигов <jgigov@abv.bg>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
3 weeks agoaarch64: Fix PT_GNU_PROPERTY checks for static exe (BZ 33713)
Yury Khrustalev [Wed, 10 Dec 2025 15:00:26 +0000 (15:00 +0000)] 
aarch64: Fix PT_GNU_PROPERTY checks for static exe (BZ 33713)

All checks related to the PT_GNU_PROPERTY bits would be skipped
if the binary had no PT_GNU_PROPERTY note at all. This meant that
enforcing an abort when some bits are not present was not possible.

Fixes BZ 33713

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
3 weeks agotst-sig-redzone: Decorate assembly function
Samuel Thibault [Sun, 4 Jan 2026 20:51:58 +0000 (21:51 +0100)] 
tst-sig-redzone: Decorate assembly function

To make sure to put it into .text, and let debugging tools know about it.

3 weeks agohurd: check that signal processing does not hurt the x86_64 redzone
Samuel Thibault [Sun, 4 Jan 2026 20:40:35 +0000 (21:40 +0100)] 
hurd: check that signal processing does not hurt the x86_64 redzone

3 weeks agohurd: also test mmx state restoration
Samuel Thibault [Sun, 4 Jan 2026 19:27:09 +0000 (20:27 +0100)] 
hurd: also test mmx state restoration

mmx registers are not the same as mmx, so better test them too

3 weeks agomach/hurd: add `bits/in.h`
Joan Lledó [Sun, 4 Jan 2026 10:07:26 +0000 (11:07 +0100)] 
mach/hurd: add `bits/in.h`

This defines `IP_PKTINFO` and `struct in_pktinfo`
Message-ID: <20260104102835.9373-2-jlledom@mailfence.com>

3 weeks agoBetter terminology for ‘long double’ in manual
Paul Eggert [Sat, 3 Jan 2026 18:27:52 +0000 (10:27 -0800)] 
Better terminology for ‘long double’ in manual

* manual/math.texi (Mathematical Constants):
Don’t say that long double is “the same as” double, as the
types remain distinct (problem reported by Keith Thompson).
Also, don’t imply that float is the “narrowest”, as floating
point types don’t have widths in Standard C.  Instead, talk
about precision and exponent range.

3 weeks agoUpdate copyright dates not handled by scripts/update-copyrights
Paul Eggert [Thu, 1 Jan 2026 18:24:16 +0000 (10:24 -0800)] 
Update copyright dates not handled by scripts/update-copyrights

I've updated copyright dates in glibc for 2026.  This is the patch for
the changes not generated by scripts/update-copyrights.

3 weeks agoUpdate copyright dates with scripts/update-copyrights
Paul Eggert [Thu, 1 Jan 2026 17:32:02 +0000 (09:32 -0800)] 
Update copyright dates with scripts/update-copyrights

3 weeks agoPass glibc pre-commit checks
Paul Eggert [Thu, 1 Jan 2026 21:19:24 +0000 (13:19 -0800)] 
Pass glibc pre-commit checks

This is needed for the next patch which updates copyright dates.
* elf/sprof.c:
* sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c:
Remove trailing white space.
* misc/tst-atomic.c: Remove trailing empty line.

4 weeks agomalloc_info: fix closing </sizes> tag typo
Siddhesh Poyarekar [Mon, 29 Dec 2025 11:53:44 +0000 (06:53 -0500)] 
malloc_info: fix closing </sizes> tag typo

Fix regression in commit 7447efa9622cb33a567094833f6c4000b3ed2e23
("malloc: remove fastbin code from malloc_info") where the closing
`sizes` tag had a typo, missing the '/'.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
5 weeks agoLoongArch: Use generic __builtin_trap in abort.
caiyinyu [Fri, 19 Dec 2025 08:23:03 +0000 (16:23 +0800)] 
LoongArch: Use generic __builtin_trap in abort.

Reviewed-by: Xi Ruoyao <xry111@xry111.site>
5 weeks agomalloc: Fix clang build after 1c588a2187
Adhemerval Zanella [Mon, 22 Dec 2025 14:42:18 +0000 (14:42 +0000)] 
malloc: Fix clang build after 1c588a2187

clang issues:

malloc.c:1909:8: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
 1909 |   if (!DEFAULT_THP_PAGESIZE || mp_.thp_mode != malloc_thp_mode_not_supported)
      |        ^
../sysdeps/unix/sysv/linux/aarch64/malloc-hugepages.h:19:35: note: expanded from macro 'DEFAULT_THP_PAGESIZE'
   19 | #define DEFAULT_THP_PAGESIZE    (1UL << 21)

Checked on aarch64-linux-gnu.

5 weeks agoelf: Fix elf/tst-decorate-maps on aarch64 after 321e1fc73f
Adhemerval Zanella [Wed, 17 Dec 2025 20:55:18 +0000 (17:55 -0300)] 
elf: Fix elf/tst-decorate-maps on aarch64 after 321e1fc73f

The intention of the call "xmalloc(256 * 1024)" in tst-decorate-maps is
to force malloc() to fall back to using mmap() since such an amount
won't be available from the main heap.

Post 321e1fc73f, on aarch64, the heap gets extended by default by at
least 2MB, thus the aforementioned call may get satisfied on the main
heap itself. Thus, increase the amount of memory requested to force the
mmap() path again.

Checked on aarch64-linux-gnu.

5 weeks agomisc: Enable tst-atomic for clang
Adhemerval Zanella [Fri, 19 Dec 2025 18:52:24 +0000 (15:52 -0300)] 
misc: Enable tst-atomic for clang

The atomic.h macros now uses compiler builtins.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agomath: Use math_opt_barrier on ldbl-128 powl underflow/overflow handling
Adhemerval Zanella [Fri, 19 Dec 2025 18:52:23 +0000 (15:52 -0300)] 
math: Use math_opt_barrier on ldbl-128 powl underflow/overflow handling

This avoids compiler to move the operation before the 'iy' compare.

It fixes math/test-float128-pow regreesions when building with clang [1]:

Failure: pow (-0x1.000002p+0, 0xf.ffffffffffff8p+1020): Exception "Underflow" set
Failure: pow (-0x1.000002p+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception "Underflow" set
Failure: pow (-0x1.000002p+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception "Underflow" set
Failure: pow (-0x1.000002p+0, 0xf.fffffffffffffffp+16380): Exception "Underflow" set
Failure: pow (-0x1.000002p+0, 0xf.fffffp+124): Exception "Underflow" set
Failure: pow (-0x1.00000ep+0, 0xf.ffffffffffff8p+1020): Exception "Underflow" set
Failure: pow (-0x1.00000ep+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception "Underflow" set
Failure: pow (-0x1.00000ep+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception "Underflow" set
Failure: pow (-0x1.00000ep+0, 0xf.fffffffffffffffp+16380): Exception "Underflow" set
Failure: pow (-0x2p+0, -0xf.ffffffffffff8p+1020): Exception "Overflow" set
Failure: pow (-0x2p+0, -0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set
Failure: pow (-0x2p+0, -0xf.fffffffffffffffffffffffffff8p+16380): Exception "Overflow" set
Failure: pow (-0x2p+0, -0xf.fffffffffffffffp+16380): Exception "Overflow" set
Failure: pow (-0x2p+0, -0xf.fffffp+124): Exception "Overflow" set
Failure: pow (-0x2p+0, 0xf.ffffffffffff8p+1020): Exception "Underflow" set
Failure: pow (-0x2p+0, 0xf.ffffffffffffbffffffffffffcp+1020): Exception "Underflow" set
Failure: pow (-0x2p+0, 0xf.fffffffffffffffffffffffffff8p+16380): Exception "Underflow" set
Failure: pow (-0x2p+0, 0xf.fffffffffffffffp+16380): Exception "Underflow" set
Failure: pow (-0x2p+0, 0xf.fffffp+124): Exception "Underflow" set
[...]

Checked on x86_64-linux-gnu and aarch64-linux-gnu with gcc-15 and
clang-18.

[1] https://github.com/llvm/llvm-project/issues/173080

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agostdio: Fix tst-vfprintf-user-type on clang
Adhemerval Zanella [Fri, 19 Dec 2025 18:52:22 +0000 (15:52 -0300)] 
stdio: Fix tst-vfprintf-user-type on clang

The pointer alias comparison will be optimized away by the compiler,
so use an indirection point to prevent it (similar to
malloc/tst-malloc-aux.h).

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agox86: Do not use __builtin_isinf_sign for _Float64x/long double
Adhemerval Zanella [Fri, 19 Dec 2025 18:52:21 +0000 (15:52 -0300)] 
x86: Do not use __builtin_isinf_sign for _Float64x/long double

Neither gcc [1] nor clang [2] handles pseudo-normal numbers correctly
with the __builtin_isinf_sign, so disable its usage for _Float64x and
long double types.

This only affects x86, so add a new define __FP_BUILTIN_ISINF_SIGN_DENORMAL
to gate long double and related types to the libc function instead.

It fixes the regression on test-ldouble-isinf when built with clang:

Failure: isinf (pseudo_zero): Exception "Invalid operation" set
Failure: isinf (pseudo_inf): Exception "Invalid operation" set
Failure: isinf (pseudo_qnan): Exception "Invalid operation" set
Failure: isinf (pseudo_snan): Exception "Invalid operation" set
Failure: isinf (pseudo_unnormal): Exception "Invalid operation" set
Failure: isinf_downward (pseudo_zero): Exception "Invalid operation" set
Failure: isinf_downward (pseudo_inf): Exception "Invalid operation" set
Failure: isinf_downward (pseudo_qnan): Exception "Invalid operation" set
Failure: isinf_downward (pseudo_snan): Exception "Invalid operation" set
Failure: isinf_downward (pseudo_unnormal): Exception "Invalid operation" set
Failure: isinf_towardzero (pseudo_zero): Exception "Invalid operation" set
Failure: isinf_towardzero (pseudo_inf): Exception "Invalid operation" set
Failure: isinf_towardzero (pseudo_qnan): Exception "Invalid operation" set
Failure: isinf_towardzero (pseudo_snan): Exception "Invalid operation" set
Failure: isinf_towardzero (pseudo_unnormal): Exception "Invalid operation" set
Failure: isinf_upward (pseudo_zero): Exception "Invalid operation" set
Failure: isinf_upward (pseudo_inf): Exception "Invalid operation" set
Failure: isinf_upward (pseudo_qnan): Exception "Invalid operation" set
Failure: isinf_upward (pseudo_snan): Exception "Invalid operation" set
Failure: isinf_upward (pseudo_unnormal): Exception "Invalid operation" set

Checked on x86_64-linux-gnu with gcc-15 and clang-18.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123173
[2] https://github.com/llvm/llvm-project/issues/172651

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agox86: Do not use __builtin_fpclassify for _Float64x/long double
Adhemerval Zanella [Fri, 19 Dec 2025 18:52:20 +0000 (15:52 -0300)] 
x86: Do not use __builtin_fpclassify for _Float64x/long double

Neither gcc [1] nor clang [2] handles pseudo-normal numbers correctly
with the __builtin_fpclassify, so disable its usage for _Float64x and
long double types.

This only affects x86, so add a new header, fp-builtin-denormal.h, that
defines whether the architecture requires disabling the optimization
through a new glibc define (__FP_BUILTIN_FPCLASSIFY_DENORMAL).

It fixes the regression on test-ldouble-fpclassify and
test-float64x-fpclassify when built with clang:

Failure: fpclassify (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify (pseudo_unnormal): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_unnormal): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_unnormal): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_unnormal): Exception "Invalid operation" set

Checked on x86_64-linux-gnu with gcc-15 and clang-18.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123161
[2] https://github.com/llvm/llvm-project/issues/172533

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agoresolv: Add test for NOERROR/NODATA handling [BZ #14308]
Sergey Kolosov [Mon, 15 Dec 2025 12:00:01 +0000 (13:00 +0100)] 
resolv: Add test for NOERROR/NODATA handling [BZ #14308]

Add a test which verifies that getaddrinfo does not fail if one of A/AAAA
responses is NOERROR/NODATA reply with recursion unavailable and the other
response provides an address.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agoriscv: Add RVV memset for both multiarch and non-multiarch builds
Yao Zihong [Fri, 19 Dec 2025 23:46:42 +0000 (17:46 -0600)] 
riscv: Add RVV memset for both multiarch and non-multiarch builds

This patch adds an RVV-optimized implementation of memset for RISC-V and
enables it for both multiarch (IFUNC) and non-multiarch builds.

The implementation integrates Hau Hsu's 2023 RVV work under a unified
ifunc-based framework. A vectorized version (__memset_vector) is added
alongside the generic fallback (__memset_generic). The runtime resolver
selects the RVV variant when RISCV_HWPROBE_KEY_IMA_EXT_0 reports vector
support (RVV).

Currently, the resolver still selects the RVV variant even when the RVV
extension is disabled via prctl(). As a consequence, any process that
has RVV disabled via prctl() will receive SIGILL when calling memset().

Co-authored-by: Jerry Shih <jerry.shih@sifive.com>
Co-authored-by: Jeff Law <jeffreyalaw@gmail.com>
Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Peter Bergner <bergner@tenstorrent.com>
5 weeks agostdlib: Avoid strlen plt with clang
Adhemerval Zanella [Wed, 17 Dec 2025 17:51:53 +0000 (14:51 -0300)] 
stdlib: Avoid strlen plt with clang

The clang-21 LoopIdiomRecognizePass replaces some loops in
__xpg_basename with a strlen call.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agomath: Do not use __builtin_isgreater* and __builtin_isless* on clang
Adhemerval Zanella [Wed, 17 Dec 2025 17:51:47 +0000 (14:51 -0300)] 
math: Do not use __builtin_isgreater* and __builtin_isless* on clang

clang does not check for unordered numbers with builtins for 128-bit
float types (both _Float128 on x86_64 or long double on aarch64) [1].

For instance, the code:

  #ifdef __x86_64__
  typedef __float128 FLOAT128_TYPE;
  #elif defined (__aarch64__)
  typedef long double FLOAT128_TYPE;
  #endif

  int foo (FLOAT128_TYPE x, FLOAT128_TYPE y)
  {
    return __builtin_isgreater (x, y);
  }

Will issue a __gttf2 call instead of a __unordtf2 followed by the
comparison.

Using the generic implementation fixes multiple issues with math tests,
such as:

Failure: fmax (0, qNaN): Exception "Invalid operation" set
Failure: fmax (0, -qNaN): Exception "Invalid operation" set
Failure: fmax (-0, qNaN): Exception "Invalid operation" set
Failure: fmax (-0, -qNaN): Exception "Invalid operation" set
Failure: fmax (9, qNaN): Exception "Invalid operation" set
Failure: fmax (9, -qNaN): Exception "Invalid operation" set
Failure: fmax (-9, qNaN): Exception "Invalid operation" set
Failure: fmax (-9, -qNaN): Exception "Invalid operation" set

It has a small performance overhead due to the extra isunordered (which
could be omitted for float and double types). Using _Generic (similar to
how __MATH_TG) on a bivariadic function requires a lot of boilerplate
macros.

[1] https://github.com/llvm/llvm-project/issues/172499
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
5 weeks agoelf: Support vDSO with more than one PT_LOAD with v_addr starting at 0 (BZ 32583)
Adhemerval Zanella [Tue, 9 Dec 2025 21:35:13 +0000 (18:35 -0300)] 
elf: Support vDSO with more than one PT_LOAD with v_addr starting at 0 (BZ 32583)

The setup_vdso assumes that vDSO will contain only one PT_LOAD segment
and that 0 is the sentinel for the start mapping address.  Although
the kernel avoids adding more than one PT_LOAD to avoid compatibility
issues, there is no impending issue that prevents glibc from supporting
vDSO with multiple PT_LOAD (as some wrapper tools do [1]).

To support multiple PT_LOAD segments, replace the sentinel with a bool
to indicate that the VMA start has already been set.

Testing is really tricky, since the bug report does not indicate which
tool was used to trigger the issue, nor a runtime that provides a vDSO
with multiple PT_LOAD.  I had to modify the qemu user with a custom
script to create 2 PT_LOAD sections, remove checks that prevent the
vDSO object from being created, and remove the load bias adjustment
in load_elf_vdso.  I could not come up with an easy test case to
integrate with glibc.

The Linux kernel provides vDSO with only one PT_LOAD due to
compatibility reasons. For instance

* arch/arm64/kernel/vdso/vdso.lds.S

86 /*
87  * We must supply the ELF program headers explicitly to get just one
88  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
89  /
90 PHDRS
91 {
92         text            PT_LOAD         FLAGS(5) FILEHDR PHDRS; / PF_R|PF_X /
93         dynamic         PT_DYNAMIC      FLAGS(4);               / PF_R /
94         note            PT_NOTE         FLAGS(4);               / PF_R */
95 }

* arch/x86/entry/vdso/vdso-layout.lds.S

95 /*
96  * We must supply the ELF program headers explicitly to get just one
97  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
98  /
99 PHDRS
100 {
101         text            PT_LOAD         FLAGS(5) FILEHDR PHDRS; / PF_R|PF_X /
102         dynamic         PT_DYNAMIC      FLAGS(4);               / PF_R /
103         note            PT_NOTE         FLAGS(4);               / PF_R */
104         eh_frame_hdr    PT_GNU_EH_FRAME;
105 }

Checked on aarch64-linux-gnu.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=32583#c2

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agonptl: Make pthread_{clock, timed}join{_np} act on all cancellation (BZ 33717)
Adhemerval Zanella [Thu, 11 Dec 2025 20:47:22 +0000 (17:47 -0300)] 
nptl: Make pthread_{clock, timed}join{_np} act on all cancellation (BZ 33717)

The pthread_join/pthread_timedjoin_np/pthread_clockjoin_np will not act
on cancellation if 1. some other thread is already waiting on the 'joinid'
or 2. If the thread has already exited.

On nptl/pthread_join_common.c, the 1. is due to the CAS doing an early
return:

 80   else if (__glibc_unlikely (atomic_compare_exchange_weak_acquire (&pd->joinid,
 81                                                                    &self,
 82                                                                    NULL)))
 83     /* There is already somebody waiting for the thread.  */
 84     return EINVAL;

And 2. is due to the pd->tid equal to 0:

 99       pid_t tid;
100       while ((tid = atomic_load_acquire (&pd->tid)) != 0)
101         {

The easiest solution would be to add an __pthread_testcancel () on
__pthread_clockjoin_ex () if 'cancel' is true.

Checked on aarch64-linux-gnu, arm-linux-gnueabihf, x86_64-linux-gnu,
and i686-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agosupport: Add support_thread_state_wait
Adhemerval Zanella [Thu, 11 Dec 2025 20:47:21 +0000 (17:47 -0300)] 
support: Add support_thread_state_wait

Same as support_process_state_wait, but wait for the task TID
(obtained with gettid) from the current process.  Since the kernel
might remove the /proc/<pid>/task/<tid>/status at any time if the
thread terminates, the code needs to handle possible
fopen/getline/fclose failures due to an inexistent file.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agonptl: Remove INVALID_TD_P
Adhemerval Zanella [Thu, 11 Dec 2025 20:47:20 +0000 (17:47 -0300)] 
nptl: Remove INVALID_TD_P

And use the new __pthread_descriptor_valid function that checks
for 'joinstate' to get the thread state instead of 'tid'.  The
joinstate is set by the kernel when the thread exits.

Checked on x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agonptl: Do not use pthread set_tid_address as state synchronization (BZ #19951)
Adhemerval Zanella [Thu, 11 Dec 2025 20:47:19 +0000 (17:47 -0300)] 
nptl: Do not use pthread set_tid_address as state synchronization (BZ #19951)

The use-after-free described in BZ#19951 is due to the use of two
different PD fields, 'joinid' and 'cancelhandling', to describe the
thread state and to synchronise the calls of pthread_join,
pthread_detach, pthread_exit, and normal thread exit.

Any state change may require checking both fields atomically to handle
partial state (e.g., pthread_join() with a cancellation handler to
issue a 'joinstate' field rollback).

This patch uses a different PD member with 4 possible states (JOINABLE,
DETACHED, EXITING, and EXITED) instead of the pthread 'tid' field, with
the following logic:

 1. On pthread_create, the initial state is set either to JOINABLE or
    DETACHED depending on the pthread attribute used.

 2. On pthread_detach, a CAS is issued on the state.  If the CAS fails,
    the thread is already detached (DETACHED) or being terminated (EXITING).
    For the former, an EINVAL is returned; for the latter, pthread_detach
    should be responsible for joining the thread (and for deallocating any
    internal resources).

 3. In the exit phase of the wrapper function for the thread start routine
    (reached either if the thread function has returned, pthread_exit has
    been called, or cancellation handled has been acted upon), we issue a
    CAS on state to set it to the EXITING mode.

    If the thread is previously in DETACHED mode, the thread is responsible
    for deallocating any resources; otherwise, the thread must be joined
    (detached threads cannot deallocate themselves immediately).

 4. The clear_tid_field on 'clone' call is changed to set the new 'state'
    field on thread exit (EXITED).  This state is only reached at thread
    termination.

 5. The pthread_join implementation is now simpler: the futex wait is done
    directly on thread state, and there is no need to reset it in case of
    timeout since the state is now set either by pthread_detach() or by the
    kernel on process termination.

The race condition on pthread_detach is avoided with a single atomic
operation on the PD state: once the mode is set to THREAD_STATE_DETACHED, it
is up to the thread itself to deallocate its memory (done during the exit
phase at pthread_create()).

Also, the INVALID_NOT_TERMINATED_TD_P is removed since a negative yid is
not possible, and the macro is not used anywhere.

This change triggers an invalid C11 thread test: it creates a thread that
detaches, and after a timeout, the creating thread checks whether the join
fails.  The issue is that once thrd_join() is called, the thread's lifetime
is not defined.

Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
arm-linux-gnueabihf, and powerpc64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agonptl: Set cancellation type and state on pthread_exit (BZ #28267)
Adhemerval Zanella [Thu, 11 Dec 2025 20:47:18 +0000 (17:47 -0300)] 
nptl: Set cancellation type and state on pthread_exit (BZ #28267)

It is required by POSIX XSH 2.9.5 Thread Cancellation under the
heading Thread Cancellation Cleanup Handlers.

Checked x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agonptl: Use __futex_abstimed_wait64 on pthread_create (BZ 33715)
Adhemerval Zanella [Thu, 11 Dec 2025 20:47:17 +0000 (17:47 -0300)] 
nptl: Use __futex_abstimed_wait64 on pthread_create (BZ 33715)

The pthread_create is annotated as __THROWNL.

Checked on x86_64-linux-gnu.

Suggested-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 weeks agobuild-many-glibcs.py: Fix s390x-linux-gnu.
Stefan Liebler [Fri, 19 Dec 2025 10:19:53 +0000 (11:19 +0100)] 
build-many-glibcs.py: Fix s390x-linux-gnu.

The recent commit 638d437dbf9c68e40986edaa9b0d1c2e72a1ae81
"Deprecate s390-linux-gnu (31bit)"
leads to:
FAIL: compilers-s390x-linux-gnu gcc build
when it tries to build 31bit libgcc.

The build is fixed by explicitely disabling multilib.

5 weeks agohurd/i386: Remove stale __GNUC_PREREQ (6, 0) test from tls.h
Uros Bizjak [Thu, 18 Dec 2025 08:13:46 +0000 (09:13 +0100)] 
hurd/i386: Remove stale __GNUC_PREREQ (6, 0) test from tls.h

GCC 12 is currently the minimum supported compiler version.
Remove no longer needed __GNUC_PREREQ (6, 0) test and corresponding
dead code from tls.h.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
5 weeks agonptl: Optimize trylock for high cache contention workloads (BZ #33704)
Sunil K Pandey [Tue, 9 Dec 2025 16:57:44 +0000 (08:57 -0800)] 
nptl: Optimize trylock for high cache contention workloads (BZ #33704)

Check lock availability before acquisition to reduce cache line
bouncing.  Significantly improves trylock throughput on multi-core
systems under heavy contention.

Tested on x86_64.

Fixes BZ #33704.

Co-authored-by: Alex M Wells <alex.m.wells@intel.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 weeks agoRegenerate sysdeps/x86_64/configure
Adhemerval Zanella [Thu, 18 Dec 2025 14:09:33 +0000 (11:09 -0300)] 
Regenerate sysdeps/x86_64/configure

It fixes the 9b8c2b8294 commit.

6 weeks agox86_64: Fix mark-plt configure test
Adhemerval Zanella [Wed, 17 Dec 2025 17:51:52 +0000 (14:51 -0300)] 
x86_64: Fix mark-plt configure test

The configure check might ignore if compiler driver warns that the
option is no support, so force fatal warnings.

If fixes the elf/tst-plt-rewrite{1,2} regressions when ld.lld is used.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
6 weeks agomath: Fix potential underflow on ldbl-128 erfl
Adhemerval Zanella [Wed, 17 Dec 2025 17:51:51 +0000 (14:51 -0300)] 
math: Fix potential underflow on ldbl-128 erfl

The multiplication operation is required only if the branch is taken,
and the compiler might not optimize it away.

It fixes the following issues when the testcase is built with clang:

FAIL: math/test-ldouble-erf
Failure: erf (-0x4p-16384): Exception "Underflow" set
Failure: erf (0x1p-10000): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded54f38760a41abb84p-16384): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded54f38760a41abb88p-16384): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded54f4p-16384): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded54f8p-16384): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded5518p-16384): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded551cp-16384): Exception "Underflow" set
Failure: erf (0x3.8b7f12369ded552p-16384): Exception "Underflow" set
Failure: erf (0x4p-16384): Exception "Underflow" set
Failure: erf_downward (-0x4p-16384): Exception "Underflow" set
Failure: erf_downward (0x1p-10000): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded54f38760a41abb84p-16384): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded54f38760a41abb88p-16384): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded54f4p-16384): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded54f8p-16384): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded5518p-16384): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded551cp-16384): Exception "Underflow" set
Failure: erf_downward (0x3.8b7f12369ded552p-16384): Exception "Underflow" set
Failure: erf_downward (0x4p-16384): Exception "Underflow" set
Failure: erf_towardzero (-0x4p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x1p-10000): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded54f38760a41abb84p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded54f38760a41abb88p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded54f4p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded54f8p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded5518p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded551cp-16384): Exception "Underflow" set
Failure: erf_towardzero (0x3.8b7f12369ded552p-16384): Exception "Underflow" set
Failure: erf_towardzero (0x4p-16384): Exception "Underflow" set
Failure: erf_upward (-0x4p-16384): Exception "Underflow" set
Failure: erf_upward (0x1p-10000): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded54f38760a41abb84p-16384): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded54f38760a41abb88p-16384): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded54f4p-16384): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded54f8p-16384): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded5518p-16384): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded551cp-16384): Exception "Underflow" set
Failure: erf_upward (0x3.8b7f12369ded552p-16384): Exception "Underflow" set
Failure: erf_upward (0x4p-16384): Exception "Underflow" set

Checked on x86_64-linux-gnu and aarch64-linux-gnu with gcc-15 and
clang-18.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
6 weeks agoatomic: Reinstate HAVE_64B_ATOMICS configure check
Wilco Dijkstra [Mon, 15 Dec 2025 13:56:14 +0000 (13:56 +0000)] 
atomic: Reinstate HAVE_64B_ATOMICS configure check

Reinstate HAVE_64B_ATOMICS configure check that was reverted by commit
7fec8a5de6826ef9ae440238d698f0fe5a5fb372 due to BZ #33632.  This was
fixed by 3dd2cbfa35e0e6e0345633079bd5a83bb822c2d8 by only allowing
64-bit atomics on sem_t if its type is 8-byte aligned.  Rebase and add
in cleanups in include/atomic.h that were omitted.

Fix an issue with sparcv8-linux-gnu-leon3 forcing -mcpu=v8 for rtld.c which
overrules -mcpu=leon3 and causes __atomic_always_lock_free (4, 0) to
incorrectly return 0 and trigger asserts in atomics.  Remove this as it
seems to be a workaround for an issue in 1997.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
6 weeks agomalloc: Improve thp_init
Wilco Dijkstra [Fri, 12 Dec 2025 11:58:28 +0000 (11:58 +0000)] 
malloc: Improve thp_init

Cleanup thp_init, change it so that the DEFAULT_THP_PAGESIZE
setting can be overridden with glibc.malloc.hugetlb=0 tunable.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>