aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makeconfig12
-rw-r--r--Makefile5
-rw-r--r--NEWS11
-rw-r--r--elf/Makefile9
-rw-r--r--elf/dl-debug-symbols.S1
-rw-r--r--elf/dl-debug.c52
-rw-r--r--elf/rtld.c3
-rw-r--r--elf/tst-dlmopen4-nonpic.c2
-rw-r--r--elf/tst-dlmopen4-pic.c2
-rw-r--r--elf/tst-dlmopen4.c22
-rw-r--r--elf/tst-glibc-hwcaps-2-cache.root/etc/ld.so.conf2
-rw-r--r--elf/tst-glibc-hwcaps-cache.root/etc/ld.so.conf2
-rw-r--r--elf/tst-ldconfig-bad-aux-cache.root/etc/ld.so.conf2
-rw-r--r--gmon/Makefile5
-rw-r--r--htl/Makefile2
-rw-r--r--htl/Versions3
-rw-r--r--htl/forward.c3
-rw-r--r--htl/pt-cleanup.c10
-rw-r--r--htl/pt-initialize.c2
-rw-r--r--include/link.h2
-rw-r--r--io/tst-stat-time64.c6
-rw-r--r--io/tst-stat.c20
-rw-r--r--manual/filesys.texi5
-rw-r--r--support/test-container.c2
-rw-r--r--sysdeps/generic/ldsodefs.h4
-rw-r--r--sysdeps/htl/include/bits/cancelation.h5
-rw-r--r--sysdeps/htl/libc-lock.h19
-rw-r--r--sysdeps/htl/pthread-functions.h4
-rw-r--r--sysdeps/htl/pthreadP.h2
-rw-r--r--sysdeps/mach/hurd/Makefile3
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist1
-rw-r--r--sysdeps/mach/hurd/i386/libpthread.abilist1
-rw-r--r--sysdeps/mach/hurd/x86_64/libpthread.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ioctls.h36
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/termios_arch.h17
-rw-r--r--sysdeps/x86/Makefile4
-rw-r--r--sysdeps/x86_64/Makefile4
37 files changed, 197 insertions, 89 deletions
diff --git a/Makeconfig b/Makeconfig
index 1bb143e..1f8c912 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -639,7 +639,7 @@ link-libc-printers-tests = $(link-libc-rpath) \
# This is how to find at build-time things that will be installed there.
rpath-dirs = math elf dlfcn nss nis rt resolv mathvec support misc debug
rpath-link = \
-$(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
+$(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))):$(gnulib-extralibdir)
else # build-static
link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
@@ -696,6 +696,11 @@ link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnuli
# some cases and it is preferable to link with libgcc_eh or libgcc_s
# so that the testing is as similar as possible to how programs will
# be built with the installed glibc.
+# This leads to moderate difficulties, also since distributions may
+# install libgcc_s.so in directories only found via ld.so.conf, e.g.
+# to be able to switch between gcc versions. We need to add the
+# corresponding directory to the library search path to make sure
+# our test programs can find it.
#
# Some architectures have architecture-specific systems for exception
# handling that may involve undefined references to
@@ -713,6 +718,7 @@ libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
gnulib-arch =
gnulib = -lgcc $(gnulib-arch)
gnulib-tests := -lgcc $(libgcc_eh)
+gnulib-extralibdir = $(shell $(CC) -print-file-name=libgcc_s.so$(libgcc_s.so-version) | sed 's#/[^/]*$$##')
static-gnulib-arch =
# By default, elf/static-stubs.o, instead of -lgcc_eh, is used to
# statically link programs. When --disable-shared is used, we use
@@ -785,10 +791,12 @@ endif
# How to run a program we just linked with our library.
# The program binary is assumed to be $(word 2,$^).
+# We may require additional libraries from gcc (e.g. libgcc_s.so for exception
+# handling), which unfortunately somewhat breaks the isolation.
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
rtld-prefix = $(elf-objpfx)$(rtld-installed-name) \
--library-path \
- $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
+ $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)):$(gnulib-extralibdir)
ifeq (yes,$(build-shared))
comma = ,
sysdep-library-path = \
diff --git a/Makefile b/Makefile
index 97b4328..cb927fb 100644
--- a/Makefile
+++ b/Makefile
@@ -634,6 +634,11 @@ $(objpfx)testroot.pristine/install.stamp :
cp $(objpfx)support/shell-container $(objpfx)testroot.pristine/bin/sh
cp $(objpfx)support/echo-container $(objpfx)testroot.pristine/bin/echo
cp $(objpfx)support/true-container $(objpfx)testroot.pristine/bin/true
+ # We need to be able to load extra language libraries.
+ mkdir -p $(objpfx)testroot.pristine/etc/ld.so.conf.d
+ echo 'include ld.so.conf.d/*.conf' > $(objpfx)testroot.pristine/etc/ld.so.conf
+ echo $(gnulib-extralibdir) >> $(objpfx)testroot.pristine/etc/ld.so.conf
+ echo '# file without content' > $(objpfx)testroot.pristine/etc/ld.so.conf.d/999-empty.conf
ifeq ($(run-built-tests),yes)
# Copy these DSOs first so we can overwrite them with our own.
for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \
diff --git a/NEWS b/NEWS
index cc66834..1a95893 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,11 @@ Major new features:
speed_t is redefined to simply be the baud rate specified as an
unsigned int, which matches the kernel interface.
+* The thread-local cache in malloc (tcache) now supports caching of large
+ blocks. This feature can be enabled by setting the tunable
+ glibc.malloc.tcache_max to a larger value (max 4194304).
+ Tcache is also significantly faster for small sizes.
+
Deprecated and removed features, and other changes affecting compatibility:
* The glibc.rtld.execstack now supports a compatibility mode to allow
@@ -37,6 +42,12 @@ Deprecated and removed features, and other changes affecting compatibility:
obsolete since the very first version of POSIX.1 in 1988, replaced
with <termios.h>.
+* The support for TX lock elision of pthread mutexes is deprecated on
+ all architectures and will be removed in the next release.
+
+* On AArch64 Linux targets supporting SME, setjmp and sigsetjmp will
+ disable ZA state of SME.
+
Changes to build and runtime requirements:
* GCC 12.1 or later is now required to build the GNU C Library.
diff --git a/elf/Makefile b/elf/Makefile
index 8a31a29..44b9f19 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -419,6 +419,8 @@ tests += \
tst-dlmopen1 \
tst-dlmopen3 \
tst-dlmopen4 \
+ tst-dlmopen4-nonpic \
+ tst-dlmopen4-pic \
tst-dlopen-auditdup \
tst-dlopen-constructor-null \
tst-dlopen-self \
@@ -2258,6 +2260,13 @@ $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
$(objpfx)tst-dlmopen4.out: $(objpfx)tst-dlmopen1mod.so
+CFLAGS-tst-dlmopen4-pic.c += -fPIC
+$(objpfx)tst-dlmopen4-pic.out: $(objpfx)tst-dlmopen1mod.so
+
+CFLAGS-tst-dlmopen4-nonpic.c += -fno-pie
+tst-dlmopen4-nonpic-no-pie = yes
+$(objpfx)tst-dlmopen4-nonpic.out: $(objpfx)tst-dlmopen1mod.so
+
$(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
diff --git a/elf/dl-debug-symbols.S b/elf/dl-debug-symbols.S
index 7bcb035..d789f4e 100644
--- a/elf/dl-debug-symbols.S
+++ b/elf/dl-debug-symbols.S
@@ -38,3 +38,4 @@
_r_debug:
_r_debug_extended:
.zero R_DEBUG_EXTENDED_SIZE
+rtld_hidden_def (_r_debug)
diff --git a/elf/dl-debug.c b/elf/dl-debug.c
index b033723..38a5b9a 100644
--- a/elf/dl-debug.c
+++ b/elf/dl-debug.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <assert.h>
#include <ldsodefs.h>
@@ -37,6 +38,37 @@ extern const int verify_link_map_members[(VERIFY_MEMBER (l_addr)
to LM_ID_BASE + 1. See elf/dl-debug-symbols.S. */
struct r_debug_extended _r_debug_array[DL_NNS - 1];
+/* If not null, pointer to the _r_debug in the main executable. */
+static struct r_debug *_r_debug_main;
+
+void
+_dl_debug_post_relocate (struct link_map *main_map)
+{
+ /* Perform a full symbol search in all objects, to maintain
+ compatibility if interposed _r_debug definitions. The lookup
+ cannot fail because there is a definition in ld.so, and this
+ function is only called if the ld.so search scope is not empty. */
+ const ElfW(Sym) *sym = NULL;
+ lookup_t result =_dl_lookup_symbol_x ("_r_debug", main_map, &sym,
+ main_map->l_scope, NULL, 0, 0, NULL);
+ if (sym->st_size >= sizeof (struct r_debug))
+ {
+ struct r_debug *main_r_debug = DL_SYMBOL_ADDRESS (result, sym);
+ if (main_r_debug != &_r_debug_extended.base)
+ {
+ /* The extended version of the struct is not available in
+ the main executable because a copy relocation has been
+ used. r_map etc. have already been copied as part of the
+ copy relocation processing. */
+ main_r_debug->r_version = 1;
+
+ /* Record that dual updates of the initial link map are
+ required. */
+ _r_debug_main = main_r_debug;
+ }
+ }
+}
+
/* Return the r_debug object for the namespace NS. */
static inline struct r_debug_extended *
get_rdebug (Lmid_t ns)
@@ -71,6 +103,11 @@ void
_dl_debug_change_state (struct r_debug *r, int state)
{
atomic_store_release (&r->r_state, state);
+#ifdef SHARED
+ if (r == &_r_debug_extended.base && _r_debug_main != NULL)
+ /* Update the copy-relocation of _r_debug. */
+ atomic_store_release (&_r_debug_main->r_state, state);
+#endif
_dl_debug_state ();
}
@@ -103,7 +140,9 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
if (ns - 1 == LM_ID_BASE)
{
atomic_store_release (&_r_debug_extended.r_next, r);
- /* Now there are multiple namespaces. */
+ /* Now there are multiple namespaces. Note that this
+ deliberately does not update the copy in the main
+ executable (if it exists). */
atomic_store_release (&_r_debug_extended.base.r_version, 2);
}
else
@@ -116,8 +155,15 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
}
if (r->base.r_map == NULL)
- atomic_store_release (&r->base.r_map,
- (void *) GL(dl_ns)[ns]._ns_loaded);
+ {
+ struct link_map_public *l = (void *) GL(dl_ns)[ns]._ns_loaded;
+ atomic_store_release (&r->base.r_map, l);
+#ifdef SHARED
+ if (ns == LM_ID_BASE && _r_debug_main != NULL)
+ /* Update the copy-relocation of _r_debug. */
+ atomic_store_release (&_r_debug_main->r_map, l);
+#endif
+ }
return &r->base;
}
diff --git a/elf/rtld.c b/elf/rtld.c
index eec11bf..f889f01 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2313,6 +2313,9 @@ dl_main (const ElfW(Phdr) *phdr,
__rtld_mutex_init ();
__rtld_malloc_init_real (main_map);
+
+ /* Update copy-relocated _r_debug if necessary. */
+ _dl_debug_post_relocate (main_map);
}
/* All ld.so initialization is complete. Apply RELRO. */
diff --git a/elf/tst-dlmopen4-nonpic.c b/elf/tst-dlmopen4-nonpic.c
new file mode 100644
index 0000000..ad4e409
--- /dev/null
+++ b/elf/tst-dlmopen4-nonpic.c
@@ -0,0 +1,2 @@
+#define BUILD_FOR_NONPIC
+#include "tst-dlmopen4.c"
diff --git a/elf/tst-dlmopen4-pic.c b/elf/tst-dlmopen4-pic.c
new file mode 100644
index 0000000..919fa85
--- /dev/null
+++ b/elf/tst-dlmopen4-pic.c
@@ -0,0 +1,2 @@
+#define BUILD_FOR_PIC
+#include "tst-dlmopen4.c"
diff --git a/elf/tst-dlmopen4.c b/elf/tst-dlmopen4.c
index 64e007e..5cda024 100644
--- a/elf/tst-dlmopen4.c
+++ b/elf/tst-dlmopen4.c
@@ -46,6 +46,15 @@ do_test (void)
TEST_COMPARE (debug->base.r_version, 1);
TEST_VERIFY_EXIT (debug->r_next == NULL);
+#ifdef BUILD_FOR_PIC
+ /* In a PIC build, using _r_debug directly should give us the same
+ object. */
+ TEST_VERIFY (&_r_debug == &debug->base);
+#endif
+#ifdef BUILD_FOR_NONPIC
+ TEST_COMPARE (_r_debug.r_version, 1);
+#endif
+
void *h = xdlmopen (LM_ID_NEWLM, "$ORIGIN/tst-dlmopen1mod.so",
RTLD_LAZY);
@@ -57,6 +66,19 @@ do_test (void)
const char *name = basename (debug->r_next->base.r_map->l_name);
TEST_COMPARE_STRING (name, "tst-dlmopen1mod.so");
+#ifdef BUILD_FOR_NONPIC
+ /* If a copy relocation is used, it must be at version 1. */
+ if (&_r_debug != &debug->base)
+ {
+ TEST_COMPARE (_r_debug.r_version, 1);
+ TEST_COMPARE ((uintptr_t) _r_debug.r_map,
+ (uintptr_t) debug->base.r_map);
+ TEST_COMPARE (_r_debug.r_brk, debug->base.r_brk);
+ TEST_COMPARE (_r_debug.r_state, debug->base.r_state);
+ TEST_COMPARE (_r_debug.r_ldbase, debug->base.r_ldbase);
+ }
+#endif
+
xdlclose (h);
return 0;
diff --git a/elf/tst-glibc-hwcaps-2-cache.root/etc/ld.so.conf b/elf/tst-glibc-hwcaps-2-cache.root/etc/ld.so.conf
deleted file mode 100644
index e1e74db..0000000
--- a/elf/tst-glibc-hwcaps-2-cache.root/etc/ld.so.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This file was created to suppress a warning from ldconfig:
-# /sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
diff --git a/elf/tst-glibc-hwcaps-cache.root/etc/ld.so.conf b/elf/tst-glibc-hwcaps-cache.root/etc/ld.so.conf
deleted file mode 100644
index e1e74db..0000000
--- a/elf/tst-glibc-hwcaps-cache.root/etc/ld.so.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This file was created to suppress a warning from ldconfig:
-# /sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
diff --git a/elf/tst-ldconfig-bad-aux-cache.root/etc/ld.so.conf b/elf/tst-ldconfig-bad-aux-cache.root/etc/ld.so.conf
deleted file mode 100644
index e1e74db..0000000
--- a/elf/tst-ldconfig-bad-aux-cache.root/etc/ld.so.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This file was created to suppress a warning from ldconfig:
-# /sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
diff --git a/gmon/Makefile b/gmon/Makefile
index 26051ed..b42c14a 100644
--- a/gmon/Makefile
+++ b/gmon/Makefile
@@ -62,8 +62,9 @@ tests-static += tst-gmon-static-pie
endif
endif
-# The mcount code won't work without a frame pointer.
-CFLAGS-mcount.c := -fno-omit-frame-pointer
+# The mcount code won't work without a frame pointer nor when memcpy or
+# memset are called.
+CFLAGS-mcount.c := -fno-omit-frame-pointer -fno-tree-loop-distribute-patterns
CFLAGS-tst-gmon.c := -fno-omit-frame-pointer -pg
tst-gmon-no-pie = yes
diff --git a/htl/Makefile b/htl/Makefile
index c478047..82b7803 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -35,7 +35,6 @@ libpthread-routines := \
pt-initialize \
pt-join \
pt-spin-inlines \
- pt-cleanup \
pt-testcancel \
pt-cancel \
pt-mutex-transfer-np \
@@ -143,6 +142,7 @@ routines := \
pt-barrierattr-setpshared \
pt-block \
pt-block-intr \
+ pt-cleanup \
pt-cond \
pt-cond-brdcast \
pt-cond-destroy \
diff --git a/htl/Versions b/htl/Versions
index 0052f82..40ee274 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -2,6 +2,7 @@ libc {
GLIBC_2.12 {
pthread_self;
+ __pthread_get_cleanup_stack;
__pthread_key_create;
__pthread_self;
pthread_attr_getdetachstate;
@@ -242,8 +243,6 @@ libpthread {
__errno_location; __h_errno_location;
}
GLIBC_2.12 {
- __pthread_get_cleanup_stack;
-
__pthread_mutex_transfer_np;
cthread_detach;
diff --git a/htl/forward.c b/htl/forward.c
index 0a7a696..21acf66 100644
--- a/htl/forward.c
+++ b/htl/forward.c
@@ -57,6 +57,3 @@ name decl \
FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval),
exit (EXIT_SUCCESS))
strong_alias (__pthread_exit, pthread_exit);
-
-FORWARD2 (__pthread_get_cleanup_stack, struct __pthread_cancelation_handler **,
- (void), (), return &__pthread_cleanup_stack);
diff --git a/htl/pt-cleanup.c b/htl/pt-cleanup.c
index 863c38f..76fdbe2 100644
--- a/htl/pt-cleanup.c
+++ b/htl/pt-cleanup.c
@@ -19,10 +19,16 @@
#include <pthread.h>
#include <pt-internal.h>
+#include <shlib-compat.h>
struct __pthread_cancelation_handler **
-__pthread_get_cleanup_stack (void)
+___pthread_get_cleanup_stack (void)
{
return &__pthread_cleanup_stack;
}
-hidden_def(__pthread_get_cleanup_stack)
+versioned_symbol (libc, ___pthread_get_cleanup_stack, __pthread_get_cleanup_stack, GLIBC_2_21);
+libc_hidden_ver (___pthread_get_cleanup_stack, __pthread_get_cleanup_stack)
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21)
+compat_symbol (libpthread, ___pthread_get_cleanup_stack, __pthread_get_cleanup_stack, GLIBC_2_12);
+#endif
diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c
index cd8b467..b4e8b15 100644
--- a/htl/pt-initialize.c
+++ b/htl/pt-initialize.c
@@ -28,8 +28,6 @@
#if IS_IN (libpthread)
static const struct pthread_functions pthread_functions = {
.ptr___pthread_exit = __pthread_exit,
- .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack,
- .ptr_pthread_once = __pthread_once,
.ptr__IO_flockfile = _cthreads_flockfile,
.ptr__IO_funlockfile = _cthreads_funlockfile,
.ptr__IO_ftrylockfile = _cthreads_ftrylockfile,
diff --git a/include/link.h b/include/link.h
index 518bfd1..41e5e54 100644
--- a/include/link.h
+++ b/include/link.h
@@ -365,6 +365,8 @@ struct auditstate
dynamic linker. */
extern struct r_debug_extended _r_debug_extended attribute_hidden;
+rtld_hidden_proto (_r_debug)
+
#if __ELF_NATIVE_CLASS == 32
# define symbind symbind32
# define LA_SYMBIND "la_symbind32"
diff --git a/io/tst-stat-time64.c b/io/tst-stat-time64.c
index a20265c..4415765 100644
--- a/io/tst-stat-time64.c
+++ b/io/tst-stat-time64.c
@@ -52,6 +52,12 @@ fstat_check (int fd, const char *path, struct stat *st)
static void
fstatat_check (int fd, const char *path, struct stat *st)
{
+ TEST_COMPARE (fstatat (fd, "", st, 0), -1);
+ TEST_COMPARE (errno, ENOENT);
+
+ TEST_COMPARE (fstatat (AT_FDCWD, "_non_existing_file", st, 0), -1);
+ TEST_COMPARE (errno, ENOENT);
+
TEST_COMPARE (fstatat (fd, path, st, 0), 0);
}
diff --git a/io/tst-stat.c b/io/tst-stat.c
index cc57aec..aeea435 100644
--- a/io/tst-stat.c
+++ b/io/tst-stat.c
@@ -56,15 +56,29 @@ fstatat_check (int fd, const char *path, struct stat *st)
TEST_COMPARE (fstatat (fd, "", st, 0), -1);
TEST_COMPARE (errno, ENOENT);
+ TEST_COMPARE (fstatat (AT_FDCWD, "_non_existing_file", st, 0), -1);
+ TEST_COMPARE (errno, ENOENT);
+
TEST_COMPARE (fstatat (fd, path, st, 0), 0);
}
+static void
+fstatat_link (const char *path, struct stat *st)
+{
+ TEST_COMPARE (fstatat (AT_FDCWD, path, st, 0), -1);
+ TEST_COMPARE (errno, ENOENT);
+
+ TEST_COMPARE (fstatat (AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW), 0);
+ TEST_COMPARE (!S_ISLNK(st->st_mode), 0);
+}
+
typedef void (*test_t)(int, const char *path, struct stat *);
static int
do_test (void)
{
char *path;
+ const char *linkame = "tst-fstat.linkname";
int fd = create_temp_file ("tst-fstat.", &path);
TEST_VERIFY_EXIT (fd >= 0);
support_write_file_string (path, "abc");
@@ -78,13 +92,13 @@ do_test (void)
printf ("warning: timestamp with nanoseconds not supported\n");
struct statx stx;
+ struct stat st;
TEST_COMPARE (statx (fd, path, 0, STATX_BASIC_STATS, &stx), 0);
test_t tests[] = { stat_check, lstat_check, fstat_check, fstatat_check };
for (int i = 0; i < array_length (tests); i++)
{
- struct stat st;
tests[i](fd, path, &st);
TEST_COMPARE (stx.stx_dev_major, major (st.st_dev));
@@ -108,6 +122,10 @@ do_test (void)
}
}
+ TEST_COMPARE (symlink ("tst-fstat.target", linkame), 0);
+ add_temp_file (linkame);
+ fstatat_link (linkame, &st);
+
return 0;
}
diff --git a/manual/filesys.texi b/manual/filesys.texi
index e1c7be8..f49d7d7 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -2398,6 +2398,11 @@ The @var{flags} argument is not valid for this function.
@item ENOTDIR
The descriptor @var{filedes} is not associated with a directory, and
@var{filename} is a relative file name.
+
+@item ENOENT
+The file named by @var{filename} does not exist, it's a dangling symbolic link
+and @var{flags} does not contain @code{AT_SYMLINK_NOFOLLOW}, or @var{filename}
+is an empty string and @var{flags} does not contain @code{AT_EMPTY_PATH}.
@end table
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this
diff --git a/support/test-container.c b/support/test-container.c
index a641250..1c40ab3 100644
--- a/support/test-container.c
+++ b/support/test-container.c
@@ -740,7 +740,7 @@ main (int argc, char **argv)
char *command_basename;
char *so_base;
int do_postclean = 0;
- bool do_ldconfig = false;
+ bool do_ldconfig = true;
char *change_cwd = NULL;
int pipes[2];
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 74931fe..74025f1 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1098,6 +1098,10 @@ rtld_hidden_proto (_dl_debug_state)
extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
attribute_hidden;
+/* This is called after relocation processing to handle a potential
+ copy relocation for _r_debug. */
+void _dl_debug_post_relocate (struct link_map *main_map) attribute_hidden;
+
/* Update the `r_map' member and return the address of `struct r_debug'
of the namespace NS. */
extern struct r_debug *_dl_debug_update (Lmid_t ns) attribute_hidden;
diff --git a/sysdeps/htl/include/bits/cancelation.h b/sysdeps/htl/include/bits/cancelation.h
new file mode 100644
index 0000000..ef2cd70
--- /dev/null
+++ b/sysdeps/htl/include/bits/cancelation.h
@@ -0,0 +1,5 @@
+#include_next <bits/cancelation.h>
+
+#ifndef _ISOMAC
+#include <pthreadP.h>
+#endif
diff --git a/sysdeps/htl/libc-lock.h b/sysdeps/htl/libc-lock.h
index 66779b9..8e764a7 100644
--- a/sysdeps/htl/libc-lock.h
+++ b/sysdeps/htl/libc-lock.h
@@ -37,13 +37,10 @@
{ \
__handler.__handler = FCT; \
__handler.__arg = ARG; \
- if (__pthread_get_cleanup_stack != NULL) \
- { \
- __handlers = __pthread_get_cleanup_stack (); \
- __handler.__next = *__handlers; \
- *__handlers = &__handler; \
- __registered = 1; \
- } \
+ __handlers = __pthread_get_cleanup_stack (); \
+ __handler.__next = *__handlers; \
+ *__handlers = &__handler; \
+ __registered = 1; \
} \
#define __libc_cleanup_end(DOIT) \
@@ -59,12 +56,4 @@
#define __libc_cleanup_push(fct, arg) __libc_cleanup_region_start (1, fct, arg)
#define __libc_cleanup_pop(execute) __libc_cleanup_region_end (execute)
-#if !IS_IN (libpthread)
-# ifdef weak_extern
-weak_extern (__pthread_get_cleanup_stack)
-# else
-# pragma weak __pthread_get_cleanup_stack
-# endif
-#endif
-
#endif
diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h
index 31d85cc..aec13a6 100644
--- a/sysdeps/htl/pthread-functions.h
+++ b/sysdeps/htl/pthread-functions.h
@@ -22,8 +22,6 @@
#include <pthread.h>
void __pthread_exit (void *) __attribute__ ((__noreturn__));
-struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
-int __pthread_once (pthread_once_t *, void (*) (void));
void _cthreads_flockfile (FILE *);
void _cthreads_funlockfile (FILE *);
@@ -35,8 +33,6 @@ int _cthreads_ftrylockfile (FILE *);
struct pthread_functions
{
void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
- struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
- int (*ptr_pthread_once) (pthread_once_t *, void (*) (void));
void (*ptr__IO_flockfile) (FILE *);
void (*ptr__IO_funlockfile) (FILE *);
int (*ptr__IO_ftrylockfile) (FILE *);
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index 64db024..535740f 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -216,11 +216,11 @@ int __pthread_condattr_init (pthread_condattr_t *attr);
libc_hidden_proto (__pthread_self)
libc_hidden_proto (__pthread_attr_init)
libc_hidden_proto (__pthread_condattr_init)
+libc_hidden_proto (__pthread_get_cleanup_stack)
#if IS_IN (libpthread)
hidden_proto (__pthread_create)
hidden_proto (__pthread_detach)
-hidden_proto (__pthread_get_cleanup_stack)
#endif
#if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index f5ea324..32bba61 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -337,7 +337,8 @@ ifeq ($(subdir),stdlib)
tests-unsupported += test-bz22786 tst-strtod-overflow
# pthread_cleanup_combined_push/pthread_cleanup_combined_pop requires cleanup
# support (BZ 32058).
-test-xfail-tst-qsortx7 = yes
+test-xfail-tst-qsort7-mem = yes
+test-xfail-tst-qsortx7-mem = yes
endif
ifeq ($(subdir),timezone)
tests-unsupported += tst-tzset
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index a0e686a..aac3cb3 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -28,6 +28,7 @@ GLIBC_2.11 mkostemps F
GLIBC_2.11 mkostemps64 F
GLIBC_2.11 mkstemps F
GLIBC_2.11 mkstemps64 F
+GLIBC_2.12 __pthread_get_cleanup_stack F
GLIBC_2.12 __pthread_key_create F
GLIBC_2.12 __pthread_self F
GLIBC_2.12 pthread_attr_destroy F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 51535ac..9d2c4cd 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -1,6 +1,5 @@
GLIBC_2.12 __mutex_lock_solid F
GLIBC_2.12 __mutex_unlock_solid F
-GLIBC_2.12 __pthread_get_cleanup_stack F
GLIBC_2.12 __pthread_kill F
GLIBC_2.12 __pthread_mutex_transfer_np F
GLIBC_2.12 __pthread_spin_destroy F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index a1ff462..81d355a 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -5,7 +5,6 @@ GLIBC_2.38 __errno_location F
GLIBC_2.38 __h_errno_location F
GLIBC_2.38 __mutex_lock_solid F
GLIBC_2.38 __mutex_unlock_solid F
-GLIBC_2.38 __pthread_get_cleanup_stack F
GLIBC_2.38 __pthread_kill F
GLIBC_2.38 __pthread_mutex_transfer_np F
GLIBC_2.38 __pthread_spin_destroy F
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctls.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctls.h
deleted file mode 100644
index e1921df..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/bits/ioctls.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_IOCTL_H
-# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
-#endif
-
-/* Use the definitions from the kernel header files. */
-#include <asm/ioctls.h>
-
-/* PowerPC quirk: on PowerPC only, ioctl() emulates the TCGETS/TCSETS*
- ioctls with tcgetattr/tcsetattr using the glibc struct termios.
- As struct termios2 is the same as the kernel struct termios on PowerPC,
- simply consider the kernel ones as the termios2 interface, even
- though the kernel doesn't call it that. */
-
-#define TCGETS2 _IOR ('t', 19, struct termios2)
-#define TCSETS2 _IOW ('t', 20, struct termios2)
-#define TCSETSW2 _IOW ('t', 21, struct termios2)
-#define TCSETSF2 _IOW ('t', 22, struct termios2)
-
-#include <linux/sockios.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/termios_arch.h b/sysdeps/unix/sysv/linux/powerpc/termios_arch.h
index 20025f2..919b437 100644
--- a/sysdeps/unix/sysv/linux/powerpc/termios_arch.h
+++ b/sysdeps/unix/sysv/linux/powerpc/termios_arch.h
@@ -1,4 +1,4 @@
-/* Architectural parameters for Linux termios - Alpha/PowerPC version
+/* Architectural parameters for Linux termios - PowerPC version
Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -17,10 +17,17 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef TERMIOS_INTERNALS_H
-# error "<termios_arch.h> should only be included from <termios_internals.h>"
-#endif
-
#define _TERMIOS2_NCCS 19
#define _HAVE_TERMIOS2_C_CC_BEFORE_C_LINE 1
#define _HAVE_STRUCT_OLD_TERMIOS 0
+
+/* PowerPC quirk: on PowerPC only, ioctl() emulates the TCGETS/TCSETS*
+ ioctls with tcgetattr/tcsetattr using the glibc struct termios.
+ As struct termios2 is the same as the kernel struct termios on PowerPC,
+ simply consider the kernel ones as the termios2 interface, even
+ though the kernel doesn't call it that. */
+
+#define TCGETS2 _IOR ('t', 19, struct termios2)
+#define TCSETS2 _IOW ('t', 20, struct termios2)
+#define TCSETSW2 _IOW ('t', 21, struct termios2)
+#define TCSETSF2 _IOW ('t', 22, struct termios2)
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 2aca36c..4fbd48e 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -137,6 +137,10 @@ tst-tls23-mod.so-no-z-defs = yes
$(objpfx)tst-tls23-mod.so: $(libsupport)
endif
+ifeq ($(subdir),gmon)
+CFLAGS-mcount.c += -mgeneral-regs-only
+endif
+
ifeq ($(subdir),math)
tests += \
tst-ldbl-nonnormal-printf \
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index be64eb2..c3e1065 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -19,6 +19,10 @@ sysdep_routines += _mcount
# recursive calls when ENTRY is used. Just copy the normal static
# object.
sysdep_noprof += _mcount
+
+ifeq (yes,$(have-x86-apx))
+CFLAGS-mcount.c += -mno-apxf
+endif
endif
ifeq ($(subdir),string)