1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-09-15 12:01:15 +03:00
Commit Graph

42590 Commits

Author SHA1 Message Date
Adhemerval Zanella
42f22e7c8f elf: Check SFrame on tst-dl_find_object.c
If SFrame is enable check if DLFO_FLAG_SFRAME is set (since sframe
support is added by default) and if dlfo_sframe has the expected
value.

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

Reviewed-by: Sam James <sam@gentoo.org>
2025-07-24 19:38:53 +02:00
Claudiu Zissulescu
86fbb4cbb8 sframe: Add support for SFRAME_F_FDE_FUNC_START_PCREL flag
The Sframe V2 has a new errata which introduces the
SFRAME_F_FDE_FUNC_START_PCREL flag. This flag indicates the encoding
of the SFrame FDE function start address field like this:

- if set, sfde_func_start_address field contains the offset in bytes
to the start PC of the associated function from the field itself.

- if unset, sfde_func_start_address field contains the offset in bytes
to the start PC of the associated function from the start of the
SFrame section.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: Sam James <sam@gentoo.org>
2025-07-24 19:38:50 +02:00
Adhemerval Zanella
a12d72019e Disable SFrame support by default
And add extra checks to enable for binutils 2.45 and if the architecture
explicitly enables it.  When SFrame is disabled, all the related code
is also not enabled for backtrace() and _dl_find_object(), so SFrame
backtracking is not used even if the binary has the SFrame segment.

This patch also adds some other related fixes:

  * Fixed an issue with AC_CHECK_PROG_VER, where the READELF_SFRAME
    usage prevented specifying a different readelf through READELF
    environment variable at configure time.

  * Add an extra arch-specific internal definition,
    libc_cv_support_sframe, to disable --enable-sframe on architectures
    that have binutils but not glibc support (s390x).

  * Renamed the tests without the .sframe segment and move the
    tst-backtrace1 from pthread to debug.

  * Use the built compiler strip to remove the .sframe segment,
    instead of the system one (which might not support SFrame).

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

Reviewed-by: Sam James <sam@gentoo.org>
2025-07-24 19:38:47 +02:00
Sachin Monga
ce488f7c16 math: xfail some pown and compoundn tests for ibm128-libgcc
On powerpc math/test-ibm128-pown shows below failures:

testing long double (without inline functions)
infinity has wrong sign.
Failure: Test: pown_downward (-inf, 0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
Failure: Test: pown_downward (-0, 9223372036854775807LL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: pown_downward (-0x1p+0, 9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_downward (-0x1p+0, 9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_downward (-0x1p+0, 9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0
infinity has wrong sign.
Failure: Test: pown_towardzero (-0, -0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
infinity has wrong sign.
Failure: Test: pown_towardzero (-inf, 0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
Failure: Test: pown_towardzero (-inf, -0x7fffffffffffffffLL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: Test: pown_towardzero (-0, 9223372036854775807LL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: pown_towardzero (-0x1p+0, -9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_towardzero (-0x1p+0, -9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_towardzero (-0x1p+0, -9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0
Failure: pown_towardzero (-0x1p+0, 9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_towardzero (-0x1p+0, 9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_towardzero (-0x1p+0, 9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0
infinity has wrong sign.
Failure: Test: pown_upward (-0, -0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
Failure: Test: pown_upward (-inf, -0x7fffffffffffffffLL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: pown_upward (-0x1p+0, -9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_upward (-0x1p+0, -9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_upward (-0x1p+0, -9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0

Likewise, math/test-ibm128-compoundn shows below failure:

testing long double (without inline functions)
Failure: compoundn_upward (0xf.ffffffffffff8p+1020, 1LL): Exception "Overflow" set
Failure: compoundn_upward (0xf.ffffffffffff8p+1020, 1LL): errno set to 34, expected 0 (unchanged)
Failure: Test: compoundn_upward (0xf.ffffffffffff8p+1020, 1LL)
Result:
 is:          inf   inf
 should be:   1.79769313486231570814527423731707e+308   0x1.fffffffffffff00000000000008p+1023

Signed-off-by: Sachin Monga <smonga@linux.ibm.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-24 19:36:21 +02:00
Florian Weimer
c7742069a6 manual: Use @Theglibc{} at sentence start in terminal documentation
Fixes commit 5dd2a19ad5 ("termios: manual: improve the
explanation of various tty concepts") and commit c744519bad
("termios: manual: document the SPEED_MAX and BAUD_MAX constants").

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-24 19:27:44 +02:00
Carlos O'Donell
d731493311 Update Fix-Commit list for advisory GLIBC-SA-2025-0002 2025-07-24 11:14:15 -04:00
John David Anglin
d21c8ba479 debug: Link tst-sprintf-fortify-rdonly-static with -Wl,-z,relro [BZ 33183]
This test requires relro_format be placed in the PT_GNU_RELRO segment.
The ELF linker enables -z relro support by default on all Linux targets
except FRV, HPPA, IA64 and MIPS. On these targets, we need to explicitly
link with -z relro to place relro_format in the PT_GNU_RELRO segment.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
2025-07-24 10:53:35 -04:00
Adhemerval Zanella
3ff17af18c Advisory text for CVE-2025-8058
The fix is already installed (7ea06e9940).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-07-23 16:49:03 -03:00
Andreas K. Hüttel
1944817240 Makeconfig: The hash character # confuses old make, use $(dir instead of sed
Up to Make 4.2, # is treated as the start of a comment even in
function invocations. This leads to a syntax error. Fixed in Make 4.3,
but we still support versions back to 4.0 at the moment.

Tested on Gentoo (x86-64) and Debian (loongarch64)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-22 14:54:24 +02:00
Andreas K. Hüttel
58d0ef7989 po: Incorporate translations
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-07-22 00:28:48 +02:00
Florian Weimer
7ea06e9940 posix: Fix double-free after allocation failure in regcomp (bug 33185)
If a memory allocation failure occurs during bracket expression
parsing in regcomp, a double-free error may result.

Reported-by: Anastasia Belova <abelova@astralinux.ru>
Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
2025-07-21 21:43:49 +02:00
Florian Weimer
0f93d54cde Revert "Linux: Keep termios ioctl constants strictly internal"
This reverts commit 3d3572f590.

Reason for revert: TCGETS etc. work to some extent on at least
a subset of architectures, so there is no pressing need to force
applications off them.  Removal of the macros breaks building
the sanitizers, impacting both GCC and LLVM.

Reviewed-by: Sam James <sam@gentoo.org>
2025-07-21 15:13:08 +02:00
H. Peter Anvin
c744519bad termios: manual: document the SPEED_MAX and BAUD_MAX constants
Add the SPEED_MAX and BAUD_MAX constants to the manual.

[ v3: drop leading underscores ]

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-20 17:17:44 +02:00
H. Peter Anvin
12126f86f2 termios: SPEED_MAX and BAUD_MAX constants
Add constants indicating the maximum values of speed_t and baud_t.
Hopefully if and when the baud_t interface is standardized then
BAUD_MAX will be included in the standardization from the start.

Historically, the __MAX_BAUD symbol has indicated the maximum speed_t
value on at least some platforms (including glibc).  However, this
name would be problematic for future standardization, because it
confusingly implies a reference to baud_t, not speed_t, and it is
inconsistent with other limit symbols, which are all of the form *_MAX
(e.g. SIZE_MAX for size_t.)

[ v3: dropped leading underscores, leave __MAX_BAUD outside
      #ifdef __USE_MISC since it is a legacy symbol, and
      namespace-protected with a double underscore.
      (Collin Funk, Adhermerval Zanella Netto) ]

[ v4: moved from __USE_MISC to __USE_GNU (Collin Funk) ]

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-20 17:17:41 +02:00
H. Peter Anvin
0332959dd2 termios: move the baud_t interface from __USE_MISC to __USE_GNU
__USE_MISC refers to interfaces imported from BSD or System V, but the
baud_t interface is (at least for now) a GNU extension, so move it
from __USE_MISC to __USE_GNU.

Suggested-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-20 17:17:38 +02:00
H. Peter Anvin
5dd2a19ad5 termios: manual: improve the explanation of various tty concepts
It is a lot easier to understand the meaning of the tty interface if
it is explained from the beginning as conceptually emulating an RS232
serial port.  This greatly simplifies the discussions of specific
items like the meaning of line speed.

Distinguish between "modem disconnect request" (deasserting DTR) and
"modem disconnect" (DCD deasserted).  Conflating the two terms is
confusing, especially for non-RS232 devices.  In particular, on most
systems, a pseudo-terminal will *not* respond to a modem disconnect
request by triggering a modem disconnect event for the purpose of the
HUPCL flag.

It is not necessarily true that the line speed has no effect on
non-serial port devices: e.g. an SPI port may interpret it as the
clock frequency to use; however, SPI does not use asynchronous framing
bits, instead synchronization is handled by the SS# wire.  Similarly,
it is common but not by any means universal for interfaces that employ
various forms of fixed data to symbol rate encodings to encode the
data link layer bit rate rather than the physical symbol rate, which
may be higher (e.g. 8B10B) or lower (e.g. QAM/Trellis), without the
encoding or framing overhead.

Finally, a handful of devices use the line rate for entirely
nonstandard purposes.  One example is Arduino USB interfaces, which
often interprets changing the baud rate to 1200 baud as a command to
reset the device.

[ v2: removed a bogus stray chunk from editing ]

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-07-20 17:11:02 +02:00
H. Peter Anvin
5e78997c56 termios: manual: remove duplicate cfgetospeed() definition
The function cfsetospeed() is defined twice in the manual. Remove the
one that seems out of place.

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-20 17:10:59 +02:00
H. Peter Anvin
118370fd78 termios: manual: fix typo: tcsettattr -> tcsetattr
Fix a typo in the manual: tcsetattr misspelled as tcsettattr.

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-20 17:10:56 +02:00
Andreas K. Hüttel
8cab264b26 libc.pot: regenerate
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-07-19 22:23:09 +02:00
H.J. Lu
55e85c1e48 io/tst-stat.c: Use a temporary directory for symlink test
Call support_create_temp_directory to create a temporary directory for
symlink test, instead of a fixed file in the glibc source tree, to avoid
the race condition when there are more than one glibc tests running at the
same time with the same glibc source tree.  This fixes BZ #33178.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
2025-07-19 12:43:26 -07:00
Florian Weimer
01196393c2 elf: Initialize GLRO (dl_read_only_area) after static dlopen (bug 33139)
The _dl_read_only_area function in the uninitialized ld.so after
static dlopen is not able to find anything.  Instead, we need to
redirect to the code from the statically linked main program.

Fixes commit d60fffe28a46b2a41fc308c1804ff02375d27408 ("debug:
Improve '%n' fortify detection (BZ 30932)").

Reviewed-by: Adhemerval Zanella Netto  <adhemerval.zanella@linaro.org>
2025-07-18 19:58:59 +02:00
Florian Weimer
3a9c1497e3 debug: Do not link tst-sprintf-fortify-rdonly against the dlopen module
The test intends to load tst-sprintf-fortify-rdonly-dlopen.so via
dlopen, and directly linking against it prevents that.

Reviewed-by: Adhemerval Zanella Netto  <adhemerval.zanella@linaro.org>
2025-07-18 19:58:56 +02:00
H.J. Lu
aec8498873 x86-64: Properly compile ISA optimized modf and modff
There are 3 variants of modf and modff: SSE2, SSE4.1 and AVX.  s_modf.c
and s_modff.c include the generic implementation compiled with the minimum
x86 ISA level.  The IFUNC selector is used only if the minimum ISA level
is less than AVX.  SSE4.1 variant is included only if the ISA level is
less than SSE4.1.  AVX variant is included only the ISA level is less than
AVX.

AVX variant should be compiled with -mavx, not -msse2avx -DSSE2AVX which
are used to encode SSE assembly sources with EVEX encoding.

The routines that are shared between libc and libm should use different
rules to avoid using the same MODULE_NAME, to avoid potential issues
like BZ #33165 where __stack_chk_fail not being routed to the internal
symbol.

Tested with -march=x86-64, -march=x86-64-v2, -march=x86-64-v3 and
-march=x86-64-v4.

This fixes BZ #33165 and BZ #33173.

Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-07-18 10:22:19 -07:00
H.J. Lu
13bf7812ef x86-64: Compile ISA versions of modf/modff with -fno-stack-protector
Since modf and modff are compiled into both libc and libm, when glibc is
configured with --enable-stack-protector=all, ISA versions of modf and
modff should be compiled with -fno-stack-protector to avoid calling
__stack_chk_fail via PLT in libc.so.

This fixes BZ #33165.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
2025-07-17 05:49:47 -07:00
Florian Weimer
cdcf24ee14 iconv: iconv -o should not create executable files (bug 33164)
The mistake is that open must use 0666 to pick up the umask,
and not 0777 (which is required by mkdir).

Fixes commit 8ef3cff9d1
("iconv: Support in-place conversions (bug 10460, bug 32033)").

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-17 14:44:10 +02:00
Cupertino Miranda
0263528f8d malloc: fix definition for MAX_TCACHE_SMALL_SIZE
Reviewed-by: Arjun Shankar <arjun@redhat.com>
2025-07-14 19:44:48 +02:00
Claudiu Zissulescu
e85dbd8604 SFrame: Add tests that uses DWARF backtracer
When SFrame is enabled, we need to tests DW backtracer as well. Do
this by executing the same backtrace tests with .sframe section
stripped.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-07-14 10:58:00 +01:00
Claudiu Zissulescu
3d780a44eb configure: Add --enable-sframe option
Enable SFrame stack track information. The --enable-sframe option
allows the glibc build to compile with SFrame stack track
information. Thus, enabling glibc's backtrace to work within glibc.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
Reviewed-by: Sam James <sam@gentoo.org>
2025-07-14 10:57:53 +01:00
Claudiu Zissulescu
3360913c37 elf: Add SFrame stack tracing
This patch adds the necessary bits to enable stack tracing using
SFrame.  In the case the new SFrame stack tracing procedure doesn't
find SFrame related info, the stack tracing falls back on default
Dwarf implementation.

The new SFrame stack tracing procedure is added to debug/backtrace.c
file, the support functions are added in sysdeps folder, namely
sframe.h, read-sframe.c and read-sfame.h.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-07-14 10:56:37 +01:00
Claudiu Zissulescu
b231c21fc6 aarch64: Add SFrame support for aarch64 architecture
The SFrame is supported for AArch64 architecture.
    Enable SFrame stack tracer for AArch64 too.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-07-14 10:56:36 +01:00
Claudiu Zissulescu
170206b641 x86: Add SFrame support for x86 architecture
The SFrame is well supported by x86 architecture since binutils 2.41.
Enable it to be used as default frame tracer.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-07-14 10:56:36 +01:00
Claudiu Zissulescu
0ebe4fba88 elf: Add SFrame support to _dl_find_object function
The SFrame provides information to be able to do stack trace is now
well defined and implemented in Binutils 2.41.  The format simply
contains enough information to be able to do stack trace given a
program counter (PC) value, the stack pointer, and the frame pointer.
The SFrame information is stored in a .sframe ELF section, which is
loaded into its own PT_GNU_SFRAME segment. We consider for this support
SFrame version 2.

This patch adds the bits to _dl_find_object to recognize and store in
struct dl_find_object the necessary info about SFrame section.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-07-14 10:56:35 +01:00
Adhemerval Zanella
c055c54e96 x86_64: Optimize modf/modff for x86_64-v2
The SSE4.1 provides a direct instruction for trunc, which improves
modf/modff performance with a less text size.  On Ryzen 9 (zen3) with
gcc 14.2.1:

x86_64-v2
reciprocal-throughput        master        patch       difference
workload-0_1                 7.9610       7.7914            2.13%
workload-1_maxint            9.4323       7.8021           17.28%
workload-maxint_maxfloat     8.7379       7.8049           10.68%
workload-integral            7.9492       7.7991            1.89%

latency                      master        patch       difference
workload-0_1                 7.9511      10.8910          -36.97%
workload-1_maxint           15.8278      10.9048           31.10%
workload-maxint_maxfloat    11.3495      10.9139            3.84%
workload-integral           11.5938      10.9071            5.92%

x86_64-v3
reciprocal-throughput        master        patch       difference
workload-0_1                 8.7522       7.9781            8.84%
workload-1_maxint            9.6690       7.9872           17.39%
workload-maxint_maxfloat     8.7634       7.9857            8.87%
workload-integral            8.7397       7.9893            8.59%

latency                      master        patch       difference
workload-0_1                 8.7447       9.5589           -9.31%
workload-1_maxint           13.7480       9.5690           30.40%
workload-maxint_maxfloat    10.0092       9.5680            4.41%
workload-integral            9.7518       9.5743            1.82%

For x86_64-v1 the optimization is done through a new ifunc selector.
The avx is to follow other SSE4_1 optimization (like trunc) to avoid
the ifunc for x86_64-v3.

Checked on x86_64-linux-gnu.
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-07-11 13:01:31 -03:00
Florian Weimer
3d3572f590 Linux: Keep termios ioctl constants strictly internal
Undefine TCGETS, TCGETS2, and related ioctl constants in the installed
headers.  Extract the correct constants (using the kernel type
definitions) automatically from the UAPI headers.  The kernel
constants are available under KERNEL_* names during the glibc build,
computed using assembler constant extraction mechanism.

Alpha may have to use TCGETS instead of TCGETS2 because TCTGETS2
became available in Linux 4.20 only.  Introduce ARCH_TCGETS to make
this choice explict.

To support emulation on powerpc, glibc versions of the termios
constants are added to the emulation code in internal-ioctl.h.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-11 16:04:07 +02:00
Florian Weimer
02e7ac5ee3 termios: Move isatty, __isatty_nostatus from io
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

The definition may depend on termios internals.
2025-07-11 16:04:07 +02:00
Florian Weimer
c5687b4c49 termios: Reflow and sort Makefile
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-11 16:04:07 +02:00
Andreas Schwab
d6c2760ef7 Remove termios2 ioctl defintions from public headers
The use of the termios2 ioctl interface is an implementation detail which
should not bleed into public headers.  Remove the PowerPC version of
<bits/ioctls.h> and define the termios2 ioctl numbers in <termios_arch.h>
instead.  Also remove the include check from there which is unneeded in an
internal header.
2025-07-10 11:39:43 +02:00
Andreas K. Hüttel
c559a6190e elf: Remove now pointless empty ld.so.conf files in single tests
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-09 15:46:20 +02:00
Andreas K. Hüttel
dbe5065f21 support: Always run ldconfig in containered tests
This is required so the generated ld.so.conf files take effect.

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-09 15:46:17 +02:00
Andreas K. Hüttel
ae589cb84d Makefile: Add ld.so.conf with libgcc dir to testroot.pristine
This way, a nonstandard directory within the testroot containing
libgcc_s.so can actually be picked up and used during the test runs.

Also provide a subdirectory ld.so.conf.d for drop-in configuration

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-09 15:46:14 +02:00
Andreas K. Hüttel
cf462982ac Makeconfig: Add libgcc directory to rtld-prefix search path
* This needs to be done twice, for test runs with and without
  --enable-hardcoded-path-in-tests
* Also, we need to query the used $(CC) for the library location.

* The container tests run ldd and dump the list of needed libraries, then
  copy these into the container.
* Without this patch, ldd may not find libgcc_s.so, resulting in"not found"
  output and no copying of the library.
* With this patch, the library is picked up independent of its location (as
  long as the proper directory is provided) and copied into the testroot.

* This does not mean yet that ld.so in the testroot actually finds it.

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-09 15:45:46 +02:00
Yury Khrustalev
30c7cf66b8 NEWS: Mention changes to setjmp on aarch64
Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-07-09 13:27:35 +01:00
Stefan Liebler
77438db8cf Mark support for lock elision as deprecated.
As discussed here:
https://sourceware.org/pipermail/libc-alpha/2025-July/168492.html
The support for TX lock elision of pthread mutexes is deprecated on
all architectures and will be removed in the next release.
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-09 10:52:15 +02:00
H.J. Lu
7130c2ae97 x86: Avoid vector/r16-r31 registers and memcpy/memset in mcount_internal
Since mcount_internal is called from mcount/__fentry__ which preserve
only RAX, RCX, RDX, RSI, RDI, R8 and R9, compile mcount.c with

-fno-tree-loop-distribute-patterns -mgeneral-regs-only -mno-apxf

to void vector/r16-r31 registers and memcpy/memset in mcount_internal.
This fixes BZ #33134.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
2025-07-09 05:33:05 +08:00
Wilco Dijkstra
f33bb12366 NEWS: Mention tcache improvements
Update NEWS with tcache improvements.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-07-08 16:31:01 +00:00
Matteo Croce
521b4d6c4d fstat: add test and documentation for an edge case.
The fstatat behaviour when the target is a dangling symlink is different
if flags contains AT_SYMLINK_NOFOLLOW or not.
Add a test for this and document it.
2025-07-08 13:18:20 -03:00
Matteo Croce
652c36b3ea fstatat: extend tests and documentation
Document the fstatat behaviour leading to a ENOENT errno, and extend
tests to test the case where filename does not exist.

Signed-off-by: Matteo Croce <teknoraver@meta.com>
2025-07-08 13:18:08 -03:00
Samuel Thibault
6afece738c htl: move __pthread_get_cleanup_stack to libc
This fixes the cleanup call from __qsort_r
2025-07-06 19:56:15 +00:00
Samuel Thibault
b80f108b55 htl: Drop ptr_pthread_once from pthread_functions
It is unused since ccdb68e829 ("htl: move pthread_once into libc")
2025-07-06 10:02:17 +00:00
Florian Weimer
ea85e7d550 elf: Restore support for _r_debug interpositions and copy relocations
The changes in commit a93d9e03a3
("Extend struct r_debug to support multiple namespaces [BZ #15971]")
break the dyninst dynamic instrumentation tool.  It brings its
own definition of _r_debug (rather than a declaration).

Furthermore, it turns out it is rather hard to use the proposed
handshake for accessing _r_debug via DT_DEBUG. If applications want
to access _r_debug, they can do so directly if the relevant code has
been built as PIC.  To protect against harm from accidental copy
relocations due to linker relaxations, this commit restores copy
relocation support by adjusting both copies if interposition or
copy relocations are in play.  Therefore, it is possible to
use a hidden reference in ld.so to access _r_debug.

Only perform the copy relocation initialization if libc has been
loaded.  Otherwise, the ld.so search scope can be empty, and the
lookup of the _r_debug symbol mail fail.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-05 20:15:12 +02:00