From 2314051acaad37dd5630dd7eca08571d620d6496 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 11 Oct 2023 19:54:18 -0700 Subject: [PATCH] update glibc start files to 2.38 I went ahead and left the README.md file deleted because it had broken git hashes. Better to use `git log -- lib/libc/glibc/` to find out the patches. --- lib/libc/glibc/README.md | 9 - lib/libc/glibc/bits/byteswap.h | 2 +- lib/libc/glibc/bits/floatn-common.h | 42 +-- lib/libc/glibc/bits/libc-header-start.h | 2 +- lib/libc/glibc/bits/long-double.h | 2 +- lib/libc/glibc/bits/select.h | 2 +- lib/libc/glibc/bits/signum-generic.h | 2 +- lib/libc/glibc/bits/stat.h | 2 +- lib/libc/glibc/bits/stdint-intn.h | 2 +- lib/libc/glibc/bits/stdlib-bsearch.h | 15 +- lib/libc/glibc/bits/time64.h | 2 +- lib/libc/glibc/bits/timesize.h | 6 +- .../glibc/bits/types/struct_sched_param.h | 2 +- lib/libc/glibc/bits/typesizes.h | 2 +- lib/libc/glibc/bits/uintn-identity.h | 2 +- lib/libc/glibc/bits/waitflags.h | 2 +- lib/libc/glibc/bits/waitstatus.h | 2 +- lib/libc/glibc/csu/errno.c | 2 +- lib/libc/glibc/debug/stack_chk_fail_local.c | 2 +- lib/libc/glibc/elf/elf.h | 267 ++++++++++++++-- lib/libc/glibc/include/libc-pointer-arith.h | 10 +- lib/libc/glibc/include/libc-symbols.h | 294 +++--------------- lib/libc/glibc/include/signal.h | 6 +- lib/libc/glibc/include/stap-probe.h | 2 +- lib/libc/glibc/include/stdlib.h | 55 +++- lib/libc/glibc/include/sys/cdefs.h | 21 ++ lib/libc/glibc/include/sys/select.h | 4 + lib/libc/glibc/include/sys/stat.h | 2 + lib/libc/glibc/io/bits/statx.h | 2 +- lib/libc/glibc/io/fcntl.h | 17 +- lib/libc/glibc/io/mknod.c | 2 +- lib/libc/glibc/io/sys/stat.h | 2 +- lib/libc/glibc/locale/bits/types/__locale_t.h | 3 +- lib/libc/glibc/locale/bits/types/locale_t.h | 2 +- lib/libc/glibc/misc/sys/cdefs.h | 120 ++++++- lib/libc/glibc/misc/sys/select.h | 2 +- lib/libc/glibc/posix/bits/cpu-set.h | 2 +- lib/libc/glibc/posix/bits/types.h | 2 +- lib/libc/glibc/posix/sys/types.h | 2 +- lib/libc/glibc/signal/signal.h | 2 +- lib/libc/glibc/stdlib/alloca.h | 2 +- lib/libc/glibc/stdlib/bits/stdlib-float.h | 2 +- lib/libc/glibc/stdlib/errno.h | 2 +- lib/libc/glibc/stdlib/exit.h | 2 +- lib/libc/glibc/stdlib/stdlib.h | 143 ++++++++- lib/libc/glibc/string/bits/endian.h | 2 +- lib/libc/glibc/string/endian.h | 2 +- lib/libc/glibc/sysdeps/aarch64/crti.S | 2 +- lib/libc/glibc/sysdeps/aarch64/crtn.S | 2 +- lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h | 25 -- .../aarch64/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/aarch64/start.S | 27 +- lib/libc/glibc/sysdeps/aarch64/sysdep.h | 2 +- lib/libc/glibc/sysdeps/alpha/crti.S | 2 +- lib/libc/glibc/sysdeps/alpha/crtn.S | 2 +- lib/libc/glibc/sysdeps/alpha/dl-sysdep.h | 23 -- lib/libc/glibc/sysdeps/alpha/start.S | 3 +- lib/libc/glibc/sysdeps/arc/sysdep.h | 2 +- lib/libc/glibc/sysdeps/arm/arm-features.h | 2 +- lib/libc/glibc/sysdeps/arm/crti.S | 2 +- lib/libc/glibc/sysdeps/arm/crtn.S | 2 +- lib/libc/glibc/sysdeps/arm/dl-sysdep.h | 25 -- lib/libc/glibc/sysdeps/arm/start.S | 2 +- lib/libc/glibc/sysdeps/arm/sysdep.h | 46 +-- lib/libc/glibc/sysdeps/csky/sysdep.h | 2 +- lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h | 2 +- lib/libc/glibc/sysdeps/generic/dl-sysdep.h | 2 +- lib/libc/glibc/sysdeps/generic/dwarf2.h | 4 +- lib/libc/glibc/sysdeps/generic/libc-lock.h | 2 +- lib/libc/glibc/sysdeps/generic/libc-symver.h | 2 +- .../glibc/sysdeps/generic/single-thread.h | 2 +- lib/libc/glibc/sysdeps/generic/symbol-hacks.h | 3 +- lib/libc/glibc/sysdeps/generic/sysdep.h | 4 +- lib/libc/glibc/sysdeps/generic/tls.h | 22 +- lib/libc/glibc/sysdeps/hppa/crti.S | 2 +- lib/libc/glibc/sysdeps/hppa/crtn.S | 2 +- lib/libc/glibc/sysdeps/hppa/entry.h | 5 - .../hppa/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/hppa/start.S | 2 +- lib/libc/glibc/sysdeps/hppa/sysdep.h | 3 +- lib/libc/glibc/sysdeps/htl/bits/pthread.h | 4 +- .../sysdeps/htl/bits/thread-shared-types.h | 4 +- lib/libc/glibc/sysdeps/htl/libc-lockP.h | 2 +- lib/libc/glibc/sysdeps/htl/pthread.h | 14 +- lib/libc/glibc/sysdeps/i386/crti.S | 2 +- lib/libc/glibc/sysdeps/i386/crtn.S | 2 +- .../sysdeps/i386/htl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/i386/start.S | 15 +- lib/libc/glibc/sysdeps/i386/symbol-hacks.h | 2 +- lib/libc/glibc/sysdeps/i386/sysdep.h | 2 +- lib/libc/glibc/sysdeps/ia64/crti.S | 2 +- lib/libc/glibc/sysdeps/ia64/crtn.S | 2 +- lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h | 2 +- lib/libc/glibc/sysdeps/ia64/dl-sysdep.h | 23 -- lib/libc/glibc/sysdeps/ia64/entry.h | 5 - lib/libc/glibc/sysdeps/ia64/start.S | 3 +- lib/libc/glibc/sysdeps/ia64/sysdep.h | 3 +- lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h | 2 +- lib/libc/glibc/sysdeps/m68k/crti.S | 2 +- lib/libc/glibc/sysdeps/m68k/crtn.S | 2 +- lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h | 2 +- .../m68k/nptl/bits/pthreadtypes-arch.h | 3 +- lib/libc/glibc/sysdeps/m68k/start.S | 2 +- lib/libc/glibc/sysdeps/m68k/symbol-hacks.h | 2 +- lib/libc/glibc/sysdeps/m68k/sysdep.h | 2 +- lib/libc/glibc/sysdeps/mach/i386/sysdep.h | 59 ---- lib/libc/glibc/sysdeps/mach/libc-lock.h | 9 +- lib/libc/glibc/sysdeps/mach/sysdep.h | 5 +- lib/libc/glibc/sysdeps/microblaze/crti.S | 2 +- lib/libc/glibc/sysdeps/microblaze/crtn.S | 2 +- lib/libc/glibc/sysdeps/microblaze/start.S | 2 +- lib/libc/glibc/sysdeps/microblaze/sysdep.h | 2 +- lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h | 2 +- lib/libc/glibc/sysdeps/mips/mips32/crti.S | 2 +- lib/libc/glibc/sysdeps/mips/mips32/crtn.S | 2 +- lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S | 2 +- lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S | 2 +- lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S | 2 +- lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S | 2 +- .../mips/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/mips/start.S | 4 +- lib/libc/glibc/sysdeps/nios2/sysdep.h | 2 +- .../glibc/sysdeps/nptl/bits/pthreadtypes.h | 2 +- .../sysdeps/nptl/bits/thread-shared-types.h | 24 +- lib/libc/glibc/sysdeps/nptl/libc-lock.h | 10 +- lib/libc/glibc/sysdeps/nptl/libc-lockP.h | 5 +- lib/libc/glibc/sysdeps/nptl/pthread.h | 12 +- .../glibc/sysdeps/powerpc/powerpc32/crti.S | 2 +- .../glibc/sysdeps/powerpc/powerpc32/crtn.S | 2 +- .../glibc/sysdeps/powerpc/powerpc32/start.S | 2 +- .../sysdeps/powerpc/powerpc32/symbol-hacks.h | 2 +- .../glibc/sysdeps/powerpc/powerpc32/sysdep.h | 2 +- .../glibc/sysdeps/powerpc/powerpc64/crti.S | 2 +- .../glibc/sysdeps/powerpc/powerpc64/crtn.S | 2 +- .../sysdeps/powerpc/powerpc64/dl-dtprocnum.h | 2 +- .../glibc/sysdeps/powerpc/powerpc64/entry.h | 37 --- .../glibc/sysdeps/powerpc/powerpc64/start.S | 5 +- .../glibc/sysdeps/powerpc/powerpc64/sysdep.h | 18 +- lib/libc/glibc/sysdeps/powerpc/sysdep.h | 2 +- .../riscv/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/riscv/start.S | 2 +- lib/libc/glibc/sysdeps/s390/s390-32/crti.S | 2 +- lib/libc/glibc/sysdeps/s390/s390-32/crtn.S | 2 +- .../glibc/sysdeps/s390/s390-32/dl-sysdep.h | 23 -- lib/libc/glibc/sysdeps/s390/s390-32/start.S | 5 +- .../glibc/sysdeps/s390/s390-32/symbol-hacks.h | 2 +- lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h | 3 +- lib/libc/glibc/sysdeps/s390/s390-64/crti.S | 3 +- lib/libc/glibc/sysdeps/s390/s390-64/crtn.S | 3 +- lib/libc/glibc/sysdeps/s390/s390-64/start.S | 31 +- lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h | 3 +- lib/libc/glibc/sysdeps/sh/crti.S | 2 +- lib/libc/glibc/sysdeps/sh/crtn.S | 2 +- lib/libc/glibc/sysdeps/sh/start.S | 2 +- lib/libc/glibc/sysdeps/sh/sysdep.h | 2 +- lib/libc/glibc/sysdeps/sparc/crti.S | 2 +- lib/libc/glibc/sysdeps/sparc/crtn.S | 2 +- lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h | 2 +- lib/libc/glibc/sysdeps/sparc/dl-sysdep.h | 23 -- lib/libc/glibc/sysdeps/sparc/sparc32/start.S | 3 +- lib/libc/glibc/sysdeps/sparc/sparc64/start.S | 3 +- lib/libc/glibc/sysdeps/sparc/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/arm/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/i386/sysdep.h | 2 +- .../glibc/sysdeps/unix/mips/mips32/sysdep.h | 3 +- .../glibc/sysdeps/unix/mips/mips64/sysdep.h | 3 +- lib/libc/glibc/sysdeps/unix/mips/sysdep.h | 3 +- lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/sh/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/sysdep.h | 22 +- .../unix/sysv/linux/aarch64/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/aarch64/sys/elf.h | 2 +- .../sysdeps/unix/sysv/linux/aarch64/sysdep.h | 52 +--- .../unix/sysv/linux/alpha/bits/typesizes.h | 2 +- .../unix/sysv/linux/alpha/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/alpha/sysdep.h | 45 +-- .../sysdeps/unix/sysv/linux/arc/sysdep.h | 18 +- .../unix/sysv/linux/arm/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/arm/sys/elf.h | 2 +- .../sysdeps/unix/sysv/linux/arm/sysdep.h | 6 +- .../glibc/sysdeps/unix/sysv/linux/bits/stat.h | 2 +- .../sysdeps/unix/sysv/linux/bits/timex.h | 4 +- .../unix/sysv/linux/csky/kernel_stat.h | 2 +- .../sysdeps/unix/sysv/linux/csky/sysdep.h | 50 +-- .../glibc/sysdeps/unix/sysv/linux/dl-sysdep.h | 9 +- .../glibc/sysdeps/unix/sysv/linux/fstat.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/fstat64.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/fstatat.c | 24 +- .../glibc/sysdeps/unix/sysv/linux/fstatat64.c | 37 +-- .../unix/sysv/linux/generic/bits/typesizes.h | 108 ------- .../sysdeps/unix/sysv/linux/generic/sysdep.h | 27 -- .../unix/sysv/linux/generic/xstatver.h | 10 - .../unix/sysv/linux/hppa/kernel-features.h | 5 +- .../sysdeps/unix/sysv/linux/hppa/sysdep.h | 16 +- .../sysdeps/unix/sysv/linux/i386/dl-sysdep.h | 2 +- .../unix/sysv/linux/i386/kernel-features.h | 21 +- .../sysdeps/unix/sysv/linux/i386/sysdep.h | 264 +++------------- .../sysdeps/unix/sysv/linux/ia64/dl-sysdep.h | 6 +- .../unix/sysv/linux/ia64/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/ia64/sysdep.h | 49 +-- .../unix/sysv/linux/include/sys/timex.h | 12 +- .../sysdeps/unix/sysv/linux/kernel-features.h | 34 +- .../sysdeps/unix/sysv/linux/kernel_stat.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/lstat.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/lstat64.c | 2 +- .../unix/sysv/linux/m68k/coldfire/sysdep.h | 2 +- .../unix/sysv/linux/m68k/kernel-features.h | 21 +- .../unix/sysv/linux/m68k/m680x0/sysdep.h | 2 +- .../sysdeps/unix/sysv/linux/m68k/sysdep.h | 14 +- .../sysv/linux/microblaze/kernel-features.h | 9 +- .../unix/sysv/linux/microblaze/kernel_stat.h | 2 +- .../unix/sysv/linux/microblaze/sysdep.h | 12 +- .../unix/sysv/linux/mips/kernel-features.h | 2 +- .../unix/sysv/linux/mips/mips32/sysdep.h | 6 +- .../unix/sysv/linux/mips/mips64/kstat_cp.h | 2 +- .../unix/sysv/linux/mips/mips64/sysdep.h | 6 +- .../sysdeps/unix/sysv/linux/mips/sysdep.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/mknodat.c | 3 +- .../unix/sysv/linux/nios2/kernel_stat.h | 3 +- .../sysdeps/unix/sysv/linux/nios2/sysdep.h | 21 +- .../unix/sysv/linux/powerpc/kernel-features.h | 9 +- .../linux/powerpc/powerpc32/kernel_stat.h | 2 +- .../sysv/linux/powerpc/powerpc64/sysdep.h | 2 +- .../sysdeps/unix/sysv/linux/powerpc/sysdep.h | 42 +-- .../unix/sysv/linux/riscv/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/riscv/sysdep.h | 12 +- .../unix/sysv/linux/s390/bits/typesizes.h | 2 +- .../unix/sysv/linux/s390/kernel-features.h | 21 +- .../unix/sysv/linux/s390/s390-32/sysdep.h | 30 +- .../unix/sysv/linux/s390/s390-64/sysdep.h | 32 +- .../sysdeps/unix/sysv/linux/s390/sys/elf.h | 2 +- .../sysdeps/unix/sysv/linux/s390/sysdep.h | 38 +-- .../unix/sysv/linux/sh/kernel-features.h | 9 +- .../glibc/sysdeps/unix/sysv/linux/sh/sysdep.h | 25 +- .../sysdeps/unix/sysv/linux/single-thread.h | 13 +- .../unix/sysv/linux/sparc/bits/typesizes.h | 2 +- .../unix/sysv/linux/sparc/kernel-features.h | 19 +- .../unix/sysv/linux/sparc/sparc32/sysdep.h | 23 +- .../unix/sysv/linux/sparc/sparc64/kstat_cp.h | 2 +- .../unix/sysv/linux/sparc/sparc64/sysdep.h | 23 +- .../sysdeps/unix/sysv/linux/sparc/sysdep.h | 3 +- lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/stat64.c | 2 +- .../sysdeps/unix/sysv/linux/stat_t64_cp.c | 21 +- .../sysdeps/unix/sysv/linux/stat_t64_cp.h | 2 +- .../unix/sysv/linux/struct_stat_time64.h | 2 +- .../sysdeps/unix/sysv/linux/sys/syscall.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/sys/timex.h | 18 +- .../glibc/sysdeps/unix/sysv/linux/sysdep.h | 2 +- .../unix/sysv/linux/x86/bits/typesizes.h | 2 +- .../sysdeps/unix/sysv/linux/x86/sys/elf.h | 2 +- .../unix/sysv/linux/x86_64/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/x86_64/sysdep.h | 46 +-- .../unix/sysv/linux/x86_64/x32/sysdep.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/xstatver.h | 11 +- lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h | 2 +- .../sysdeps/wordsize-32/divdi3-symbol-hacks.h | 5 +- .../sysdeps/x86/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/x86/sysdep.h | 12 +- lib/libc/glibc/sysdeps/x86_64/crti.S | 2 +- lib/libc/glibc/sysdeps/x86_64/crtn.S | 2 +- lib/libc/glibc/sysdeps/x86_64/start.S | 3 +- lib/libc/glibc/sysdeps/x86_64/sysdep.h | 33 +- lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h | 8 +- 264 files changed, 1248 insertions(+), 1997 deletions(-) delete mode 100644 lib/libc/glibc/README.md delete mode 100644 lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/alpha/dl-sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/arm/dl-sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/ia64/dl-sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/mach/i386/sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/powerpc/powerpc64/entry.h delete mode 100644 lib/libc/glibc/sysdeps/s390/s390-32/dl-sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/sparc/dl-sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/typesizes.h delete mode 100644 lib/libc/glibc/sysdeps/unix/sysv/linux/generic/sysdep.h delete mode 100644 lib/libc/glibc/sysdeps/unix/sysv/linux/generic/xstatver.h diff --git a/lib/libc/glibc/README.md b/lib/libc/glibc/README.md deleted file mode 100644 index e5fe99a532..0000000000 --- a/lib/libc/glibc/README.md +++ /dev/null @@ -1,9 +0,0 @@ -glibc headers are slightly patched for backwards compatibility. This is not -good, because it requires to maintain our patchset whlist upgrading glibc. - -Until universal headers are real and this file can be removed, these commits -need to be cherry-picked in the future glibc header upgrades: - -- 39083c31a550ed80f369f60d35791e98904b8096 -- a89813ef282c092a9caf699731c7faaf485acabe -- 3eaca9bbc6fee4b6be0f22b844f7d3214222f434 diff --git a/lib/libc/glibc/bits/byteswap.h b/lib/libc/glibc/bits/byteswap.h index 6438a8b389..456dd177e1 100644 --- a/lib/libc/glibc/bits/byteswap.h +++ b/lib/libc/glibc/bits/byteswap.h @@ -1,5 +1,5 @@ /* Macros and inline functions to swap the order of bytes in integer values. - Copyright (C) 1997-2021 Free Software Foundation, Inc. + Copyright (C) 1997-2023 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 diff --git a/lib/libc/glibc/bits/floatn-common.h b/lib/libc/glibc/bits/floatn-common.h index b43c9532d8..23306c9209 100644 --- a/lib/libc/glibc/bits/floatn-common.h +++ b/lib/libc/glibc/bits/floatn-common.h @@ -1,6 +1,6 @@ /* Macros to control TS 18661-3 glibc features where the same definitions are appropriate for all platforms. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 @@ -78,7 +78,7 @@ or _FloatNx types, if __HAVE_ is 1. The corresponding literal suffixes exist since GCC 7, for C only. */ # if __HAVE_FLOAT16 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) /* No corresponding suffix available for this type. */ # define __f16(x) ((_Float16) x##f) # else @@ -87,7 +87,7 @@ # endif # if __HAVE_FLOAT32 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # define __f32(x) x##f # else # define __f32(x) x##f32 @@ -95,7 +95,7 @@ # endif # if __HAVE_FLOAT64 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # ifdef __NO_LONG_DOUBLE_MATH # define __f64(x) x##l # else @@ -107,7 +107,7 @@ # endif # if __HAVE_FLOAT32X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # define __f32x(x) x # else # define __f32x(x) x##f32x @@ -115,7 +115,7 @@ # endif # if __HAVE_FLOAT64X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # if __HAVE_FLOAT64X_LONG_DOUBLE # define __f64x(x) x##l # else @@ -127,7 +127,7 @@ # endif # if __HAVE_FLOAT128X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # error "_Float128X supported but no constant suffix" # else # define __f128x(x) x##f128x @@ -136,7 +136,7 @@ /* Defined to a complex type if __HAVE_ is 1. */ # if __HAVE_FLOAT16 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # define __CFLOAT16 __cfloat16 # else @@ -145,7 +145,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # endif # if __HAVE_FLOAT32 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # define __CFLOAT32 _Complex float # else # define __CFLOAT32 _Complex _Float32 @@ -153,7 +153,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # endif # if __HAVE_FLOAT64 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # ifdef __NO_LONG_DOUBLE_MATH # define __CFLOAT64 _Complex long double # else @@ -165,7 +165,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # endif # if __HAVE_FLOAT32X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # define __CFLOAT32X _Complex double # else # define __CFLOAT32X _Complex _Float32x @@ -173,7 +173,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # endif # if __HAVE_FLOAT64X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # if __HAVE_FLOAT64X_LONG_DOUBLE # define __CFLOAT64X _Complex long double # else @@ -185,7 +185,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # endif # if __HAVE_FLOAT128X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # error "_Float128X supported but no complex type" # else # define __CFLOAT128X _Complex _Float128x @@ -195,7 +195,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); /* The remaining of this file provides support for older compilers. */ # if __HAVE_FLOAT16 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef float _Float16 __attribute__ ((__mode__ (__HF__))); # endif @@ -210,7 +210,7 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__))); # if __HAVE_FLOAT32 -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef float _Float32; # endif @@ -234,7 +234,7 @@ typedef float _Float32; # ifdef __NO_LONG_DOUBLE_MATH -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef long double _Float64; # endif @@ -247,7 +247,7 @@ typedef long double _Float64; # else -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef double _Float64; # endif @@ -264,7 +264,7 @@ typedef double _Float64; # if __HAVE_FLOAT32X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef double _Float32x; # endif @@ -281,7 +281,7 @@ typedef double _Float32x; # if __HAVE_FLOAT64X_LONG_DOUBLE -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef long double _Float64x; # endif @@ -294,7 +294,7 @@ typedef long double _Float64x; # else -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef _Float128 _Float64x; # endif @@ -311,7 +311,7 @@ typedef _Float128 _Float64x; # if __HAVE_FLOAT128X -# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) # error "_Float128x supported but no type" # endif diff --git a/lib/libc/glibc/bits/libc-header-start.h b/lib/libc/glibc/bits/libc-header-start.h index 47f39105a2..73af2af965 100644 --- a/lib/libc/glibc/bits/libc-header-start.h +++ b/lib/libc/glibc/bits/libc-header-start.h @@ -1,5 +1,5 @@ /* Handle feature test macros at the start of a header. - Copyright (C) 2016-2021 Free Software Foundation, Inc. + Copyright (C) 2016-2023 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 diff --git a/lib/libc/glibc/bits/long-double.h b/lib/libc/glibc/bits/long-double.h index fdb574d937..74edf3b089 100644 --- a/lib/libc/glibc/bits/long-double.h +++ b/lib/libc/glibc/bits/long-double.h @@ -1,5 +1,5 @@ /* Properties of long double type. - Copyright (C) 2016-2021 Free Software Foundation, Inc. + Copyright (C) 2016-2023 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 diff --git a/lib/libc/glibc/bits/select.h b/lib/libc/glibc/bits/select.h index 8204bbd4c4..061d67ff98 100644 --- a/lib/libc/glibc/bits/select.h +++ b/lib/libc/glibc/bits/select.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* Copyright (C) 1997-2023 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 diff --git a/lib/libc/glibc/bits/signum-generic.h b/lib/libc/glibc/bits/signum-generic.h index 4e481c148a..e01b4dc9cb 100644 --- a/lib/libc/glibc/bits/signum-generic.h +++ b/lib/libc/glibc/bits/signum-generic.h @@ -1,5 +1,5 @@ /* Signal number constants. Generic template. - Copyright (C) 1991-2021 Free Software Foundation, Inc. + Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/bits/stat.h b/lib/libc/glibc/bits/stat.h index 3b04d9677f..8a6ca297ce 100644 --- a/lib/libc/glibc/bits/stat.h +++ b/lib/libc/glibc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/bits/stdint-intn.h b/lib/libc/glibc/bits/stdint-intn.h index 8a1cf5db9d..3d943a8d9d 100644 --- a/lib/libc/glibc/bits/stdint-intn.h +++ b/lib/libc/glibc/bits/stdint-intn.h @@ -1,5 +1,5 @@ /* Define intN_t types. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/bits/stdlib-bsearch.h b/lib/libc/glibc/bits/stdlib-bsearch.h index 4132dc6af0..4dcf90c99a 100644 --- a/lib/libc/glibc/bits/stdlib-bsearch.h +++ b/lib/libc/glibc/bits/stdlib-bsearch.h @@ -1,5 +1,5 @@ /* Perform binary search - inline version. - Copyright (C) 1991-2021 Free Software Foundation, Inc. + Copyright (C) 1991-2023 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 @@ -29,14 +29,23 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, while (__l < __u) { __idx = (__l + __u) / 2; - __p = (void *) (((const char *) __base) + (__idx * __size)); + __p = (const void *) (((const char *) __base) + (__idx * __size)); __comparison = (*__compar) (__key, __p); if (__comparison < 0) __u = __idx; else if (__comparison > 0) __l = __idx + 1; else - return (void *) __p; + { +#if __GNUC_PREREQ(4, 6) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-qual" +#endif + return (void *) __p; +#if __GNUC_PREREQ(4, 6) +# pragma GCC diagnostic pop +#endif + } } return NULL; diff --git a/lib/libc/glibc/bits/time64.h b/lib/libc/glibc/bits/time64.h index af3e731684..723db1ed16 100644 --- a/lib/libc/glibc/bits/time64.h +++ b/lib/libc/glibc/bits/time64.h @@ -1,5 +1,5 @@ /* bits/time64.h -- underlying types for __time64_t. Generic version. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 diff --git a/lib/libc/glibc/bits/timesize.h b/lib/libc/glibc/bits/timesize.h index 11a9c9a499..700653a06f 100644 --- a/lib/libc/glibc/bits/timesize.h +++ b/lib/libc/glibc/bits/timesize.h @@ -1,5 +1,5 @@ /* Bit size of the time_t type at glibc build time, general case. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 @@ -16,7 +16,5 @@ License along with the GNU C Library; if not, see . */ -#include - /* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE __WORDSIZE +#define __TIMESIZE 64 diff --git a/lib/libc/glibc/bits/types/struct_sched_param.h b/lib/libc/glibc/bits/types/struct_sched_param.h index 78f3d0b556..7b08044472 100644 --- a/lib/libc/glibc/bits/types/struct_sched_param.h +++ b/lib/libc/glibc/bits/types/struct_sched_param.h @@ -1,5 +1,5 @@ /* Sched parameter structure. Generic version. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/bits/typesizes.h b/lib/libc/glibc/bits/typesizes.h index 63564b2fa1..5dd1700649 100644 --- a/lib/libc/glibc/bits/typesizes.h +++ b/lib/libc/glibc/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Generic version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/bits/uintn-identity.h b/lib/libc/glibc/bits/uintn-identity.h index 6eb4964a1d..c2d523c5a7 100644 --- a/lib/libc/glibc/bits/uintn-identity.h +++ b/lib/libc/glibc/bits/uintn-identity.h @@ -1,5 +1,5 @@ /* Inline functions to return unsigned integer values unchanged. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/bits/waitflags.h b/lib/libc/glibc/bits/waitflags.h index 03d4db2de3..291a27153f 100644 --- a/lib/libc/glibc/bits/waitflags.h +++ b/lib/libc/glibc/bits/waitflags.h @@ -1,5 +1,5 @@ /* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1992-2021 Free Software Foundation, Inc. + Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/bits/waitstatus.h b/lib/libc/glibc/bits/waitstatus.h index baaf96ac04..ec7c076b00 100644 --- a/lib/libc/glibc/bits/waitstatus.h +++ b/lib/libc/glibc/bits/waitstatus.h @@ -1,5 +1,5 @@ /* Definitions of status bits for `wait' et al. - Copyright (C) 1992-2021 Free Software Foundation, Inc. + Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/csu/errno.c b/lib/libc/glibc/csu/errno.c index 946673585b..34f490614e 100644 --- a/lib/libc/glibc/csu/errno.c +++ b/lib/libc/glibc/csu/errno.c @@ -1,5 +1,5 @@ /* Definition of `errno' variable. Canonical version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/debug/stack_chk_fail_local.c b/lib/libc/glibc/debug/stack_chk_fail_local.c index c9251c2411..68b6908ae3 100644 --- a/lib/libc/glibc/debug/stack_chk_fail_local.c +++ b/lib/libc/glibc/debug/stack_chk_fail_local.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2021 Free Software Foundation, Inc. +/* Copyright (C) 2005-2023 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 diff --git a/lib/libc/glibc/elf/elf.h b/lib/libc/glibc/elf/elf.h index 4738dfa28f..89fc8021e9 100644 --- a/lib/libc/glibc/elf/elf.h +++ b/lib/libc/glibc/elf/elf.h @@ -1,5 +1,5 @@ /* This file defines standard ELF types, structures, and macros. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 @@ -210,7 +210,7 @@ typedef struct #define EM_68HC12 53 /* Motorola M68HC12 */ #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */ #define EM_PCP 55 /* Siemens PCP */ -#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ +#define EM_NCPU 56 /* Sony nCPU embedded RISC */ #define EM_NDR1 57 /* Denso NDR1 microprocessor */ #define EM_STARCORE 58 /* Motorola Start*Core processor */ #define EM_ME16 59 /* Toyota ME16 processor */ @@ -358,8 +358,9 @@ typedef struct #define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */ #define EM_CSKY 252 /* C-SKY */ +#define EM_LOONGARCH 258 /* LoongArch */ -#define EM_NUM 253 +#define EM_NUM 259 /* Old spellings/synonyms. */ @@ -443,7 +444,8 @@ typedef struct #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ #define SHT_GROUP 17 /* Section group */ #define SHT_SYMTAB_SHNDX 18 /* Extended section indices */ -#define SHT_NUM 19 /* Number of defined types. */ +#define SHT_RELR 19 /* RELR relative relocations */ +#define SHT_NUM 20 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific. */ #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ #define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ @@ -504,6 +506,7 @@ typedef struct /* Legal values for ch_type (compression algorithm). */ #define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE algorithm. */ +#define ELFCOMPRESS_ZSTD 2 /* Zstandard algorithm. */ #define ELFCOMPRESS_LOOS 0x60000000 /* Start of OS-specific. */ #define ELFCOMPRESS_HIOS 0x6fffffff /* End of OS-specific. */ #define ELFCOMPRESS_LOPROC 0x70000000 /* Start of processor-specific. */ @@ -556,7 +559,7 @@ typedef struct /* Possible bitmasks for si_flags. */ #define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */ -#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */ +#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-through symbol for translator */ #define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */ #define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy loaded */ @@ -662,6 +665,11 @@ typedef struct Elf64_Sxword r_addend; /* Addend */ } Elf64_Rela; +/* RELR relocation table entry */ + +typedef Elf32_Word Elf32_Relr; +typedef Elf64_Xword Elf64_Relr; + /* How to extract and insert information held in the r_info field. */ #define ELF32_R_SYM(val) ((val) >> 8) @@ -720,6 +728,7 @@ typedef struct #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ #define PT_GNU_PROPERTY 0x6474e553 /* GNU property */ +#define PT_GNU_SFRAME 0x6474e554 /* SFrame segment. */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ @@ -801,6 +810,7 @@ typedef struct #define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block. */ #define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation. */ +#define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data. */ #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ #define NT_ARM_TLS 0x401 /* ARM TLS register */ #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ @@ -822,6 +832,15 @@ typedef struct #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */ #define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */ #define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */ +#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */ +#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and + status registers. */ +#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD + Extension registers. */ +#define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced + SIMD Extension registers. */ +#define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary + Translation registers. */ /* Legal values for the note segment descriptor types for object files. */ @@ -887,7 +906,10 @@ typedef struct #define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ #define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ #define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */ -#define DT_NUM 35 /* Number used */ +#define DT_RELRSZ 35 /* Total size of RELR relative relocations */ +#define DT_RELR 36 /* Address of RELR relative relocations */ +#define DT_RELRENT 37 /* Size of one RELR relative relocaction */ +#define DT_NUM 38 /* Number used */ #define DT_LOOS 0x6000000d /* Start of OS-specific */ #define DT_HIOS 0x6ffff000 /* End of OS-specific */ #define DT_LOPROC 0x70000000 /* Start of processor-specific */ @@ -1044,7 +1066,8 @@ typedef struct /* Legal values for vd_flags (version information flags). */ #define VER_FLG_BASE 0x1 /* Version definition of file itself */ -#define VER_FLG_WEAK 0x2 /* Weak version identifier */ +#define VER_FLG_WEAK 0x2 /* Weak version identifier. Also + used by vna_flags below. */ /* Versym symbol index values. */ #define VER_NDX_LOCAL 0 /* Symbol is local. */ @@ -1122,10 +1145,6 @@ typedef struct } Elf64_Vernaux; -/* Legal values for vna_flags. */ -#define VER_FLG_WEAK 0x2 /* Weak version identifier */ - - /* Auxiliary vector. */ /* This vector is normally only used by the program interpreter. The @@ -1205,6 +1224,9 @@ typedef struct #define AT_HWCAP2 26 /* More machine-dependent hints about processor capabilities. */ +#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size. */ +#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment. */ + #define AT_EXECFN 31 /* Filename of executable. */ /* Pointer to the global system page used for system calls and other @@ -1231,8 +1253,7 @@ typedef struct #define AT_L3_CACHESIZE 46 #define AT_L3_CACHEGEOMETRY 47 -#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery - (AArch64). */ +#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery */ /* Note section contents. Each entry in the note section begins with a header of a fixed form. */ @@ -1259,6 +1280,8 @@ typedef struct /* Note entries for GNU systems have this name. */ #define ELF_NOTE_GNU "GNU" +/* Note entries for freedesktop.org have this name. */ +#define ELF_NOTE_FDO "FDO" /* Defined types of notes for Solaris. */ @@ -1302,6 +1325,10 @@ typedef struct /* Program property. */ #define NT_GNU_PROPERTY_TYPE_0 5 +/* Packaging metadata as defined on + https://systemd.io/COREDUMP_PACKAGE_METADATA/ */ +#define NT_FDO_PACKAGING_METADATA 0xcafe1a7e + /* Note section name of program property. */ #define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property" @@ -1312,6 +1339,23 @@ typedef struct /* No copy relocation on protected data symbol. */ #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 +/* A 4-byte unsigned integer property: A bit is set if it is set in all + relocatable inputs. */ +#define GNU_PROPERTY_UINT32_AND_LO 0xb0000000 +#define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff + +/* A 4-byte unsigned integer property: A bit is set if it is set in any + relocatable inputs. */ +#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000 +#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff + +/* The needed properties by the object file. */ +#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO + +/* Set if the object file requires canonical function pointers and + cannot be used with copy relocation. */ +#define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0) + /* Processor-specific semantics, lo */ #define GNU_PROPERTY_LOPROC 0xc0000000 /* Processor-specific semantics, hi */ @@ -2871,6 +2915,9 @@ enum #define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */ #define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */ +/* MTE memory tag segment type. */ +#define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 2) + /* AArch64 specific values for the Dyn d_tag field. */ #define DT_AARCH64_BTI_PLT (DT_LOPROC + 1) #define DT_AARCH64_PAC_PLT (DT_LOPROC + 3) @@ -3896,6 +3943,8 @@ enum #define EF_RISCV_FLOAT_ABI_SINGLE 0x0002 #define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004 #define EF_RISCV_FLOAT_ABI_QUAD 0x0006 +#define EF_RISCV_RVE 0x0008 +#define EF_RISCV_TSO 0x0010 /* RISC-V relocations. */ #define R_RISCV_NONE 0 @@ -3953,8 +4002,24 @@ enum #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 #define R_RISCV_IRELATIVE 58 +#define R_RISCV_PLT32 59 +#define R_RISCV_SET_ULEB128 60 +#define R_RISCV_SUB_ULEB128 61 -#define R_RISCV_NUM 59 +#define R_RISCV_NUM 62 + +/* RISC-V specific values for the st_other field. */ +#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling + convention */ + +/* RISC-V specific values for the sh_type field. */ +#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3) + +/* RISC-V specific values for the p_type field. */ +#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3) + +/* RISC-V specific values for the d_tag field. */ +#define DT_RISCV_VARIANT_CC (DT_LOPROC + 1) /* BPF specific declarations. */ @@ -4034,13 +4099,130 @@ enum #define R_NDS32_TLS_TPOFF 102 #define R_NDS32_TLS_DESC 119 +/* LoongArch ELF Flags */ +#define EF_LARCH_ABI_MODIFIER_MASK 0x07 +#define EF_LARCH_ABI_SOFT_FLOAT 0x01 +#define EF_LARCH_ABI_SINGLE_FLOAT 0x02 +#define EF_LARCH_ABI_DOUBLE_FLOAT 0x03 +#define EF_LARCH_OBJABI_V1 0x40 + +/* LoongArch specific dynamic relocations */ +#define R_LARCH_NONE 0 +#define R_LARCH_32 1 +#define R_LARCH_64 2 +#define R_LARCH_RELATIVE 3 +#define R_LARCH_COPY 4 +#define R_LARCH_JUMP_SLOT 5 +#define R_LARCH_TLS_DTPMOD32 6 +#define R_LARCH_TLS_DTPMOD64 7 +#define R_LARCH_TLS_DTPREL32 8 +#define R_LARCH_TLS_DTPREL64 9 +#define R_LARCH_TLS_TPREL32 10 +#define R_LARCH_TLS_TPREL64 11 +#define R_LARCH_IRELATIVE 12 + +/* Reserved for future relocs that the dynamic linker must understand. */ + +/* used by the static linker for relocating .text. */ +#define R_LARCH_MARK_LA 20 +#define R_LARCH_MARK_PCREL 21 +#define R_LARCH_SOP_PUSH_PCREL 22 +#define R_LARCH_SOP_PUSH_ABSOLUTE 23 +#define R_LARCH_SOP_PUSH_DUP 24 +#define R_LARCH_SOP_PUSH_GPREL 25 +#define R_LARCH_SOP_PUSH_TLS_TPREL 26 +#define R_LARCH_SOP_PUSH_TLS_GOT 27 +#define R_LARCH_SOP_PUSH_TLS_GD 28 +#define R_LARCH_SOP_PUSH_PLT_PCREL 29 +#define R_LARCH_SOP_ASSERT 30 +#define R_LARCH_SOP_NOT 31 +#define R_LARCH_SOP_SUB 32 +#define R_LARCH_SOP_SL 33 +#define R_LARCH_SOP_SR 34 +#define R_LARCH_SOP_ADD 35 +#define R_LARCH_SOP_AND 36 +#define R_LARCH_SOP_IF_ELSE 37 +#define R_LARCH_SOP_POP_32_S_10_5 38 +#define R_LARCH_SOP_POP_32_U_10_12 39 +#define R_LARCH_SOP_POP_32_S_10_12 40 +#define R_LARCH_SOP_POP_32_S_10_16 41 +#define R_LARCH_SOP_POP_32_S_10_16_S2 42 +#define R_LARCH_SOP_POP_32_S_5_20 43 +#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44 +#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45 +#define R_LARCH_SOP_POP_32_U 46 + +/* used by the static linker for relocating non .text. */ +#define R_LARCH_ADD8 47 +#define R_LARCH_ADD16 48 +#define R_LARCH_ADD24 49 +#define R_LARCH_ADD32 50 +#define R_LARCH_ADD64 51 +#define R_LARCH_SUB8 52 +#define R_LARCH_SUB16 53 +#define R_LARCH_SUB24 54 +#define R_LARCH_SUB32 55 +#define R_LARCH_SUB64 56 +#define R_LARCH_GNU_VTINHERIT 57 +#define R_LARCH_GNU_VTENTRY 58 + +/* reserved 59-63 */ + +#define R_LARCH_B16 64 +#define R_LARCH_B21 65 +#define R_LARCH_B26 66 +#define R_LARCH_ABS_HI20 67 +#define R_LARCH_ABS_LO12 68 +#define R_LARCH_ABS64_LO20 69 +#define R_LARCH_ABS64_HI12 70 +#define R_LARCH_PCALA_HI20 71 +#define R_LARCH_PCALA_LO12 72 +#define R_LARCH_PCALA64_LO20 73 +#define R_LARCH_PCALA64_HI12 74 +#define R_LARCH_GOT_PC_HI20 75 +#define R_LARCH_GOT_PC_LO12 76 +#define R_LARCH_GOT64_PC_LO20 77 +#define R_LARCH_GOT64_PC_HI12 78 +#define R_LARCH_GOT_HI20 79 +#define R_LARCH_GOT_LO12 80 +#define R_LARCH_GOT64_LO20 81 +#define R_LARCH_GOT64_HI12 82 +#define R_LARCH_TLS_LE_HI20 83 +#define R_LARCH_TLS_LE_LO12 84 +#define R_LARCH_TLS_LE64_LO20 85 +#define R_LARCH_TLS_LE64_HI12 86 +#define R_LARCH_TLS_IE_PC_HI20 87 +#define R_LARCH_TLS_IE_PC_LO12 88 +#define R_LARCH_TLS_IE64_PC_LO20 89 +#define R_LARCH_TLS_IE64_PC_HI12 90 +#define R_LARCH_TLS_IE_HI20 91 +#define R_LARCH_TLS_IE_LO12 92 +#define R_LARCH_TLS_IE64_LO20 93 +#define R_LARCH_TLS_IE64_HI12 94 +#define R_LARCH_TLS_LD_PC_HI20 95 +#define R_LARCH_TLS_LD_HI20 96 +#define R_LARCH_TLS_GD_PC_HI20 97 +#define R_LARCH_TLS_GD_HI20 98 +#define R_LARCH_32_PCREL 99 +#define R_LARCH_RELAX 100 + +/* ARC specific declarations. */ + +/* Processor specific flags for the Ehdr e_flags field. */ +#define EF_ARC_MACH_MSK 0x000000ff +#define EF_ARC_OSABI_MSK 0x00000f00 +#define EF_ARC_ALL_MSK (EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK) + +/* Processor specific values for the Shdr sh_type field. */ +#define SHT_ARC_ATTRIBUTES (SHT_LOPROC + 1) /* ARC attributes section. */ + /* ARCompact/ARCv2 specific relocs. */ #define R_ARC_NONE 0x0 #define R_ARC_8 0x1 #define R_ARC_16 0x2 #define R_ARC_24 0x3 #define R_ARC_32 0x4 -#define R_ARC_B26 0x5 + #define R_ARC_B22_PCREL 0x6 #define R_ARC_H30 0x7 #define R_ARC_N8 0x8 @@ -4080,16 +4262,23 @@ enum #define R_ARC_SECTOFF_ME_2 0x2A #define R_ARC_SECTOFF_1 0x2B #define R_ARC_SECTOFF_2 0x2C +#define R_ARC_SDA_12 0x2D +#define R_ARC_SDA16_ST2 0x30 +#define R_ARC_32_PCREL 0x31 #define R_ARC_PC32 0x32 #define R_ARC_GOTPC32 0x33 #define R_ARC_PLT32 0x34 #define R_ARC_COPY 0x35 #define R_ARC_GLOB_DAT 0x36 -#define R_ARC_JUMP_SLOT 0x37 +#define R_ARC_JMP_SLOT 0x37 #define R_ARC_RELATIVE 0x38 #define R_ARC_GOTOFF 0x39 #define R_ARC_GOTPC 0x3A #define R_ARC_GOT32 0x3B +#define R_ARC_S21W_PCREL_PLT 0x3C +#define R_ARC_S25H_PCREL_PLT 0x3D + +#define R_ARC_JLI_SECTOFF 0x3F #define R_ARC_TLS_DTPMOD 0x42 #define R_ARC_TLS_DTPOFF 0x43 @@ -4098,8 +4287,48 @@ enum #define R_ARC_TLS_GD_LD 0x46 #define R_ARC_TLS_GD_CALL 0x47 #define R_ARC_TLS_IE_GOT 0x48 -#define R_ARC_TLS_DTPOFF_S9 0x4a -#define R_ARC_TLS_LE_S9 0x4a -#define R_ARC_TLS_LE_32 0x4b +#define R_ARC_TLS_DTPOFF_S9 0x49 +#define R_ARC_TLS_LE_S9 0x4A +#define R_ARC_TLS_LE_32 0x4B +#define R_ARC_S25W_PCREL_PLT 0x4C +#define R_ARC_S21H_PCREL_PLT 0x4D +#define R_ARC_NPS_CMEM16 0x4E + +/* OpenRISC 1000 specific relocs. */ +#define R_OR1K_NONE 0 +#define R_OR1K_32 1 +#define R_OR1K_16 2 +#define R_OR1K_8 3 +#define R_OR1K_LO_16_IN_INSN 4 +#define R_OR1K_HI_16_IN_INSN 5 +#define R_OR1K_INSN_REL_26 6 +#define R_OR1K_GNU_VTENTRY 7 +#define R_OR1K_GNU_VTINHERIT 8 +#define R_OR1K_32_PCREL 9 +#define R_OR1K_16_PCREL 10 +#define R_OR1K_8_PCREL 11 +#define R_OR1K_GOTPC_HI16 12 +#define R_OR1K_GOTPC_LO16 13 +#define R_OR1K_GOT16 14 +#define R_OR1K_PLT26 15 +#define R_OR1K_GOTOFF_HI16 16 +#define R_OR1K_GOTOFF_LO16 17 +#define R_OR1K_COPY 18 +#define R_OR1K_GLOB_DAT 19 +#define R_OR1K_JMP_SLOT 20 +#define R_OR1K_RELATIVE 21 +#define R_OR1K_TLS_GD_HI16 22 +#define R_OR1K_TLS_GD_LO16 23 +#define R_OR1K_TLS_LDM_HI16 24 +#define R_OR1K_TLS_LDM_LO16 25 +#define R_OR1K_TLS_LDO_HI16 26 +#define R_OR1K_TLS_LDO_LO16 27 +#define R_OR1K_TLS_IE_HI16 28 +#define R_OR1K_TLS_IE_LO16 29 +#define R_OR1K_TLS_LE_HI16 30 +#define R_OR1K_TLS_LE_LO16 31 +#define R_OR1K_TLS_TPOFF 32 +#define R_OR1K_TLS_DTPOFF 33 +#define R_OR1K_TLS_DTPMOD 34 #endif /* elf.h */ diff --git a/lib/libc/glibc/include/libc-pointer-arith.h b/lib/libc/glibc/include/libc-pointer-arith.h index 04ba537617..aa57e598d5 100644 --- a/lib/libc/glibc/include/libc-pointer-arith.h +++ b/lib/libc/glibc/include/libc-pointer-arith.h @@ -1,5 +1,5 @@ /* Helper macros for pointer arithmetic. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 @@ -60,4 +60,12 @@ #define PTR_ALIGN_UP(base, size) \ ((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size))) +/* Check if BASE is aligned on SIZE */ +#define PTR_IS_ALIGNED(base, size) \ + ((((uintptr_t) (base)) & (size - 1)) == 0) + +/* Returns the ptrdiff_t difference between P1 and P2. */ +#define PTR_DIFF(p1, p2) \ + ((ptrdiff_t)((uintptr_t)(p1) - (uintptr_t)(p2))) + #endif diff --git a/lib/libc/glibc/include/libc-symbols.h b/lib/libc/glibc/include/libc-symbols.h index d41ecf4384..5794614488 100644 --- a/lib/libc/glibc/include/libc-symbols.h +++ b/lib/libc/glibc/include/libc-symbols.h @@ -1,6 +1,6 @@ /* Support macros for making weak and strong aliases for symbols, and for using symbol sets and linker warnings with GNU ld. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 @@ -155,14 +155,6 @@ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \ __attribute_copy__ (name); -/* Same as WEAK_ALIAS, but mark symbol as hidden. */ -# define weak_hidden_alias(name, aliasname) \ - _weak_hidden_alias (name, aliasname) -# define _weak_hidden_alias(name, aliasname) \ - extern __typeof (name) aliasname \ - __attribute__ ((weak, alias (#name), __visibility__ ("hidden"))) \ - __attribute_copy__ (name); - /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ # define weak_extern(symbol) _weak_extern (weak symbol) # define _weak_extern(expr) _Pragma (#expr) @@ -245,105 +237,32 @@ requires at runtime the shared libraries from the glibc version used \ for linking") #endif -/* Resource Freeing Hooks: - - Normally a process exits and the OS cleans up any allocated - memory. However, when tooling like mtrace or valgrind is monitoring - the process we need to free all resources that are part of the - process in order to provide the consistency required to track - memory leaks. - - A single public API exists and is __libc_freeres(), and this is used - by applications like valgrind to freee resouces. - - There are 3 cases: - - (a) __libc_freeres - - In this case all you need to do is define the freeing routine: - - foo.c: - libfoo_freeres_fn (foo_freeres) - { - complex_free (mem); - } - - This ensures the function is called at the right point to free - resources. - - (b) __libc_freeres_ptr - - The framework for (a) iterates over the list of pointers-to-free - in (b) and frees them. - - foo.c: - libc_freeres_ptr (static char *foo_buffer); - - Freeing these resources alaways happens last and is equivalent - to registering a function that does 'free (foo_buffer)'. - - (c) Explicit lists of free routines to call or objects to free. - - It is the intended goal to remove (a) and (b) which have some - non-determinism based on link order, and instead use explicit - lists of functions and frees to resolve cleanup ordering issues - and make it easy to debug and maintain. - - As of today the following subsystems use (c): - - Per-thread cleanup: - * malloc/thread-freeres.c - - libdl cleanup: - * dlfcn/dlfreeres.c - - libpthread cleanup: - * nptl/nptlfreeres.c - - So if you need any shutdown routines to run you should add them - directly to the appropriate subsystem's shutdown list. */ - -/* Resource pointers to free in libc.so. */ -#define libc_freeres_ptr(decl) \ - __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \ - decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment))) - -/* Resource freeing functions from libc.so go in this section. */ -#define __libc_freeres_fn_section \ - __attribute__ ((__used__, section ("__libc_freeres_fn"))) - -/* Resource freeing functions for libc.so. */ -#define libc_freeres_fn(name) \ - static void name (void) __attribute_used__ __libc_freeres_fn_section; \ - text_set_element (__libc_subfreeres, name); \ - static void name (void) - /* Declare SYMBOL to be TYPE (`function' or `object') of SIZE bytes alias to ORIGINAL, when the assembler supports such declarations (such as in ELF). This is only necessary when defining something in assembly, or playing funny alias games where the size should be other than what the compiler thinks it is. */ -#define declare_symbol_alias(symbol, original, type, size) \ - declare_symbol_alias_1 (symbol, original, type, size) +#define declare_object_symbol_alias(symbol, original, size) \ + declare_object_symbol_alias_1 (symbol, original, size) #ifdef __ASSEMBLER__ -# define declare_symbol_alias_1(symbol, original, type, size) \ - strong_alias (original, symbol); \ - .type C_SYMBOL_NAME (symbol), %##type; \ - .size C_SYMBOL_NAME (symbol), size +# define declare_object_symbol_alias_1(symbol, original, s_size) \ + strong_alias (original, symbol) ASM_LINE_SEP \ + .type C_SYMBOL_NAME (symbol), %object ASM_LINE_SEP \ + .size C_SYMBOL_NAME (symbol), s_size ASM_LINE_SEP #else /* Not __ASSEMBLER__. */ -# define declare_symbol_alias_1(symbol, original, type, size) \ - asm (".globl " __SYMBOL_PREFIX #symbol \ - "\n\t" declare_symbol_alias_1_alias (symbol, original) \ - "\n\t.type " __SYMBOL_PREFIX #symbol ", " \ - "%" #type \ - "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size); # ifdef HAVE_ASM_SET_DIRECTIVE -# define declare_symbol_alias_1_alias(symbol, original) \ - ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX #original +# define declare_object_symbol_alias_1(symbol, original, size) \ + asm (".global " __SYMBOL_PREFIX # symbol "\n" \ + ".type " __SYMBOL_PREFIX # symbol ", %object\n" \ + ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX original "\n" \ + ".size " __SYMBOL_PREFIX #symbol ", " #size "\n"); # else -# define declare_symbol_alias_1_alias(symbol, original) \ - __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX #original +# define declare_object_symbol_alias_1(symbol, original, size) \ + asm (".global " __SYMBOL_PREFIX # symbol "\n" \ + ".type " __SYMBOL_PREFIX # symbol ", %object\n" \ + __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX original "\n" \ + ".size " __SYMBOL_PREFIX #symbol ", " #size "\n"); # endif /* HAVE_ASM_SET_DIRECTIVE */ #endif /* __ASSEMBLER__ */ @@ -419,7 +338,7 @@ for linking") _set_symbol_version (real, #name "@@" #version) # endif -/* Evalutes to a string literal for VERSION in LIB. */ +/* Evaluates to a string literal for VERSION in LIB. */ # define symbol_version_string(lib, version) \ _symbol_version_stringify_1 (VERSION_##lib##_##version) # define _symbol_version_stringify_1(arg) _symbol_version_stringify_2 (arg) @@ -532,11 +451,15 @@ for linking") __attribute__ ((visibility ("hidden"), ##attrs)) # define hidden_proto(name, attrs...) \ __hidden_proto (name, , __GI_##name, ##attrs) +# define hidden_proto_alias(name, alias, attrs...) \ + __hidden_proto_alias (name, , alias, ##attrs) # define hidden_tls_proto(name, attrs...) \ __hidden_proto (name, __thread, __GI_##name, ##attrs) # define __hidden_proto(name, thread, internal, attrs...) \ extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ __hidden_proto_hiddenattr (attrs); +# define __hidden_proto_alias(name, thread, internal, attrs...) \ + extern thread __typeof (name) internal __hidden_proto_hiddenattr (attrs); # define __hidden_asmname(name) \ __hidden_asmname1 (__USER_LABEL_PREFIX__, name) # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name) @@ -550,9 +473,11 @@ for linking") __attribute__((alias (__hidden_asmname (#local)))) \ __attribute_copy__ (name) # define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name); -# define hidden_data_ver(local, name) hidden_ver(local, name) # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); +# define hidden_def_alias(name, internal) \ + strong_alias (name, internal) # define hidden_data_def(name) hidden_def(name) +# define hidden_data_def_alias(name, alias) hidden_def_alias(name, alias) # define hidden_tls_def(name) \ __hidden_ver2 (__thread, __GI_##name, name, name); # define hidden_weak(name) \ @@ -579,12 +504,13 @@ for linking") hidden_proto doesn't make sense for assembly but the equivalent is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */ # define hidden_def(name) strong_alias (name, __GI_##name) +# define hidden_def_alias(name, alias) strong_alias (name, alias) # define hidden_weak(name) hidden_def (name) # define hidden_ver(local, name) strong_alias (local, __GI_##name) # define hidden_data_def(name) strong_data_alias (name, __GI_##name) +# define hidden_data_def_alias(name, alias) strong_data_alias (name, alias) # define hidden_tls_def(name) hidden_data_def (name) # define hidden_data_weak(name) hidden_data_def (name) -# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name) # define HIDDEN_JUMPTARGET(name) __GI_##name # endif #else @@ -596,12 +522,17 @@ for linking") __attribute__ ((visibility ("hidden"), ##attrs)) # define hidden_proto(name, attrs...) \ __hidden_proto (name, , name, ##attrs) +# define hidden_proto_alias(name, alias, attrs...) \ + __hidden_proto_alias (name, , alias, ##attrs) # define hidden_tls_proto(name, attrs...) \ __hidden_proto (name, __thread, name, ##attrs) # define __hidden_proto(name, thread, internal, attrs...) \ extern thread __typeof (name) name __hidden_proto_hiddenattr (attrs); +# define __hidden_proto_alias(name, thread, internal, attrs...) \ + extern thread __typeof (name) internal __hidden_proto_hiddenattr (attrs); # else # define hidden_proto(name, attrs...) +# define hidden_proto_alias(name, alias, attrs...) # define hidden_tls_proto(name, attrs...) # endif # else @@ -609,256 +540,116 @@ for linking") # endif /* Not __ASSEMBLER__ */ # define hidden_weak(name) # define hidden_def(name) +# define hidden_def_alias(name, alias) # define hidden_ver(local, name) # define hidden_data_weak(name) # define hidden_data_def(name) +# define hidden_data_def_alias(name, alias) # define hidden_tls_def(name) -# define hidden_data_ver(local, name) # define hidden_nolink(name, lib, version) #endif #if IS_IN (libc) # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libc_hidden_proto_alias(name, alias, attrs...) \ + hidden_proto_alias (name, alias, ##attrs) # define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libc_hidden_def(name) hidden_def (name) # define libc_hidden_weak(name) hidden_weak (name) # define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version) # define libc_hidden_ver(local, name) hidden_ver (local, name) # define libc_hidden_data_def(name) hidden_data_def (name) +# define libc_hidden_data_def_alias(name, alias) hidden_data_def_alias (name, alias) # define libc_hidden_tls_def(name) hidden_tls_def (name) # define libc_hidden_data_weak(name) hidden_data_weak (name) -# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libc_hidden_proto(name, attrs...) +# define libc_hidden_proto_alias(name, alias, attrs...) # define libc_hidden_tls_proto(name, attrs...) # define libc_hidden_def(name) # define libc_hidden_weak(name) # define libc_hidden_ver(local, name) # define libc_hidden_data_def(name) +# define libc_hidden_data_def_alias(name, alias) # define libc_hidden_tls_def(name) # define libc_hidden_data_weak(name) -# define libc_hidden_data_ver(local, name) #endif #if IS_IN (rtld) # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define rtld_hidden_def(name) hidden_def (name) # define rtld_hidden_weak(name) hidden_weak (name) -# define rtld_hidden_ver(local, name) hidden_ver (local, name) # define rtld_hidden_data_def(name) hidden_data_def (name) -# define rtld_hidden_tls_def(name) hidden_tls_def (name) -# define rtld_hidden_data_weak(name) hidden_data_weak (name) -# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define rtld_hidden_proto(name, attrs...) -# define rtld_hidden_tls_proto(name, attrs...) # define rtld_hidden_def(name) # define rtld_hidden_weak(name) -# define rtld_hidden_ver(local, name) # define rtld_hidden_data_def(name) -# define rtld_hidden_tls_def(name) -# define rtld_hidden_data_weak(name) -# define rtld_hidden_data_ver(local, name) #endif #if IS_IN (libm) # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libm_hidden_def(name) hidden_def (name) # define libm_hidden_weak(name) hidden_weak (name) # define libm_hidden_ver(local, name) hidden_ver (local, name) -# define libm_hidden_data_def(name) hidden_data_def (name) -# define libm_hidden_tls_def(name) hidden_tls_def (name) -# define libm_hidden_data_weak(name) hidden_data_weak (name) -# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libm_hidden_proto(name, attrs...) -# define libm_hidden_tls_proto(name, attrs...) # define libm_hidden_def(name) # define libm_hidden_weak(name) # define libm_hidden_ver(local, name) -# define libm_hidden_data_def(name) -# define libm_hidden_tls_def(name) -# define libm_hidden_data_weak(name) -# define libm_hidden_data_ver(local, name) #endif #if IS_IN (libmvec) -# define libmvec_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libmvec_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libmvec_hidden_def(name) hidden_def (name) -# define libmvec_hidden_weak(name) hidden_weak (name) -# define libmvec_hidden_ver(local, name) hidden_ver (local, name) -# define libmvec_hidden_data_def(name) hidden_data_def (name) -# define libmvec_hidden_tls_def(name) hidden_tls_def (name) -# define libmvec_hidden_data_weak(name) hidden_data_weak (name) -# define libmvec_hidden_data_ver(local, name) hidden_data_ver (local, name) #else -# define libmvec_hidden_proto(name, attrs...) -# define libmvec_hidden_tls_proto(name, attrs...) # define libmvec_hidden_def(name) -# define libmvec_hidden_weak(name) -# define libmvec_hidden_ver(local, name) -# define libmvec_hidden_data_def(name) -# define libmvec_hidden_tls_def(name) -# define libmvec_hidden_data_weak(name) -# define libmvec_hidden_data_ver(local, name) #endif #if IS_IN (libresolv) # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libresolv_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) # define libresolv_hidden_def(name) hidden_def (name) -# define libresolv_hidden_weak(name) hidden_weak (name) -# define libresolv_hidden_ver(local, name) hidden_ver (local, name) # define libresolv_hidden_data_def(name) hidden_data_def (name) -# define libresolv_hidden_tls_def(name) hidden_tls_def (name) -# define libresolv_hidden_data_weak(name) hidden_data_weak (name) -# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libresolv_hidden_proto(name, attrs...) -# define libresolv_hidden_tls_proto(name, attrs...) # define libresolv_hidden_def(name) -# define libresolv_hidden_weak(name) -# define libresolv_hidden_ver(local, name) # define libresolv_hidden_data_def(name) -# define libresolv_hidden_tls_def(name) -# define libresolv_hidden_data_weak(name) -# define libresolv_hidden_data_ver(local, name) #endif #if IS_IN (libpthread) # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libpthread_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) # define libpthread_hidden_def(name) hidden_def (name) -# define libpthread_hidden_weak(name) hidden_weak (name) -# define libpthread_hidden_ver(local, name) hidden_ver (local, name) -# define libpthread_hidden_data_def(name) hidden_data_def (name) -# define libpthread_hidden_tls_def(name) hidden_tls_def (name) -# define libpthread_hidden_data_weak(name) hidden_data_weak (name) -# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libpthread_hidden_proto(name, attrs...) -# define libpthread_hidden_tls_proto(name, attrs...) # define libpthread_hidden_def(name) -# define libpthread_hidden_weak(name) -# define libpthread_hidden_ver(local, name) -# define libpthread_hidden_data_def(name) -# define libpthread_hidden_tls_def(name) -# define libpthread_hidden_data_weak(name) -# define libpthread_hidden_data_ver(local, name) #endif #if IS_IN (librt) # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define librt_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) -# define librt_hidden_def(name) hidden_def (name) -# define librt_hidden_weak(name) hidden_weak (name) # define librt_hidden_ver(local, name) hidden_ver (local, name) -# define librt_hidden_data_def(name) hidden_data_def (name) -# define librt_hidden_tls_def(name) hidden_tls_def (name) -# define librt_hidden_data_weak(name) hidden_data_weak (name) -# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define librt_hidden_proto(name, attrs...) -# define librt_hidden_tls_proto(name, attrs...) -# define librt_hidden_def(name) -# define librt_hidden_weak(name) # define librt_hidden_ver(local, name) -# define librt_hidden_data_def(name) -# define librt_hidden_tls_def(name) -# define librt_hidden_data_weak(name) -# define librt_hidden_data_ver(local, name) -#endif - -#if IS_IN (libdl) -# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libdl_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) -# define libdl_hidden_def(name) hidden_def (name) -# define libdl_hidden_weak(name) hidden_weak (name) -# define libdl_hidden_ver(local, name) hidden_ver (local, name) -# define libdl_hidden_data_def(name) hidden_data_def (name) -# define libdl_hidden_tls_def(name) hidden_tls_def (name) -# define libdl_hidden_data_weak(name) hidden_data_weak (name) -# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name) -#else -# define libdl_hidden_proto(name, attrs...) -# define libdl_hidden_tls_proto(name, attrs...) -# define libdl_hidden_def(name) -# define libdl_hidden_weak(name) -# define libdl_hidden_ver(local, name) -# define libdl_hidden_data_def(name) -# define libdl_hidden_tls_def(name) -# define libdl_hidden_data_weak(name) -# define libdl_hidden_data_ver(local, name) #endif #if IS_IN (libnsl) # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libnsl_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) # define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version) -# define libnsl_hidden_weak(name) hidden_weak (name) -# define libnsl_hidden_ver(local, name) hidden_ver (local, name) -# define libnsl_hidden_data_def(name) hidden_data_def (name) -# define libnsl_hidden_tls_def(name) hidden_tls_def (name) -# define libnsl_hidden_data_weak(name) hidden_data_weak (name) -# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libnsl_hidden_proto(name, attrs...) -# define libnsl_hidden_tls_proto(name, attrs...) -# define libnsl_hidden_weak(name) -# define libnsl_hidden_ver(local, name) -# define libnsl_hidden_data_def(name) -# define libnsl_hidden_tls_def(name) -# define libnsl_hidden_data_weak(name) -# define libnsl_hidden_data_ver(local, name) #endif #define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs) #define libc_hidden_builtin_def(name) libc_hidden_def (name) -#define libc_hidden_builtin_weak(name) libc_hidden_weak (name) -#define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name) #define libc_hidden_ldbl_proto(name, attrs...) libc_hidden_proto (name, ##attrs) #ifdef __ASSEMBLER__ # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name) #endif -#if IS_IN (libutil) -# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libutil_hidden_tls_proto(name, attrs...) \ - hidden_tls_proto (name, ##attrs) -# define libutil_hidden_def(name) hidden_def (name) -# define libutil_hidden_weak(name) hidden_weak (name) -# define libutil_hidden_ver(local, name) hidden_ver (local, name) -# define libutil_hidden_data_def(name) hidden_data_def (name) -# define libutil_hidden_tls_def(name) hidden_tls_def (name) -# define libutil_hidden_data_weak(name) hidden_data_weak (name) -# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name) -#else -# define libutil_hidden_proto(name, attrs...) -# define libutil_hidden_tls_proto(name, attrs...) -# define libutil_hidden_def(name) -# define libutil_hidden_weak(name) -# define libutil_hidden_ver(local, name) -# define libutil_hidden_data_def(name) -# define libutil_hidden_tls_def(name) -# define libutil_hidden_data_weak(name) -# define libutil_hidden_data_ver(local, name) -#endif - #if IS_IN (libanl) # define libanl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) -# define libanl_hidden_def(name) hidden_def (name) #else # define libanl_hidden_proto(name, attrs...) -# define libanl_hidden_def(name) #endif /* Get some dirty hacks. */ @@ -869,11 +660,8 @@ for linking") #ifndef __ASSEMBLER__ # define attribute_compat_text_section \ __attribute__ ((section (".text.compat"))) -# define attribute_compat_data_section \ - __attribute__ ((section (".data.compat"))) #else # define compat_text_section .section ".text.compat", "ax"; -# define compat_data_section .section ".data.compat", "aw"; #endif /* Helper / base macros for indirect function symbols. */ @@ -924,7 +712,7 @@ for linking") If you have an implementation for foo which e.g. uses a special hardware feature which isn't available on all machines where this libc.so will be - used but decideable if available at runtime e.g. via hwcaps, you can provide + used but decidable if available at runtime e.g. via hwcaps, you can provide two or multiple implementations of foo: int __foo_default (int __bar) @@ -977,7 +765,7 @@ for linking") : __foo_default); This will define the ifunc'ed symbol foo like above. The redirection of foo - in header file is needed to omit an additional defintion of __GI_foo which + in header file is needed to omit an additional definition of __GI_foo which would end in a linker error while linking libc.so. You have to specify __redirect_foo as first parameter which is used within libc_ifunc_redirected macro in conjunction with typeof to define the ifunc'ed symbol foo. diff --git a/lib/libc/glibc/include/signal.h b/lib/libc/glibc/include/signal.h index 2a278697c1..73f18dddd7 100644 --- a/lib/libc/glibc/include/signal.h +++ b/lib/libc/glibc/include/signal.h @@ -14,10 +14,8 @@ libc_hidden_proto (__sigpause) libc_hidden_proto (raise) libc_hidden_proto (__libc_current_sigrtmin) libc_hidden_proto (__libc_current_sigrtmax) -extern const char * const __sys_siglist[_NSIG]; -libc_hidden_proto (__sys_siglist) -extern const char * const __sys_sigabbrev[_NSIG]; -libc_hidden_proto (__sys_sigabbrev) +extern const char * const __sys_siglist[_NSIG] attribute_hidden; +extern const char * const __sys_sigabbrev[_NSIG] attribute_hidden; /* Now define the internal interfaces. */ extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler); diff --git a/lib/libc/glibc/include/stap-probe.h b/lib/libc/glibc/include/stap-probe.h index 9e13a4decc..80e88fbac4 100644 --- a/lib/libc/glibc/include/stap-probe.h +++ b/lib/libc/glibc/include/stap-probe.h @@ -1,5 +1,5 @@ /* Macros for defining Systemtap static probe points. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/include/stdlib.h b/lib/libc/glibc/include/stdlib.h index 1c6f70b082..7deb8193d7 100644 --- a/lib/libc/glibc/include/stdlib.h +++ b/lib/libc/glibc/include/stdlib.h @@ -1,6 +1,7 @@ #ifndef _STDLIB_H #ifndef _ISOMAC +# include # include #endif @@ -35,6 +36,45 @@ libc_hidden_proto (__strtod_l) libc_hidden_proto (__strtof_l) libc_hidden_proto (__strtold_l) +extern __typeof (strtol) __isoc23_strtol __attribute_copy__ (strtol); +extern __typeof (strtoul) __isoc23_strtoul __attribute_copy__ (strtoul); +extern __typeof (strtoll) __isoc23_strtoll __attribute_copy__ (strtoll); +extern __typeof (strtoull) __isoc23_strtoull __attribute_copy__ (strtoull); +extern __typeof (strtol_l) __isoc23_strtol_l __attribute_copy__ (strtol_l); +extern __typeof (strtoul_l) __isoc23_strtoul_l __attribute_copy__ (strtoul_l); +extern __typeof (strtoll_l) __isoc23_strtoll_l __attribute_copy__ (strtoll_l); +extern __typeof (strtoull_l) __isoc23_strtoull_l __attribute_copy__ (strtoull_l); +libc_hidden_proto (__isoc23_strtol) +libc_hidden_proto (__isoc23_strtoul) +libc_hidden_proto (__isoc23_strtoll) +libc_hidden_proto (__isoc23_strtoull) +libc_hidden_proto (__isoc23_strtol_l) +libc_hidden_proto (__isoc23_strtoul_l) +libc_hidden_proto (__isoc23_strtoll_l) +libc_hidden_proto (__isoc23_strtoull_l) + +#if __GLIBC_USE (C2X_STRTOL) +/* Redirect internal uses of these functions to the C2X versions; the + redirection in the installed header does not work with + libc_hidden_proto. */ +# undef strtol +# define strtol __isoc23_strtol +# undef strtoul +# define strtoul __isoc23_strtoul +# undef strtoll +# define strtoll __isoc23_strtoll +# undef strtoull +# define strtoull __isoc23_strtoull +# undef strtol_l +# define strtol_l __isoc23_strtol_l +# undef strtoul_l +# define strtoul_l __isoc23_strtoul_l +# undef strtoll_l +# define strtoll_l __isoc23_strtoll_l +# undef strtoull_l +# define strtoull_l __isoc23_strtoull_l +#endif + libc_hidden_proto (exit) libc_hidden_proto (abort) libc_hidden_proto (getenv) @@ -144,6 +184,15 @@ libc_hidden_proto (__ptsname_r) libc_hidden_proto (grantpt) libc_hidden_proto (unlockpt) +__typeof (arc4random) __arc4random; +libc_hidden_proto (__arc4random); +__typeof (arc4random_buf) __arc4random_buf; +libc_hidden_proto (__arc4random_buf); +__typeof (arc4random_uniform) __arc4random_uniform; +libc_hidden_proto (__arc4random_uniform); +extern void __arc4random_buf_internal (void *buffer, size_t len) + attribute_hidden; + extern double __strtod_internal (const char *__restrict __nptr, char **__restrict __endptr, int __group) __THROW __nonnull ((1)) __wur; @@ -193,23 +242,25 @@ extern long double ____strtold_l_internal (const char *__restrict __nptr, extern long int ____strtol_l_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group, - locale_t __loc); + bool __bin_cst, locale_t __loc); extern unsigned long int ____strtoul_l_internal (const char * __restrict __nptr, char **__restrict __endptr, int __base, int __group, + bool __bin_cst, locale_t __loc); __extension__ extern long long int ____strtoll_l_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group, - locale_t __loc); + bool __bin_cst, locale_t __loc); __extension__ extern unsigned long long int ____strtoull_l_internal (const char * __restrict __nptr, char ** __restrict __endptr, int __base, int __group, + bool __bin_cst, locale_t __loc); libc_hidden_proto (____strtof_l_internal) diff --git a/lib/libc/glibc/include/sys/cdefs.h b/lib/libc/glibc/include/sys/cdefs.h index 6a76160ed4..b84ad34a70 100644 --- a/lib/libc/glibc/include/sys/cdefs.h +++ b/lib/libc/glibc/include/sys/cdefs.h @@ -1,5 +1,12 @@ #ifndef _SYS_CDEFS_H +/* This is outside of _ISOMAC to enforce that _Static_assert always + uses the two-argument form. This can be removed once the minimum + GCC version used to compile glibc is GCC 9.1. */ +#ifndef __cplusplus +# define _Static_assert(expr, diagnostic) _Static_assert (expr, diagnostic) +#endif + #include #ifndef _ISOMAC @@ -33,6 +40,20 @@ rtld_hidden_proto (__chk_fail) #endif +#if defined SHARED +#if IS_IN (libc) && __USE_FORTIFY_LEVEL > 0 && defined __fortify_function + +#undef __REDIRECT_FORTIFY +#define __REDIRECT_FORTIFY(name, proto, alias) \ + __REDIRECT(name, proto, __GI_##alias) + +#undef __REDIRECT_FORTIFY_NTH +#define __REDIRECT_FORTIFY_NTH(name, proto, alias) \ + __REDIRECT_NTH(name, proto, __GI_##alias) + +#endif +#endif /* defined SHARED */ + #endif /* !defined _ISOMAC */ #endif diff --git a/lib/libc/glibc/include/sys/select.h b/lib/libc/glibc/include/sys/select.h index a8961afbed..45376461e9 100644 --- a/lib/libc/glibc/include/sys/select.h +++ b/lib/libc/glibc/include/sys/select.h @@ -3,6 +3,10 @@ #ifndef _ISOMAC /* Now define the internal interfaces. */ + +#include +libc_hidden_proto (__fdelt_chk) + # if __TIMESIZE == 64 # define __pselect64 __pselect # define __select64 __select diff --git a/lib/libc/glibc/include/sys/stat.h b/lib/libc/glibc/include/sys/stat.h index 13e777b3c7..4a29e842de 100644 --- a/lib/libc/glibc/include/sys/stat.h +++ b/lib/libc/glibc/include/sys/stat.h @@ -66,10 +66,12 @@ hidden_proto (__fstatat64_time64); extern int __chmod (const char *__file, __mode_t __mode); libc_hidden_proto (__chmod) extern int __fchmod (int __fd, __mode_t __mode); +extern int __fchmodat (int __fd, const char *__file, mode_t __mode, int __flag); libc_hidden_proto (fchmodat) extern __mode_t __umask (__mode_t __mask); extern int __mkdir (const char *__path, __mode_t __mode); libc_hidden_proto (__mkdir) +extern int __mkdirat (int __fd, const char *__path, mode_t __mode); extern int __mknodat (int fd, const char *path, mode_t mode, dev_t dev); libc_hidden_proto (__mknodat); diff --git a/lib/libc/glibc/io/bits/statx.h b/lib/libc/glibc/io/bits/statx.h index ed2ac92d80..6ce85921ad 100644 --- a/lib/libc/glibc/io/bits/statx.h +++ b/lib/libc/glibc/io/bits/statx.h @@ -1,5 +1,5 @@ /* statx-related definitions and declarations. Generic version. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 diff --git a/lib/libc/glibc/io/fcntl.h b/lib/libc/glibc/io/fcntl.h index 5c76999da3..dd620c086f 100644 --- a/lib/libc/glibc/io/fcntl.h +++ b/lib/libc/glibc/io/fcntl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 @@ -167,10 +167,6 @@ typedef __pid_t pid_t; effective IDs, not real IDs. */ #endif - -/* fcntl was a simple symbol until glibc 2.27 inclusive. glibc 2.28 onwards - * re-defines it to fcntl64 (via #define) if _FILE_OFFSET_BITS == 64. */ -#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2 /* Do the file control operation described by CMD on FD. The remaining arguments are interpreted depending on CMD. @@ -191,19 +187,16 @@ extern int fcntl64 (int __fd, int __cmd, ...); # endif #else /* __USE_TIME_BITS64 */ # ifdef __REDIRECT -extern int __REDIRECT (fcntl, (int __fd, int __request, ...), - __fcntl_time64) __THROW; -extern int __REDIRECT (fcntl64, (int __fd, int __request, ...), - __fcntl_time64) __THROW; +extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...), + __fcntl_time64); +extern int __REDIRECT_NTH (fcntl64, (int __fd, int __request, ...), + __fcntl_time64); # else extern int __fcntl_time64 (int __fd, int __request, ...) __THROW; # define fcntl64 __fcntl_time64 # define fcntl __fcntl_time64 # endif #endif -#else /* glibc 2.27 or lower */ -extern int fcntl (int __fd, int __cmd, ...); -#endif /* Open FILE and return a new file descriptor for it, or -1 on error. OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set diff --git a/lib/libc/glibc/io/mknod.c b/lib/libc/glibc/io/mknod.c index bf45055fdd..c8b42671b0 100644 --- a/lib/libc/glibc/io/mknod.c +++ b/lib/libc/glibc/io/mknod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2021 Free Software Foundation, Inc. +/* Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/io/sys/stat.h b/lib/libc/glibc/io/sys/stat.h index f7874ec5ba..7b9368f9ec 100644 --- a/lib/libc/glibc/io/sys/stat.h +++ b/lib/libc/glibc/io/sys/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/locale/bits/types/__locale_t.h b/lib/libc/glibc/locale/bits/types/__locale_t.h index b0742bfb28..6b83d380d9 100644 --- a/lib/libc/glibc/locale/bits/types/__locale_t.h +++ b/lib/libc/glibc/locale/bits/types/__locale_t.h @@ -1,7 +1,6 @@ /* Definition of struct __locale_struct and __locale_t. - Copyright (C) 1997-2021 Free Software Foundation, Inc. + Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/locale/bits/types/locale_t.h b/lib/libc/glibc/locale/bits/types/locale_t.h index f46e9b0ef5..2de0f6d034 100644 --- a/lib/libc/glibc/locale/bits/types/locale_t.h +++ b/lib/libc/glibc/locale/bits/types/locale_t.h @@ -1,5 +1,5 @@ /* Definition of locale_t. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/misc/sys/cdefs.h b/lib/libc/glibc/misc/sys/cdefs.h index e490fc1aeb..90c21e2703 100644 --- a/lib/libc/glibc/misc/sys/cdefs.h +++ b/lib/libc/glibc/misc/sys/cdefs.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. + Copyright The GNU Toolchain Authors. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,8 +27,8 @@ /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not supported anymore. */ -#if defined __GNUC__ && !defined __STDC__ -# error "You need a ISO C conforming compiler to use the glibc headers" +#if defined __GNUC__ && !defined __STDC__ && !defined __cplusplus +# error "You need a ISO C or C++ conforming compiler to use the glibc headers" #endif /* Some user header file might have defined this before. */ @@ -80,7 +81,7 @@ # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else -# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) +# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4) # if __cplusplus >= 201103L # define __THROW noexcept (true) # else @@ -97,6 +98,12 @@ # endif # endif +# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__) +# define __COLD __attribute__ ((__cold__)) +# else +# define __COLD +# endif + #else /* Not GCC or clang. */ # if (defined __cplusplus \ @@ -109,6 +116,7 @@ # define __THROW # define __THROWNL # define __NTH(fct) fct +# define __COLD #endif /* GCC || clang. */ @@ -142,7 +150,8 @@ #define __bos0(ptr) __builtin_object_size (ptr, 0) /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ -#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) +#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \ + || __GNUC_PREREQ (12, 0)) # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) #else @@ -150,6 +159,55 @@ # define __glibc_objsize(__o) __bos (__o) #endif +#if __USE_FORTIFY_LEVEL > 0 +/* Compile time conditions to choose between the regular, _chk and _chk_warn + variants. These conditions should get evaluated to constant and optimized + away. */ + +#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s)) +#define __glibc_unsigned_or_positive(__l) \ + ((__typeof (__l)) 0 < (__typeof (__l)) -1 \ + || (__builtin_constant_p (__l) && (__l) > 0)) + +/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ + condition can be folded to a constant and if it is true, or unknown (-1) */ +#define __glibc_safe_or_unknown_len(__l, __s, __osz) \ + ((__builtin_constant_p (__osz) && (__osz) == (__SIZE_TYPE__) -1) \ + || (__glibc_unsigned_or_positive (__l) \ + && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ + (__s), (__osz))) \ + && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz)))) + +/* Conversely, we know at compile time that the length is unsafe if the + __L * __S <= __OBJSZ condition can be folded to a constant and if it is + false. */ +#define __glibc_unsafe_len(__l, __s, __osz) \ + (__glibc_unsigned_or_positive (__l) \ + && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ + __s, __osz)) \ + && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz)) + +/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be + declared. */ + +#define __glibc_fortify(f, __l, __s, __osz, ...) \ + (__glibc_safe_or_unknown_len (__l, __s, __osz) \ + ? __ ## f ## _alias (__VA_ARGS__) \ + : (__glibc_unsafe_len (__l, __s, __osz) \ + ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \ + : __ ## f ## _chk (__VA_ARGS__, __osz))) + +/* Fortify function f, where object size argument passed to f is the number of + elements and not total size. */ + +#define __glibc_fortify_n(f, __l, __s, __osz, ...) \ + (__glibc_safe_or_unknown_len (__l, __s, __osz) \ + ? __ ## f ## _alias (__VA_ARGS__) \ + : (__glibc_unsafe_len (__l, __s, __osz) \ + ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \ + : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) +#endif + #if __GNUC_PREREQ (4,3) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ @@ -210,6 +268,14 @@ # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname +#ifndef __REDIRECT_FORTIFY +#define __REDIRECT_FORTIFY __REDIRECT +#endif + +#ifndef __REDIRECT_FORTIFY_NTH +#define __REDIRECT_FORTIFY_NTH __REDIRECT_NTH +#endif + /* #elif __SOME_OTHER_COMPILER__ @@ -243,6 +309,15 @@ # define __attribute_alloc_size__(params) /* Ignore. */ #endif +/* Tell the compiler which argument to an allocation function + indicates the alignment of the allocation. */ +#if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__alloc_align__) +# define __attribute_alloc_align__(param) \ + __attribute__ ((__alloc_align__ param)) +#else +# define __attribute_alloc_align__(param) /* Ignore. */ +#endif + /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ @@ -318,16 +393,18 @@ #endif /* The nonnull function attribute marks pointer parameters that - must not be NULL. */ -#ifndef __nonnull + must not be NULL. This has the name __nonnull in glibc, + and __attribute_nonnull__ in files shared with Gnulib to avoid + collision with a different __nonnull in DragonFlyBSD 5.9. */ +#ifndef __attribute_nonnull__ # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) -# define __nonnull(params) __attribute__ ((__nonnull__ params)) +# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params)) # else -# define __nonnull(params) +# define __attribute_nonnull__(params) # endif -#elif !defined __GLIBC__ -# undef __nonnull -# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params) +#endif +#ifndef __nonnull +# define __nonnull(params) __attribute_nonnull__ (params) #endif /* The returns_nonnull function attribute marks the return type of the function @@ -493,9 +570,9 @@ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif -/* The #ifndef lets Gnulib avoid including these on non-glibc - platforms, where the includes typically do not exist. */ -#ifdef __GLIBC__ +/* Gnulib avoids including these, as they don't work on non-glibc or + older glibc platforms. */ +#ifndef __GNULIB_CDEFS # include # include #endif @@ -507,6 +584,8 @@ # define __LDBL_REDIR(name, proto) ... unused__ldbl_redir # define __LDBL_REDIR_DECL(name) \ extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); +# define __REDIRECT_LDBL(name, proto, alias) \ + name proto __asm (__ASMNAME ("__" #alias "ieee128")) /* Alias name defined automatically, with leading underscores. */ # define __LDBL_REDIR2_DECL(name) \ @@ -524,7 +603,6 @@ __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) /* Unused. */ -# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl # define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth # else @@ -603,12 +681,22 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf size-index is not provided: access (access-mode, [, ]) */ # define __attr_access(x) __attribute__ ((__access__ x)) +/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may + use the access attribute to get object sizes from function definition + arguments, so we can't use them on functions we fortify. Drop the object + size hints for such functions. */ +# if __USE_FORTIFY_LEVEL == 3 +# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o))) +# else +# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s)) +# endif # if __GNUC_PREREQ (11, 0) # define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno))) # else # define __attr_access_none(argno) # endif #else +# define __fortified_attr_access(a, o, s) # define __attr_access(x) # define __attr_access_none(argno) #endif diff --git a/lib/libc/glibc/misc/sys/select.h b/lib/libc/glibc/misc/sys/select.h index e9c0e8fc20..a715c08999 100644 --- a/lib/libc/glibc/misc/sys/select.h +++ b/lib/libc/glibc/misc/sys/select.h @@ -1,5 +1,5 @@ /* `fd_set' type and related macros, and `select'/`pselect' declarations. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/posix/bits/cpu-set.h b/lib/libc/glibc/posix/bits/cpu-set.h index 9a7e55920c..16037eae30 100644 --- a/lib/libc/glibc/posix/bits/cpu-set.h +++ b/lib/libc/glibc/posix/bits/cpu-set.h @@ -1,6 +1,6 @@ /* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/posix/bits/types.h b/lib/libc/glibc/posix/bits/types.h index 2dc63de5c2..a1e18d5a56 100644 --- a/lib/libc/glibc/posix/bits/types.h +++ b/lib/libc/glibc/posix/bits/types.h @@ -1,5 +1,5 @@ /* bits/types.h -- definitions of __*_t types underlying *_t types. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/posix/sys/types.h b/lib/libc/glibc/posix/sys/types.h index 477a45f4af..dbf41711dc 100644 --- a/lib/libc/glibc/posix/sys/types.h +++ b/lib/libc/glibc/posix/sys/types.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/signal/signal.h b/lib/libc/glibc/signal/signal.h index 5fd93382fc..aff6c06045 100644 --- a/lib/libc/glibc/signal/signal.h +++ b/lib/libc/glibc/signal/signal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/stdlib/alloca.h b/lib/libc/glibc/stdlib/alloca.h index cd2a9e0dc1..efc7116114 100644 --- a/lib/libc/glibc/stdlib/alloca.h +++ b/lib/libc/glibc/stdlib/alloca.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/stdlib/bits/stdlib-float.h b/lib/libc/glibc/stdlib/bits/stdlib-float.h index 3373c5bebc..b16d0bb7db 100644 --- a/lib/libc/glibc/stdlib/bits/stdlib-float.h +++ b/lib/libc/glibc/stdlib/bits/stdlib-float.h @@ -1,5 +1,5 @@ /* Floating-point inline functions for stdlib.h. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/stdlib/errno.h b/lib/libc/glibc/stdlib/errno.h index 336a37e455..d15d890d85 100644 --- a/lib/libc/glibc/stdlib/errno.h +++ b/lib/libc/glibc/stdlib/errno.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/stdlib/exit.h b/lib/libc/glibc/stdlib/exit.h index 0e5fef1b20..23cfb8fd95 100644 --- a/lib/libc/glibc/stdlib/exit.h +++ b/lib/libc/glibc/stdlib/exit.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/stdlib/stdlib.h b/lib/libc/glibc/stdlib/stdlib.h index 0481c12355..631b0cbbed 100644 --- a/lib/libc/glibc/stdlib/stdlib.h +++ b/lib/libc/glibc/stdlib/stdlib.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 Free Software Foundation, Inc. + Copyright The GNU Toolchain Authors. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -207,6 +208,71 @@ extern unsigned long long int strtoull (const char *__restrict __nptr, __THROW __nonnull ((1)); #endif /* ISO C99 or use MISC. */ +/* Versions of the above functions that handle '0b' and '0B' prefixes + in base 0 or 2. */ +#if __GLIBC_USE (C2X_STRTOL) +# ifdef __REDIRECT +extern long int __REDIRECT_NTH (strtol, (const char *__restrict __nptr, + char **__restrict __endptr, + int __base), __isoc23_strtol) + __nonnull ((1)); +extern unsigned long int __REDIRECT_NTH (strtoul, + (const char *__restrict __nptr, + char **__restrict __endptr, + int __base), __isoc23_strtoul) + __nonnull ((1)); +# ifdef __USE_MISC +__extension__ +extern long long int __REDIRECT_NTH (strtoq, (const char *__restrict __nptr, + char **__restrict __endptr, + int __base), __isoc23_strtoll) + __nonnull ((1)); +__extension__ +extern unsigned long long int __REDIRECT_NTH (strtouq, + (const char *__restrict __nptr, + char **__restrict __endptr, + int __base), __isoc23_strtoull) + __nonnull ((1)); +# endif +__extension__ +extern long long int __REDIRECT_NTH (strtoll, (const char *__restrict __nptr, + char **__restrict __endptr, + int __base), __isoc23_strtoll) + __nonnull ((1)); +__extension__ +extern unsigned long long int __REDIRECT_NTH (strtoull, + (const char *__restrict __nptr, + char **__restrict __endptr, + int __base), __isoc23_strtoull) + __nonnull ((1)); +# else +extern long int __isoc23_strtol (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)); +extern unsigned long int __isoc23_strtoul (const char *__restrict __nptr, + char **__restrict __endptr, + int __base) + __THROW __nonnull ((1)); +__extension__ +extern long long int __isoc23_strtoll (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)); +__extension__ +extern unsigned long long int __isoc23_strtoull (const char *__restrict __nptr, + char **__restrict __endptr, + int __base) + __THROW __nonnull ((1)); +# define strtol __isoc23_strtol +# define strtoul __isoc23_strtoul +# ifdef __USE_MISC +# define strtoq __isoc23_strtoll +# define strtouq __isoc23_strtoull +# endif +# define strtoll __isoc23_strtoll +# define strtoull __isoc23_strtoull +# endif +#endif + /* Convert a floating-point number to a string. */ #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) extern int strfromd (char *__dest, size_t __size, const char *__format, @@ -292,6 +358,60 @@ extern unsigned long long int strtoull_l (const char *__restrict __nptr, int __base, locale_t __loc) __THROW __nonnull ((1, 4)); +/* Versions of the above functions that handle '0b' and '0B' prefixes + in base 0 or 2. */ +# if __GLIBC_USE (C2X_STRTOL) +# ifdef __REDIRECT +extern long int __REDIRECT_NTH (strtol_l, (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, locale_t __loc), + __isoc23_strtol_l) + __nonnull ((1, 4)); +extern unsigned long int __REDIRECT_NTH (strtoul_l, + (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, locale_t __loc), + __isoc23_strtoul_l) + __nonnull ((1, 4)); +__extension__ +extern long long int __REDIRECT_NTH (strtoll_l, (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, + locale_t __loc), + __isoc23_strtoll_l) + __nonnull ((1, 4)); +__extension__ +extern unsigned long long int __REDIRECT_NTH (strtoull_l, + (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, locale_t __loc), + __isoc23_strtoull_l) + __nonnull ((1, 4)); +# else +extern long int __isoc23_strtol_l (const char *__restrict __nptr, + char **__restrict __endptr, int __base, + locale_t __loc) __THROW __nonnull ((1, 4)); +extern unsigned long int __isoc23_strtoul_l (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, locale_t __loc) + __THROW __nonnull ((1, 4)); +__extension__ +extern long long int __isoc23_strtoll_l (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, locale_t __loc) + __THROW __nonnull ((1, 4)); +__extension__ +extern unsigned long long int __isoc23_strtoull_l (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, locale_t __loc) + __THROW __nonnull ((1, 4)); +# define strtol_l __isoc23_strtol_l +# define strtoul_l __isoc23_strtoul_l +# define strtoll_l __isoc23_strtoll_l +# define strtoull_l __isoc23_strtoull_l +# endif +# endif + extern double strtod_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) __THROW __nonnull ((1, 3)); @@ -532,6 +652,19 @@ extern int seed48_r (unsigned short int __seed16v[3], extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) __THROW __nonnull ((1, 2)); + +/* Return a random integer between zero and 2**32-1 (inclusive). */ +extern __uint32_t arc4random (void) + __THROW __wur; + +/* Fill the buffer with random data. */ +extern void arc4random_buf (void *__buf, size_t __size) + __THROW __nonnull ((1)); + +/* Return a random number between zero (inclusive) and the specified + limit (exclusive). */ +extern __uint32_t arc4random_uniform (__uint32_t __upper_bound) + __THROW __wur; # endif /* Use misc. */ #endif /* Use misc or X/Open. */ @@ -589,7 +722,8 @@ extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) #ifdef __USE_ISOC11 /* ISO C variant of aligned allocation. */ extern void *aligned_alloc (size_t __alignment, size_t __size) - __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur; + __THROW __attribute_malloc__ __attribute_alloc_align__ ((1)) + __attribute_alloc_size__ ((2)) __wur; #endif /* Abort execution and generate a core-dump. */ @@ -943,7 +1077,8 @@ extern size_t mbstowcs (wchar_t *__restrict __pwcs, extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) __THROW - __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); + __fortified_attr_access (__write_only__, 1, 3) + __attr_access ((__read_only__, 2)); #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation @@ -997,7 +1132,7 @@ extern char *ptsname (int __fd) __THROW __wur; terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); + __THROW __nonnull ((2)) __fortified_attr_access (__write_only__, 2, 3); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt (void); diff --git a/lib/libc/glibc/string/bits/endian.h b/lib/libc/glibc/string/bits/endian.h index 6372c6f52b..b659a0031c 100644 --- a/lib/libc/glibc/string/bits/endian.h +++ b/lib/libc/glibc/string/bits/endian.h @@ -1,5 +1,5 @@ /* Endian macros for string.h functions - Copyright (C) 1992-2021 Free Software Foundation, Inc. + Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/string/endian.h b/lib/libc/glibc/string/endian.h index b8c5f7f33b..ffc66791f4 100644 --- a/lib/libc/glibc/string/endian.h +++ b/lib/libc/glibc/string/endian.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/sysdeps/aarch64/crti.S b/lib/libc/glibc/sysdeps/aarch64/crti.S index d5dd25b084..c4e3b06a4d 100644 --- a/lib/libc/glibc/sysdeps/aarch64/crti.S +++ b/lib/libc/glibc/sysdeps/aarch64/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for AArch64. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/aarch64/crtn.S b/lib/libc/glibc/sysdeps/aarch64/crtn.S index 325d04cffa..b3d91ba96e 100644 --- a/lib/libc/glibc/sysdeps/aarch64/crtn.S +++ b/lib/libc/glibc/sysdeps/aarch64/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for AArch64. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h b/lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h deleted file mode 100644 index 8a9acd433b..0000000000 --- a/lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2002-2021 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 - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - -#define DL_EXTERN_PROTECTED_DATA diff --git a/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h index a0a3077b2d..e5797b2877 100644 --- a/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. +/* Copyright (C) 2002-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/aarch64/start.S b/lib/libc/glibc/sysdeps/aarch64/start.S index 417da8802b..9ec8e388bd 100644 --- a/lib/libc/glibc/sysdeps/aarch64/start.S +++ b/lib/libc/glibc/sysdeps/aarch64/start.S @@ -1,11 +1,28 @@ -/* Copyright (C) 1995-2021 Free Software Foundation, Inc. +/* Copyright (C) 1995-2023 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. + 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. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file with other + programs, and to distribute those programs without any restriction + coming from the use of this file. (The GNU Lesser General Public + License restrictions do apply in other respects; for example, they + cover modification of the file, and distribution when not linked + into another program.) + + Note that people who make modified versions of this file are not + obligated to grant this special exception for their modified + versions; it is their choice whether to do so. The GNU Lesser + General Public License gives permission to release a modified + version without this exception; this exception also makes it + possible to release a modified version which carries forward this + exception. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,7 +30,7 @@ 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 + License along with the GNU C Library; if not, see . */ #include diff --git a/lib/libc/glibc/sysdeps/aarch64/sysdep.h b/lib/libc/glibc/sysdeps/aarch64/sysdep.h index b936e29cbd..37ee891fc4 100644 --- a/lib/libc/glibc/sysdeps/aarch64/sysdep.h +++ b/lib/libc/glibc/sysdeps/aarch64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/alpha/crti.S b/lib/libc/glibc/sysdeps/alpha/crti.S index 88bd8710a6..da0babd80b 100644 --- a/lib/libc/glibc/sysdeps/alpha/crti.S +++ b/lib/libc/glibc/sysdeps/alpha/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for Alpha. - Copyright (C) 2001-2021 Free Software Foundation, Inc. + Copyright (C) 2001-2023 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 diff --git a/lib/libc/glibc/sysdeps/alpha/crtn.S b/lib/libc/glibc/sysdeps/alpha/crtn.S index 96f3ccf522..86ac0e47a3 100644 --- a/lib/libc/glibc/sysdeps/alpha/crtn.S +++ b/lib/libc/glibc/sysdeps/alpha/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for Alpha. - Copyright (C) 2001-2021 Free Software Foundation, Inc. + Copyright (C) 2001-2023 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 diff --git a/lib/libc/glibc/sysdeps/alpha/dl-sysdep.h b/lib/libc/glibc/sysdeps/alpha/dl-sysdep.h deleted file mode 100644 index c4a0443067..0000000000 --- a/lib/libc/glibc/sysdeps/alpha/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. Alpha version. - Copyright (C) 2002-2021 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 - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/lib/libc/glibc/sysdeps/alpha/start.S b/lib/libc/glibc/sysdeps/alpha/start.S index 65dcd4d392..80d0ac36d3 100644 --- a/lib/libc/glibc/sysdeps/alpha/start.S +++ b/lib/libc/glibc/sysdeps/alpha/start.S @@ -1,7 +1,6 @@ /* Startup code for Alpha/ELF. - Copyright (C) 1993-2021 Free Software Foundation, Inc. + Copyright (C) 1993-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Richard Henderson The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/arc/sysdep.h b/lib/libc/glibc/sysdeps/arc/sysdep.h index fc774abbdf..4f024f6b73 100644 --- a/lib/libc/glibc/sysdeps/arc/sysdep.h +++ b/lib/libc/glibc/sysdeps/arc/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for ARC. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/arm/arm-features.h b/lib/libc/glibc/sysdeps/arm/arm-features.h index 80a1e2272b..7f241d6b9b 100644 --- a/lib/libc/glibc/sysdeps/arm/arm-features.h +++ b/lib/libc/glibc/sysdeps/arm/arm-features.h @@ -1,5 +1,5 @@ /* Macros to test for CPU features on ARM. Generic ARM version. - Copyright (C) 2012-2022 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/arm/crti.S b/lib/libc/glibc/sysdeps/arm/crti.S index c06e310626..af6ba4a122 100644 --- a/lib/libc/glibc/sysdeps/arm/crti.S +++ b/lib/libc/glibc/sysdeps/arm/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for ARM. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/arm/crtn.S b/lib/libc/glibc/sysdeps/arm/crtn.S index f159ab9139..d28b31829f 100644 --- a/lib/libc/glibc/sysdeps/arm/crtn.S +++ b/lib/libc/glibc/sysdeps/arm/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for ARM. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/arm/dl-sysdep.h b/lib/libc/glibc/sysdeps/arm/dl-sysdep.h deleted file mode 100644 index 076d8228f9..0000000000 --- a/lib/libc/glibc/sysdeps/arm/dl-sysdep.h +++ /dev/null @@ -1,25 +0,0 @@ -/* System-specific settings for dynamic linker code. Alpha version. - Copyright (C) 2002-2021 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 - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - -#define DL_EXTERN_PROTECTED_DATA diff --git a/lib/libc/glibc/sysdeps/arm/start.S b/lib/libc/glibc/sysdeps/arm/start.S index 9b56bc0cca..f53f4581b5 100644 --- a/lib/libc/glibc/sysdeps/arm/start.S +++ b/lib/libc/glibc/sysdeps/arm/start.S @@ -1,5 +1,5 @@ /* Startup code for ARM & ELF - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/arm/sysdep.h b/lib/libc/glibc/sysdeps/arm/sysdep.h index cceb4a92af..18cdce8fb3 100644 --- a/lib/libc/glibc/sysdeps/arm/sysdep.h +++ b/lib/libc/glibc/sysdeps/arm/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for ARM. - Copyright (C) 1997-2021 Free Software Foundation, Inc. + Copyright (C) 1997-2023 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 @@ -293,47 +293,3 @@ #else # define PC_OFS 8 #endif - -/* Pointer mangling support. */ -#if (IS_IN (rtld) \ - || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread)))) -# ifdef __ASSEMBLER__ -# define PTR_MANGLE_LOAD(guard, tmp) \ - LDR_HIDDEN (guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local), 0) -# define PTR_MANGLE(dst, src, guard, tmp) \ - PTR_MANGLE_LOAD(guard, tmp); \ - PTR_MANGLE2(dst, src, guard) -/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ -# define PTR_MANGLE2(dst, src, guard) \ - eor dst, src, guard -# define PTR_DEMANGLE(dst, src, guard, tmp) \ - PTR_MANGLE (dst, src, guard, tmp) -# define PTR_DEMANGLE2(dst, src, guard) \ - PTR_MANGLE2 (dst, src, guard) -# else -extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE_LOAD(guard, tmp) \ - LDR_GLOBAL (guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard), 0); -# define PTR_MANGLE(dst, src, guard, tmp) \ - PTR_MANGLE_LOAD(guard, tmp); \ - PTR_MANGLE2(dst, src, guard) -/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ -# define PTR_MANGLE2(dst, src, guard) \ - eor dst, src, guard -# define PTR_DEMANGLE(dst, src, guard, tmp) \ - PTR_MANGLE (dst, src, guard, tmp) -# define PTR_DEMANGLE2(dst, src, guard) \ - PTR_MANGLE2 (dst, src, guard) -# else -extern uintptr_t __pointer_chk_guard attribute_relro; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif diff --git a/lib/libc/glibc/sysdeps/csky/sysdep.h b/lib/libc/glibc/sysdeps/csky/sysdep.h index fbd09aa088..e681782f7f 100644 --- a/lib/libc/glibc/sysdeps/csky/sysdep.h +++ b/lib/libc/glibc/sysdeps/csky/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for C-SKY. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 diff --git a/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h index aeda016775..c31c82852a 100644 --- a/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/generic/dl-sysdep.h b/lib/libc/glibc/sysdeps/generic/dl-sysdep.h index 80e12b52ab..9563ccda39 100644 --- a/lib/libc/glibc/sysdeps/generic/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/generic/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. Generic version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/generic/dwarf2.h b/lib/libc/glibc/sysdeps/generic/dwarf2.h index 0d08da02b7..0b0ec836d9 100644 --- a/lib/libc/glibc/sysdeps/generic/dwarf2.h +++ b/lib/libc/glibc/sysdeps/generic/dwarf2.h @@ -1,8 +1,6 @@ /* Declarations and definitions of codes relating to the DWARF2 symbolic debugging information format. - Copyright (C) 1992-2021 Free Software Foundation, Inc. - Contributed by Gary Funck (gary@intrepid.com). Derived from the - DWARF 1 implementation written by Ron Guilmette (rfg@monkeys.com). + Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/generic/libc-lock.h b/lib/libc/glibc/sysdeps/generic/libc-lock.h index c538e858ea..abbf7272ca 100644 --- a/lib/libc/glibc/sysdeps/generic/libc-lock.h +++ b/lib/libc/glibc/sysdeps/generic/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. Stub version. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/sysdeps/generic/libc-symver.h b/lib/libc/glibc/sysdeps/generic/libc-symver.h index 69d147e2a8..ac2b827f72 100644 --- a/lib/libc/glibc/sysdeps/generic/libc-symver.h +++ b/lib/libc/glibc/sysdeps/generic/libc-symver.h @@ -1,5 +1,5 @@ /* Symbol version management. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/generic/single-thread.h b/lib/libc/glibc/sysdeps/generic/single-thread.h index 3f1c598d22..8901ad5723 100644 --- a/lib/libc/glibc/sysdeps/generic/single-thread.h +++ b/lib/libc/glibc/sysdeps/generic/single-thread.h @@ -1,5 +1,5 @@ /* Single thread optimization, generic version. - Copyright (C) 2019-2021 Free Software Foundation, Inc. + Copyright (C) 2019-2023 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 diff --git a/lib/libc/glibc/sysdeps/generic/symbol-hacks.h b/lib/libc/glibc/sysdeps/generic/symbol-hacks.h index 3586e6ed38..1115e4c0a7 100644 --- a/lib/libc/glibc/sysdeps/generic/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/generic/symbol-hacks.h @@ -1,6 +1,7 @@ /* Some compiler optimizations may transform loops into memset/memmove calls and without proper declaration it may generate PLT calls. */ -#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED +#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \ + && !defined LIBC_NONSHARED asm ("memmove = __GI_memmove"); asm ("memset = __GI_memset"); asm ("memcpy = __GI_memcpy"); diff --git a/lib/libc/glibc/sysdeps/generic/sysdep.h b/lib/libc/glibc/sysdeps/generic/sysdep.h index 39cac91b94..e77be376f7 100644 --- a/lib/libc/glibc/sysdeps/generic/sysdep.h +++ b/lib/libc/glibc/sysdeps/generic/sysdep.h @@ -1,5 +1,5 @@ /* Generic asm macros used on many machines. - Copyright (C) 1991-2021 Free Software Foundation, Inc. + Copyright (C) 1991-2023 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 @@ -35,7 +35,7 @@ # endif #endif -/* Makros to generate eh_frame unwind information. */ +/* Macros to generate eh_frame unwind information. */ #ifdef __ASSEMBLER__ # define cfi_startproc .cfi_startproc # define cfi_endproc .cfi_endproc diff --git a/lib/libc/glibc/sysdeps/generic/tls.h b/lib/libc/glibc/sysdeps/generic/tls.h index e86d70e6ce..bb4fe6c74c 100644 --- a/lib/libc/glibc/sysdeps/generic/tls.h +++ b/lib/libc/glibc/sysdeps/generic/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. Generic version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 @@ -19,6 +19,11 @@ /* An architecture-specific version of this file has to defined a number of symbols: + TCB_ALIGNMENT + + Alignment of THREAD_SELF (struct pthread *) and the thread + pointer. + TLS_TCB_AT_TP or TLS_DTV_AT_TP The presence of one of these symbols signals which variant of @@ -43,15 +48,6 @@ dynamic linker itself. There are no threads in use at that time. - TLS_TCB_ALIGN - - Alignment requirements for the TCB structure. - - TLS_INIT_TCB_ALIGN - - Similarly, but for the structure used at startup time. - - INSTALL_DTV(tcb, init_dtv) This macro must install the given initial DTV into the thread control @@ -71,10 +67,4 @@ This macro returns the address of the DTV of the current thread. This normally is done using the thread register which points to the dtv or the TCB (from which the DTV can found). - - - THREAD_GSCOPE_IN_TCB - - This should be set to 1 if the global scope flag is stored within the TCB. - When set to 0, GL(_dl_thread_gscope_count) will be defined to store it. */ diff --git a/lib/libc/glibc/sysdeps/hppa/crti.S b/lib/libc/glibc/sysdeps/hppa/crti.S index 3864d47d51..eb29e9e4c4 100644 --- a/lib/libc/glibc/sysdeps/hppa/crti.S +++ b/lib/libc/glibc/sysdeps/hppa/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for HPPA - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/hppa/crtn.S b/lib/libc/glibc/sysdeps/hppa/crtn.S index 42ca2d1f32..21366369ec 100644 --- a/lib/libc/glibc/sysdeps/hppa/crtn.S +++ b/lib/libc/glibc/sysdeps/hppa/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for HPPA - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/hppa/entry.h b/lib/libc/glibc/sysdeps/hppa/entry.h index 5ea5b47448..f88bb5689d 100644 --- a/lib/libc/glibc/sysdeps/hppa/entry.h +++ b/lib/libc/glibc/sysdeps/hppa/entry.h @@ -1,6 +1,4 @@ -#ifndef __ASSEMBLY__ extern void _start (void); -#endif /* Lives in libgcc.so and canonicalizes function pointers for comparison. */ extern unsigned int __canonicalize_funcptr_for_compare (unsigned int fptr); @@ -8,6 +6,3 @@ extern unsigned int __canonicalize_funcptr_for_compare (unsigned int fptr); /* The function's entry point is stored in the first word of the function descriptor (plabel) of _start(). */ #define ENTRY_POINT __canonicalize_funcptr_for_compare((unsigned int)_start) - -/* We have to provide a special declaration. */ -#define ENTRY_POINT_DECL(class) class void _start (void); diff --git a/lib/libc/glibc/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h index bbd6176007..999195c5b0 100644 --- a/lib/libc/glibc/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2021 Free Software Foundation, Inc. +/* Copyright (C) 2005-2023 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 diff --git a/lib/libc/glibc/sysdeps/hppa/start.S b/lib/libc/glibc/sysdeps/hppa/start.S index 4a1877f8e8..cfc22ab75b 100644 --- a/lib/libc/glibc/sysdeps/hppa/start.S +++ b/lib/libc/glibc/sysdeps/hppa/start.S @@ -1,5 +1,5 @@ /* ELF startup code for HPPA. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/hppa/sysdep.h b/lib/libc/glibc/sysdeps/hppa/sysdep.h index e3d3cf40ce..0e020a3152 100644 --- a/lib/libc/glibc/sysdeps/hppa/sysdep.h +++ b/lib/libc/glibc/sysdeps/hppa/sysdep.h @@ -1,7 +1,6 @@ /* Assembler macros for HP/PA. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, , August 1999. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/htl/bits/pthread.h b/lib/libc/glibc/sysdeps/htl/bits/pthread.h index 63dce24889..57589a191c 100644 --- a/lib/libc/glibc/sysdeps/htl/bits/pthread.h +++ b/lib/libc/glibc/sysdeps/htl/bits/pthread.h @@ -1,5 +1,5 @@ /* Pthread data structures. Generic version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 @@ -19,7 +19,7 @@ #ifndef _BITS_PTHREAD_H #define _BITS_PTHREAD_H 1 -typedef int __pthread_t; +#include /* Return true if __T1 and __T2 both name the same thread. Otherwise, false. */ diff --git a/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h b/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h index 9088377d22..50c9bd4724 100644 --- a/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h +++ b/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h @@ -1,5 +1,5 @@ /* Common threading primitives definitions for both POSIX and C11. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 @@ -21,9 +21,9 @@ #include #include +#include typedef int __tss_t; -typedef int __thrd_t; typedef union { diff --git a/lib/libc/glibc/sysdeps/htl/libc-lockP.h b/lib/libc/glibc/sysdeps/htl/libc-lockP.h index eb09171c85..1b98f3ccd0 100644 --- a/lib/libc/glibc/sysdeps/htl/libc-lockP.h +++ b/lib/libc/glibc/sysdeps/htl/libc-lockP.h @@ -1,5 +1,5 @@ /* Private libc-internal interface for mutex locks. - Copyright (C) 2015-2021 Free Software Foundation, Inc. + Copyright (C) 2015-2023 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 diff --git a/lib/libc/glibc/sysdeps/htl/pthread.h b/lib/libc/glibc/sysdeps/htl/pthread.h index 6bcf97d692..cc9e7bf94d 100644 --- a/lib/libc/glibc/sysdeps/htl/pthread.h +++ b/lib/libc/glibc/sysdeps/htl/pthread.h @@ -1,5 +1,5 @@ /* Posix threads. Hurd version. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 @@ -623,7 +623,7 @@ extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict int *__restrict __pshared) __THROW __nonnull ((1, 2)); -/* Set the value of the process shared atrribute in *ATTR to +/* Set the value of the process shared attribute in *ATTR to PSHARED. */ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared) @@ -645,7 +645,7 @@ extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, # include # define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER -/* Create a rwlock object with attributes given by ATTR and strore the +/* Create a rwlock object with attributes given by ATTR and store the result in *RWLOCK. */ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, const pthread_rwlockattr_t *__restrict __attr) @@ -709,7 +709,7 @@ extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) -/* Cancelation. */ +/* Cancellation. */ /* Register a cleanup handler. */ extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg); @@ -769,7 +769,7 @@ extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restri int *__restrict __pshared) __THROW __nonnull ((1, 2)); -/* Set the value of the process shared atrribute in *ATTR to +/* Set the value of the process shared attribute in *ATTR to PSHARED. */ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, int __pshared) @@ -878,12 +878,12 @@ extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock) /* Scheduling. */ -/* Return thread THREAD's scheduling paramters. */ +/* Return thread THREAD's scheduling parameters. */ extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull ((2, 3)); -/* Set thread THREAD's scheduling paramters. */ +/* Set thread THREAD's scheduling parameters. */ extern int pthread_setschedparam (pthread_t __thr, int __policy, const struct sched_param *__param) __THROW __nonnull ((3)); diff --git a/lib/libc/glibc/sysdeps/i386/crti.S b/lib/libc/glibc/sysdeps/i386/crti.S index fd60a117e1..268ae75725 100644 --- a/lib/libc/glibc/sysdeps/i386/crti.S +++ b/lib/libc/glibc/sysdeps/i386/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for x86. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/i386/crtn.S b/lib/libc/glibc/sysdeps/i386/crtn.S index 97138b51d2..dc77093e8b 100644 --- a/lib/libc/glibc/sysdeps/i386/crtn.S +++ b/lib/libc/glibc/sysdeps/i386/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for x86. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h index e27c364b6d..06dc4b09fb 100644 --- a/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. Hurd i386 version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/i386/start.S b/lib/libc/glibc/sysdeps/i386/start.S index 5296b27e65..4c98fc6534 100644 --- a/lib/libc/glibc/sysdeps/i386/start.S +++ b/lib/libc/glibc/sysdeps/i386/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF i386 ABI. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 @@ -98,11 +98,10 @@ ENTRY (_start) pushl main@GOT(%ebx) # else /* Avoid relocation in static PIE since _start is called before - it is relocated. Don't use "leal main@GOTOFF(%ebx), %eax" - since main may be in a shared object. Linker will convert - "movl main@GOT(%ebx), %eax" to "leal main@GOTOFF(%ebx), %eax" + it is relocated. This also avoid rely on linker optimization to + transform 'movl main@GOT(%ebx), %eax' to 'leal main@GOTOFF(%ebx)' if main is defined locally. */ - movl main@GOT(%ebx), %eax + leal __wrap_main@GOTOFF(%ebx), %eax pushl %eax # endif @@ -130,6 +129,12 @@ ENTRY (_start) 1: movl (%esp), %ebx ret #endif + +#if defined PIC && !defined SHARED +__wrap_main: + _CET_ENDBR + jmp main@PLT +#endif END (_start) /* To fulfill the System V/i386 ABI we need this symbol. Yuck, it's so diff --git a/lib/libc/glibc/sysdeps/i386/symbol-hacks.h b/lib/libc/glibc/sysdeps/i386/symbol-hacks.h index 5665553260..68ca51e9ab 100644 --- a/lib/libc/glibc/sysdeps/i386/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/i386/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. i386 version. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/sysdeps/i386/sysdep.h b/lib/libc/glibc/sysdeps/i386/sysdep.h index 3599d1a653..0e366974ce 100644 --- a/lib/libc/glibc/sysdeps/i386/sysdep.h +++ b/lib/libc/glibc/sysdeps/i386/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for i386. - Copyright (C) 1991-2021 Free Software Foundation, Inc. + Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/sysdeps/ia64/crti.S b/lib/libc/glibc/sysdeps/ia64/crti.S index e26e2523da..a8e8a2c837 100644 --- a/lib/libc/glibc/sysdeps/ia64/crti.S +++ b/lib/libc/glibc/sysdeps/ia64/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for IA64. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/ia64/crtn.S b/lib/libc/glibc/sysdeps/ia64/crtn.S index e2c44844b9..5c74920a45 100644 --- a/lib/libc/glibc/sysdeps/ia64/crtn.S +++ b/lib/libc/glibc/sysdeps/ia64/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for ARM. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h index 45e1226bfb..170f0de583 100644 --- a/lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. IA-64 version. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/ia64/dl-sysdep.h b/lib/libc/glibc/sysdeps/ia64/dl-sysdep.h deleted file mode 100644 index bd29ee0d14..0000000000 --- a/lib/libc/glibc/sysdeps/ia64/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. IA-64 version. - Copyright (C) 2002-2021 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 - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/lib/libc/glibc/sysdeps/ia64/entry.h b/lib/libc/glibc/sysdeps/ia64/entry.h index e11b49fc53..9ae8b8615c 100644 --- a/lib/libc/glibc/sysdeps/ia64/entry.h +++ b/lib/libc/glibc/sysdeps/ia64/entry.h @@ -1,13 +1,8 @@ #include #include -#ifndef __ASSEMBLY__ extern void _start (void); -#endif /* The function's entry point is stored in the first word of the function descriptor (plabel) of _start(). */ #define ENTRY_POINT ELF_PTR_TO_FDESC (_start)->ip - -/* We have to provide a special declaration. */ -#define ENTRY_POINT_DECL(class) class void _start (void); diff --git a/lib/libc/glibc/sysdeps/ia64/start.S b/lib/libc/glibc/sysdeps/ia64/start.S index b28f8cb429..e07304d3ed 100644 --- a/lib/libc/glibc/sysdeps/ia64/start.S +++ b/lib/libc/glibc/sysdeps/ia64/start.S @@ -1,6 +1,5 @@ -/* Copyright (C) 1999-2021 Free Software Foundation, Inc. +/* Copyright (C) 1999-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Written by Jes Sorensen, , April 1999. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/ia64/sysdep.h b/lib/libc/glibc/sysdeps/ia64/sysdep.h index 0ce3a862c3..cfd884bbf0 100644 --- a/lib/libc/glibc/sysdeps/ia64/sysdep.h +++ b/lib/libc/glibc/sysdeps/ia64/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. +/* Copyright (C) 2000-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David Mosberger-Tang The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h b/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h index 3a4d8f9d50..c52d10998c 100644 --- a/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h +++ b/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for Coldfire. - Copyright (C) 1998-2021 Free Software Foundation, Inc. + Copyright (C) 1998-2023 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 diff --git a/lib/libc/glibc/sysdeps/m68k/crti.S b/lib/libc/glibc/sysdeps/m68k/crti.S index 45b1f276ef..c49dfa8f9c 100644 --- a/lib/libc/glibc/sysdeps/m68k/crti.S +++ b/lib/libc/glibc/sysdeps/m68k/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for m68k. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/m68k/crtn.S b/lib/libc/glibc/sysdeps/m68k/crtn.S index bc4a4a58e6..3161cb5292 100644 --- a/lib/libc/glibc/sysdeps/m68k/crtn.S +++ b/lib/libc/glibc/sysdeps/m68k/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for m68k. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h b/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h index 3583820a11..b31e101273 100644 --- a/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h +++ b/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for m680x0. - Copyright (C) 2010-2021 Free Software Foundation, Inc. + Copyright (C) 2010-2023 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 diff --git a/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h index c566403fbc..f63fb041f3 100644 --- a/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h @@ -1,6 +1,5 @@ -/* Copyright (C) 2010-2021 Free Software Foundation, Inc. +/* Copyright (C) 2010-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Maxim Kuvyrkov , 2010. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/m68k/start.S b/lib/libc/glibc/sysdeps/m68k/start.S index 98da4db9f3..db8e47e3d5 100644 --- a/lib/libc/glibc/sysdeps/m68k/start.S +++ b/lib/libc/glibc/sysdeps/m68k/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF m68k ABI. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h b/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h index 8f1635faab..415c2e7cd2 100644 --- a/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. m68k version. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/sysdeps/m68k/sysdep.h b/lib/libc/glibc/sysdeps/m68k/sysdep.h index 8f474a911f..dfc8aebc3a 100644 --- a/lib/libc/glibc/sysdeps/m68k/sysdep.h +++ b/lib/libc/glibc/sysdeps/m68k/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for m68k. - Copyright (C) 1998-2021 Free Software Foundation, Inc. + Copyright (C) 1998-2023 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 diff --git a/lib/libc/glibc/sysdeps/mach/i386/sysdep.h b/lib/libc/glibc/sysdeps/mach/i386/sysdep.h deleted file mode 100644 index 5523a8b5f2..0000000000 --- a/lib/libc/glibc/sysdeps/mach/i386/sysdep.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (C) 1991-2021 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 - . */ - -#ifndef _MACH_I386_SYSDEP_H -#define _MACH_I386_SYSDEP_H 1 - -/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ -#include -#include - -#define LOSE asm volatile ("hlt") - -#define SNARF_ARGS(entry_sp, argc, argv, envp) \ - do \ - { \ - char **p; \ - argc = (int) *entry_sp; \ - argv = (char **) (entry_sp + 1); \ - p = argv; \ - while (*p++ != NULL) \ - ; \ - if (p >= (char **) argv[0]) \ - --p; \ - envp = p; \ - } while (0) - -#define RETURN_TO(sp, pc, retval) \ - asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \ - : : "g" (sp), "r" (pc), "a" (retval)) - - -#define STACK_GROWTH_DOWN - -/* Get the machine-independent Mach definitions. */ -#include - - -/* This should be rearranged, but at the moment this file provides - the most useful definitions for assembler syntax details. */ -#undef ENTRY -#undef ALIGN -#include - -#endif /* mach/i386/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/mach/libc-lock.h b/lib/libc/glibc/sysdeps/mach/libc-lock.h index 220fcee921..c5c2553c7b 100644 --- a/lib/libc/glibc/sysdeps/mach/libc-lock.h +++ b/lib/libc/glibc/sysdeps/mach/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. Mach cthreads version. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 @@ -34,9 +34,8 @@ typedef struct typedef __libc_lock_recursive_t __rtld_lock_recursive_t; -extern char __libc_lock_self0[0]; #define __libc_lock_owner_self() \ - (__LIBC_NO_TLS () ? (void *)&__libc_lock_self0 : THREAD_SELF) + (__LIBC_NO_TLS () ? (void *) 1 : THREAD_SELF) #else typedef struct __libc_lock_opaque__ __libc_lock_t; @@ -71,14 +70,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; /* Lock the named lock variable. */ #define __libc_lock_lock(NAME) \ - ({ lll_lock ((NAME), 0); 0; }) + ({ lll_lock ((NAME), LLL_PRIVATE); 0; }) /* Lock the named lock variable. */ #define __libc_lock_trylock(NAME) lll_trylock (NAME) /* Unlock the named lock variable. */ #define __libc_lock_unlock(NAME) \ - ({ lll_unlock ((NAME), 0); 0; }) + ({ lll_unlock ((NAME), LLL_PRIVATE); 0; }) #define __libc_lock_define_recursive(CLASS,NAME) \ CLASS __libc_lock_recursive_t NAME; diff --git a/lib/libc/glibc/sysdeps/mach/sysdep.h b/lib/libc/glibc/sysdeps/mach/sysdep.h index ae306b3cad..35ad1e3920 100644 --- a/lib/libc/glibc/sysdeps/mach/sysdep.h +++ b/lib/libc/glibc/sysdeps/mach/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1994-2021 Free Software Foundation, Inc. +/* Copyright (C) 1994-2023 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 @@ -30,6 +30,7 @@ /* For ELF we need to add the `.type' directive to make shared libraries work right. */ #undef ENTRY +#undef ENTRY2 #define ENTRY(name) \ .globl name; \ .align ALIGN; \ @@ -44,7 +45,7 @@ #ifndef __ASSEMBLER__ #define FATAL_PREPARE_INCLUDE -#define FATAL_PREPARE __mig_dealloc_reply_port (MACH_PORT_NULL) +#define FATAL_PREPARE __mig_dealloc_reply_port (__mig_get_reply_port ()) #endif /* sysdeps/mach/MACHINE/sysdep.h should define the following macros. */ diff --git a/lib/libc/glibc/sysdeps/microblaze/crti.S b/lib/libc/glibc/sysdeps/microblaze/crti.S index 3eb70cf9f1..5eb0e283cc 100644 --- a/lib/libc/glibc/sysdeps/microblaze/crti.S +++ b/lib/libc/glibc/sysdeps/microblaze/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MicroBlaze. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/microblaze/crtn.S b/lib/libc/glibc/sysdeps/microblaze/crtn.S index c82fbd947c..2e152c917e 100644 --- a/lib/libc/glibc/sysdeps/microblaze/crtn.S +++ b/lib/libc/glibc/sysdeps/microblaze/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MicroBlaze. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/microblaze/start.S b/lib/libc/glibc/sysdeps/microblaze/start.S index 6589bd4dc7..c35c47376a 100644 --- a/lib/libc/glibc/sysdeps/microblaze/start.S +++ b/lib/libc/glibc/sysdeps/microblaze/start.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2021 Free Software Foundation, Inc. +/* Copyright (C) 1995-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/microblaze/sysdep.h b/lib/libc/glibc/sysdeps/microblaze/sysdep.h index a219258926..47d48fab8d 100644 --- a/lib/libc/glibc/sysdeps/microblaze/sysdep.h +++ b/lib/libc/glibc/sysdeps/microblaze/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h index 323c577f52..a3bf354b83 100644 --- a/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. MIPS version. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/mips32/crti.S b/lib/libc/glibc/sysdeps/mips/mips32/crti.S index 056c4f75c2..155cd8fef7 100644 --- a/lib/libc/glibc/sysdeps/mips/mips32/crti.S +++ b/lib/libc/glibc/sysdeps/mips/mips32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (o32). - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/mips32/crtn.S b/lib/libc/glibc/sysdeps/mips/mips32/crtn.S index f677e1cc25..bad74636ae 100644 --- a/lib/libc/glibc/sysdeps/mips/mips32/crtn.S +++ b/lib/libc/glibc/sysdeps/mips/mips32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (o32). - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S b/lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S index 8dc866b20e..bd3c9ea5ef 100644 --- a/lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S +++ b/lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n32). - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S b/lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S index 820111c4cb..084775ac88 100644 --- a/lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S +++ b/lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n32). - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S b/lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S index 52666963d5..b21c052aa4 100644 --- a/lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S +++ b/lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n64). - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S b/lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S index 875c8e06c5..1d9c59fa9d 100644 --- a/lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S +++ b/lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for MIPS (n64). - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h index fbe0a46e3b..99812f5c41 100644 --- a/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. MIPS version. - Copyright (C) 2005-2021 Free Software Foundation, Inc. + Copyright (C) 2005-2023 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 diff --git a/lib/libc/glibc/sysdeps/mips/start.S b/lib/libc/glibc/sysdeps/mips/start.S index 4ec42a2a7f..35ef4403f8 100644 --- a/lib/libc/glibc/sysdeps/mips/start.S +++ b/lib/libc/glibc/sysdeps/mips/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF Mips ABI. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 @@ -60,7 +60,7 @@ ... NULL ra ($31) The return address register is set to zero so that programs - that search backword through stack frames recognize the last + that search backward through stack frames recognize the last stack frame. */ diff --git a/lib/libc/glibc/sysdeps/nios2/sysdep.h b/lib/libc/glibc/sysdeps/nios2/sysdep.h index 83b79f8a32..34b2a9ff70 100644 --- a/lib/libc/glibc/sysdeps/nios2/sysdep.h +++ b/lib/libc/glibc/sysdeps/nios2/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for Nios II. - Copyright (C) 2015-2021 Free Software Foundation, Inc. + Copyright (C) 2015-2023 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 diff --git a/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h b/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h index 4d4a255368..65464ee88c 100644 --- a/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h +++ b/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h @@ -1,5 +1,5 @@ /* Declaration of common pthread types for all architectures. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h b/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h index 44bf1e358d..2de6ff9caf 100644 --- a/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h +++ b/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h @@ -1,5 +1,5 @@ /* Common threading primitives definitions for both POSIX and C11. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 @@ -43,6 +43,8 @@ #include +#include + /* Common definition of pthread_mutex_t. */ @@ -91,24 +93,8 @@ typedef struct __pthread_internal_slist struct __pthread_cond_s { - __extension__ union - { - __extension__ unsigned long long int __wseq; - struct - { - unsigned int __low; - unsigned int __high; - } __wseq32; - }; - __extension__ union - { - __extension__ unsigned long long int __g1_start; - struct - { - unsigned int __low; - unsigned int __high; - } __g1_start32; - }; + __atomic_wide_counter __wseq; + __atomic_wide_counter __g1_start; unsigned int __g_refs[2] __LOCK_ALIGNMENT; unsigned int __g_size[2]; unsigned int __g1_orig_size; diff --git a/lib/libc/glibc/sysdeps/nptl/libc-lock.h b/lib/libc/glibc/sysdeps/nptl/libc-lock.h index e8a5e68a12..61027be74c 100644 --- a/lib/libc/glibc/sysdeps/nptl/libc-lock.h +++ b/lib/libc/glibc/sysdeps/nptl/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. NPTL version. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 @@ -22,6 +22,7 @@ #include #define __need_NULL #include +#include /* Mutex type. */ @@ -29,7 +30,12 @@ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t; # else -typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t; +typedef struct +{ + int lock __LIBC_LOCK_ALIGNMENT; + int cnt; + void *owner; +} __libc_lock_recursive_t; # endif #else typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; diff --git a/lib/libc/glibc/sysdeps/nptl/libc-lockP.h b/lib/libc/glibc/sysdeps/nptl/libc-lockP.h index b66c938e44..27169bdf4c 100644 --- a/lib/libc/glibc/sysdeps/nptl/libc-lockP.h +++ b/lib/libc/glibc/sysdeps/nptl/libc-lockP.h @@ -1,5 +1,5 @@ /* Private libc-internal interface for mutex locks. NPTL version. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 @@ -32,9 +32,10 @@ ld.so might be used on old kernels with a different libc.so. */ #include #include +#include /* Mutex type. */ -typedef int __libc_lock_t; +typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT; typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t; typedef pthread_rwlock_t __libc_rwlock_t; diff --git a/lib/libc/glibc/sysdeps/nptl/pthread.h b/lib/libc/glibc/sysdeps/nptl/pthread.h index f1b7f2bdc6..7f65483542 100644 --- a/lib/libc/glibc/sysdeps/nptl/pthread.h +++ b/lib/libc/glibc/sysdeps/nptl/pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. +/* Copyright (C) 2002-2023 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 @@ -516,7 +516,7 @@ extern int pthread_once (pthread_once_t *__once_control, exception in C++ code. If cancellation is implemented by unwinding this is necessary to have the compiler generate the unwind information. */ -/* Set cancelability state of current thread to STATE, returning old +/* Set cancellability state of current thread to STATE, returning old state in *OLDSTATE if OLDSTATE is not NULL. */ extern int pthread_setcancelstate (int __state, int *__oldstate); @@ -933,7 +933,7 @@ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, # ifdef __USE_GNU # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (pthread_mutexattr_getrobust_np, - (pthread_mutex_t *, int *), + (pthread_mutexattr_t *, int *), pthread_mutexattr_getrobust) __nonnull ((1)) __attribute_deprecated_msg__ ("\ pthread_mutexattr_getrobust_np is deprecated, use pthread_mutexattr_getrobust"); @@ -949,7 +949,7 @@ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, # ifdef __USE_GNU # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np, - (pthread_mutex_t *, int), + (pthread_mutexattr_t *, int), pthread_mutexattr_setrobust) __nonnull ((1)) __attribute_deprecated_msg__ ("\ pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust"); @@ -981,7 +981,7 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); # ifdef __USE_XOPEN2K -/* Try to acquire read lock for RWLOCK or return after specfied time. */ +/* Try to acquire read lock for RWLOCK or return after specified time. */ # ifndef __USE_TIME_BITS64 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict @@ -1028,7 +1028,7 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); # ifdef __USE_XOPEN2K -/* Try to acquire write lock for RWLOCK or return after specfied time. */ +/* Try to acquire write lock for RWLOCK or return after specified time. */ # ifndef __USE_TIME_BITS64 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/crti.S b/lib/libc/glibc/sysdeps/powerpc/powerpc32/crti.S index 4a5f53a995..55247c13a1 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/crti.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for PowerPC. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/crtn.S b/lib/libc/glibc/sysdeps/powerpc/powerpc32/crtn.S index fdf6a43275..735f42958d 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/crtn.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for PowerPC. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S b/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S index 39ce1a18ff..644f6f530c 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S @@ -1,5 +1,5 @@ /* Startup code for programs linked with GNU libc. - Copyright (C) 1998-2021 Free Software Foundation, Inc. + Copyright (C) 1998-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h b/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h index d4474e15d0..d34699233b 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. powerpc version. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h b/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h index 4fef254988..095a726765 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for 32-bit PowerPC. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S b/lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S index 1b0d866c98..948e1a026e 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for PowerPC64. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/crtn.S b/lib/libc/glibc/sysdeps/powerpc/powerpc64/crtn.S index 1a36eb8ad0..11f837be43 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/crtn.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for PowerPC64. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h index 820681c801..427479d86c 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. PowerPC64 version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/entry.h b/lib/libc/glibc/sysdeps/powerpc/powerpc64/entry.h deleted file mode 100644 index 99c81cb982..0000000000 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/entry.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Finding the entry point and start of text. PowerPC64 version. - Copyright (C) 2002-2021 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 - . */ - - -#ifndef __ASSEMBLY__ -extern void _start (void); -#endif - -#define ENTRY_POINT _start - -#if _CALL_ELF != 2 -/* We have to provide a special declaration. */ -#define ENTRY_POINT_DECL(class) class void _start (void); - -/* Use the address of ._start as the lowest address for which we need - to keep profiling records. We can't copy the ia64 scheme as our - entry poiny address is really the address of the function - descriptor, not the actual function entry. */ -#define TEXT_START \ - ({ extern unsigned long int _start_as_data[] asm ("_start"); \ - _start_as_data[0]; }) -#endif diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S b/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S index 71c0c67926..f86d400f4c 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S @@ -1,5 +1,5 @@ /* Startup code for programs linked with GNU libc. PowerPC64 version. - Copyright (C) 1998-2021 Free Software Foundation, Inc. + Copyright (C) 1998-2023 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 @@ -74,7 +74,8 @@ ENTRY (_start) /* put the address of start_addresses in r8... ** ** PPC64 ABI uses R13 for thread local, so we leave it alone */ - ld r8,.L01@toc(r2) + addis r8,r2,.L01@toc@ha + ld r8,.L01@toc@l(r8) /* and continue in libc-start, in glibc. */ b JUMPTARGET(__libc_start_main) diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h b/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h index 589f7c8d18..ce92d8b3d2 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for 64-bit PowerPC. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 @@ -275,12 +275,14 @@ LT_LABELSUFFIX(name,_name_end): ; \ /* Allocate frame and save register */ #define NVOLREG_SAVE \ stdu r1,-SCV_FRAME_SIZE(r1); \ + cfi_adjust_cfa_offset(SCV_FRAME_SIZE); \ std r31,SCV_FRAME_NVOLREG_SAVE(r1); \ - cfi_adjust_cfa_offset(SCV_FRAME_SIZE); + cfi_rel_offset(r31,SCV_FRAME_NVOLREG_SAVE); /* Restore register and destroy frame */ #define NVOLREG_RESTORE \ ld r31,SCV_FRAME_NVOLREG_SAVE(r1); \ + cfi_restore(r31); \ addi r1,r1,SCV_FRAME_SIZE; \ cfi_adjust_cfa_offset(-SCV_FRAME_SIZE); @@ -331,13 +333,13 @@ LT_LABELSUFFIX(name,_name_end): ; \ #define DO_CALL_SCV \ mflr r9; \ - std r9,FRAME_LR_SAVE(r1); \ - cfi_offset(lr,FRAME_LR_SAVE); \ + std r9,SCV_FRAME_SIZE+FRAME_LR_SAVE(r1); \ + cfi_rel_offset(lr,SCV_FRAME_SIZE+FRAME_LR_SAVE); \ .machine "push"; \ .machine "power9"; \ scv 0; \ .machine "pop"; \ - ld r9,FRAME_LR_SAVE(r1); \ + ld r9,SCV_FRAME_SIZE+FRAME_LR_SAVE(r1); \ mtlr r9; \ cfi_restore(lr); @@ -467,14 +469,16 @@ LT_LABELSUFFIX(name,_name_end): ; \ .tc _rtld_global_ro[TC],_rtld_global_ro # endif # define __GLRO(rOUT, var, offset) \ - ld rOUT,.LC__ ## var@toc(r2); \ + addis rOUT,r2,.LC__ ## var@toc@ha; \ + ld rOUT,.LC__ ## var@toc@l(rOUT); \ lwz rOUT,offset(rOUT) #else # define __GLRO_DEF(var) \ .LC__ ## var: \ .tc _ ## var[TC],_ ## var # define __GLRO(rOUT, var, offset) \ - ld rOUT,.LC__ ## var@toc(r2); \ + addis rOUT,r2,.LC__ ## var@toc@ha; \ + ld rOUT,.LC__ ## var@toc@l(rOUT); \ lwz rOUT,0(rOUT) #endif diff --git a/lib/libc/glibc/sysdeps/powerpc/sysdep.h b/lib/libc/glibc/sysdeps/powerpc/sysdep.h index ab20890ca6..1ac6cbfc01 100644 --- a/lib/libc/glibc/sysdeps/powerpc/sysdep.h +++ b/lib/libc/glibc/sysdeps/powerpc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2021 Free Software Foundation, Inc. +/* Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h index 283b53ebac..1f0750e6df 100644 --- a/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. RISC-V version. - Copyright (C) 2011-2021 Free Software Foundation, Inc. + Copyright (C) 2011-2023 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 diff --git a/lib/libc/glibc/sysdeps/riscv/start.S b/lib/libc/glibc/sysdeps/riscv/start.S index 806f6aacd6..6dfe65273f 100644 --- a/lib/libc/glibc/sysdeps/riscv/start.S +++ b/lib/libc/glibc/sysdeps/riscv/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF RISC-V ABI. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-32/crti.S b/lib/libc/glibc/sysdeps/s390/s390-32/crti.S index a9ff816793..429c207076 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-32/crti.S +++ b/lib/libc/glibc/sysdeps/s390/s390-32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for S/390. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-32/crtn.S b/lib/libc/glibc/sysdeps/s390/s390-32/crtn.S index 3ec9fec1bf..d5f29fdfed 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-32/crtn.S +++ b/lib/libc/glibc/sysdeps/s390/s390-32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for S/390. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-32/dl-sysdep.h b/lib/libc/glibc/sysdeps/s390/s390-32/dl-sysdep.h deleted file mode 100644 index bd6fcbbb99..0000000000 --- a/lib/libc/glibc/sysdeps/s390/s390-32/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. S/390 version. - Copyright (C) 2014-2021 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 - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/lib/libc/glibc/sysdeps/s390/s390-32/start.S b/lib/libc/glibc/sysdeps/s390/s390-32/start.S index b6cfa4caf3..23166f6226 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-32/start.S +++ b/lib/libc/glibc/sysdeps/s390/s390-32/start.S @@ -1,6 +1,5 @@ /* Startup code compliant to the ELF s390 ABI. - Copyright (C) 2000-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2000-2023 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 @@ -81,7 +80,7 @@ _start: /* Usually the auxiliary vector can be expected directly after the environment variables. But we have to skip extra zeros - because the loader might have removed unsecure variables for + because the loader might have removed insecure variables for setuid programs. */ .L26: l %r5,0(%r6) diff --git a/lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h b/lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h index 7132d0db19..cd62fcbc02 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. s390 version. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h b/lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h index 099a95fd1a..0ecb3bdae1 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h +++ b/lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h @@ -1,6 +1,5 @@ /* Assembler macros for s390. - Copyright (C) 2000-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-64/crti.S b/lib/libc/glibc/sysdeps/s390/s390-64/crti.S index 3aa441187d..11ab75e8d9 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-64/crti.S +++ b/lib/libc/glibc/sysdeps/s390/s390-64/crti.S @@ -1,6 +1,5 @@ /* Special .init and .fini section support for 64 bit S/390. - Copyright (C) 2001-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2001-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-64/crtn.S b/lib/libc/glibc/sysdeps/s390/s390-64/crtn.S index 2271f56981..0eabcb346c 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-64/crtn.S +++ b/lib/libc/glibc/sysdeps/s390/s390-64/crtn.S @@ -1,6 +1,5 @@ /* Special .init and .fini section support for 64 bit S/390. - Copyright (C) 2001-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2001-2023 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 diff --git a/lib/libc/glibc/sysdeps/s390/s390-64/start.S b/lib/libc/glibc/sysdeps/s390/s390-64/start.S index 4e6526308a..61720c348b 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-64/start.S +++ b/lib/libc/glibc/sysdeps/s390/s390-64/start.S @@ -1,6 +1,5 @@ /* Startup code compliant to the 64 bit S/390 ELF ABI. - Copyright (C) 2001-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2001-2023 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 @@ -85,10 +84,25 @@ _start: /* Ok, now branch to the libc main routine. */ #ifdef PIC +# ifdef SHARED + /* Used for dynamic linked position independent executable. + => Scrt1.o */ larl %r2,main@GOTENT # load pointer to main lg %r2,0(%r2) +# else + /* Used for dynamic linked position dependent executable. + => crt1.o (glibc configured without --disable-default-pie: + PIC is defined) + Or for static linked position independent executable. + => rcrt1.o (only available if glibc configured without + --disable-default-pie: PIC is defined) */ + larl %r2,__wrap_main +# endif brasl %r14,__libc_start_main@plt #else + /* Used for dynamic/static linked position dependent executable. + => crt1.o (glibc configured with --disable-default-pie: + PIC and SHARED are not defined) */ larl %r2,main # load pointer to main brasl %r14,__libc_start_main #endif @@ -98,6 +112,19 @@ _start: cfi_endproc +#if defined PIC && !defined SHARED + /* When main is not defined in the executable but in a shared library + then a wrapper is needed in crt1.o of the static-pie enabled libc, + because crt1.o and rcrt1.o share code and the later must avoid the + use of GOT relocations before __libc_start_main is called. */ +__wrap_main: + cfi_startproc + larl %r1,main@GOTENT # load pointer to main + lg %r1,0(%r1) + br %r1 + cfi_endproc +#endif + /* Define a symbol for the first piece of initialized data. */ .data .globl __data_start diff --git a/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h b/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h index 136f89e8fe..232580e1e0 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h +++ b/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h @@ -1,6 +1,5 @@ /* Assembler macros for 64 bit S/390. - Copyright (C) 2001-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2001-2023 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 diff --git a/lib/libc/glibc/sysdeps/sh/crti.S b/lib/libc/glibc/sysdeps/sh/crti.S index ce10e7995a..7ff0408be1 100644 --- a/lib/libc/glibc/sysdeps/sh/crti.S +++ b/lib/libc/glibc/sysdeps/sh/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for SH. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/sh/crtn.S b/lib/libc/glibc/sysdeps/sh/crtn.S index f0e3f15bca..8ce241b4d5 100644 --- a/lib/libc/glibc/sysdeps/sh/crtn.S +++ b/lib/libc/glibc/sysdeps/sh/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for SH. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/sh/start.S b/lib/libc/glibc/sysdeps/sh/start.S index 606ee59222..6578eb40ae 100644 --- a/lib/libc/glibc/sysdeps/sh/start.S +++ b/lib/libc/glibc/sysdeps/sh/start.S @@ -1,5 +1,5 @@ /* Startup code for SH & ELF. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/sh/sysdep.h b/lib/libc/glibc/sysdeps/sh/sysdep.h index 9620046d71..003b05fa25 100644 --- a/lib/libc/glibc/sysdeps/sh/sysdep.h +++ b/lib/libc/glibc/sysdeps/sh/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for SH. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/sparc/crti.S b/lib/libc/glibc/sysdeps/sparc/crti.S index 55ee921723..29c45c09cb 100644 --- a/lib/libc/glibc/sysdeps/sparc/crti.S +++ b/lib/libc/glibc/sysdeps/sparc/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for sparc. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/sparc/crtn.S b/lib/libc/glibc/sysdeps/sparc/crtn.S index e2ea73b905..065569a453 100644 --- a/lib/libc/glibc/sysdeps/sparc/crtn.S +++ b/lib/libc/glibc/sysdeps/sparc/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for sparc. - Copyright (C) 1995-2021 Free Software Foundation, Inc. + Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h index a247852bc3..08ca311749 100644 --- a/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. SPARC version. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/sparc/dl-sysdep.h b/lib/libc/glibc/sysdeps/sparc/dl-sysdep.h deleted file mode 100644 index 31e5aff1c3..0000000000 --- a/lib/libc/glibc/sysdeps/sparc/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. SPARC version. - Copyright (C) 2002-2021 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 - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/lib/libc/glibc/sysdeps/sparc/sparc32/start.S b/lib/libc/glibc/sysdeps/sparc/sparc32/start.S index 00bf898fb9..a82cbf33c2 100644 --- a/lib/libc/glibc/sysdeps/sparc/sparc32/start.S +++ b/lib/libc/glibc/sysdeps/sparc/sparc32/start.S @@ -1,7 +1,6 @@ /* Startup code for elf32-sparc - Copyright (C) 1997-2021 Free Software Foundation, Inc. + Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Richard Henderson , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/sparc/sparc64/start.S b/lib/libc/glibc/sysdeps/sparc/sparc64/start.S index 8520717eba..158c4aa08c 100644 --- a/lib/libc/glibc/sysdeps/sparc/sparc64/start.S +++ b/lib/libc/glibc/sysdeps/sparc/sparc64/start.S @@ -1,7 +1,6 @@ /* Startup code for elf64-sparc - Copyright (C) 1997-2021 Free Software Foundation, Inc. + Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Richard Henderson , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/sparc/sysdep.h b/lib/libc/glibc/sysdeps/sparc/sysdep.h index 5b4dc822b1..687e626182 100644 --- a/lib/libc/glibc/sysdeps/sparc/sysdep.h +++ b/lib/libc/glibc/sysdeps/sparc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2021 Free Software Foundation, Inc. +/* Copyright (C) 2011-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/arm/sysdep.h b/lib/libc/glibc/sysdeps/unix/arm/sysdep.h index ca7bcfc0e6..225f6376ac 100644 --- a/lib/libc/glibc/sysdeps/unix/arm/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/arm/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* Copyright (C) 1997-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/i386/sysdep.h b/lib/libc/glibc/sysdeps/unix/i386/sysdep.h index 7ca4d89318..f1fc188e98 100644 --- a/lib/libc/glibc/sysdeps/unix/i386/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/i386/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h b/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h index 21f22462db..56cfd9f62a 100644 --- a/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h b/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h index 5232afc668..2b2502e02b 100644 --- a/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Alexandre Oliva . The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/unix/mips/sysdep.h b/lib/libc/glibc/sysdeps/unix/mips/sysdep.h index 2910f8ece9..db7efd6289 100644 --- a/lib/libc/glibc/sysdeps/unix/mips/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/mips/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h b/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h index 5b5795b24d..0f255d3729 100644 --- a/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sh/sysdep.h b/lib/libc/glibc/sysdeps/unix/sh/sysdep.h index d112086ccf..8e618e5643 100644 --- a/lib/libc/glibc/sysdeps/unix/sh/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sh/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2021 Free Software Foundation, Inc. +/* Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysdep.h index 664d093c05..1ba4de99db 100644 --- a/lib/libc/glibc/sysdeps/unix/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 @@ -57,6 +57,26 @@ #define INTERNAL_SYSCALL_CALL(...) \ __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL, __VA_ARGS__) +#define __INTERNAL_SYSCALL_NCS0(name) \ + INTERNAL_SYSCALL_NCS (name, 0) +#define __INTERNAL_SYSCALL_NCS1(name, a1) \ + INTERNAL_SYSCALL_NCS (name, 1, a1) +#define __INTERNAL_SYSCALL_NCS2(name, a1, a2) \ + INTERNAL_SYSCALL_NCS (name, 2, a1, a2) +#define __INTERNAL_SYSCALL_NCS3(name, a1, a2, a3) \ + INTERNAL_SYSCALL_NCS (name, 3, a1, a2, a3) +#define __INTERNAL_SYSCALL_NCS4(name, a1, a2, a3, a4) \ + INTERNAL_SYSCALL_NCS (name, 4, a1, a2, a3, a4) +#define __INTERNAL_SYSCALL_NCS5(name, a1, a2, a3, a4, a5) \ + INTERNAL_SYSCALL_NCS (name, 5, a1, a2, a3, a4, a5) +#define __INTERNAL_SYSCALL_NCS6(name, a1, a2, a3, a4, a5, a6) \ + INTERNAL_SYSCALL_NCS (name, 6, a1, a2, a3, a4, a5, a6) +#define __INTERNAL_SYSCALL_NCS7(name, a1, a2, a3, a4, a5, a6, a7) \ + INTERNAL_SYSCALL_NCS (name, 7, a1, a2, a3, a4, a5, a6, a7) + +#define INTERNAL_SYSCALL_NCS_CALL(...) \ + __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL_NCS, __VA_ARGS__) + #define __INLINE_SYSCALL0(name) \ INLINE_SYSCALL (name, 0) #define __INLINE_SYSCALL1(name, a1) \ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h index f08850b95e..3546f6de96 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. AArch64 version. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h index d25e717c43..8b9f6e866a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2021 Free Software Foundation, Inc. +/* Copyright (C) 1996-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h index b01911247f..e94d1703ad 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2021 Free Software Foundation, Inc. +/* Copyright (C) 2005-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,7 +21,8 @@ #include #include -#include +#include +#include /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ #include @@ -164,7 +165,7 @@ # define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime" # define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" -# define SINGLE_THREAD_BY_GLOBAL 1 +# define HAVE_CLONE3_WRAPPER 1 # undef INTERNAL_SYSCALL_RAW # define INTERNAL_SYSCALL_RAW(name, nr, args...) \ @@ -235,49 +236,4 @@ #endif /* __ASSEMBLER__ */ -/* Pointer mangling is supported for AArch64. */ -#if (IS_IN (rtld) \ - || (!defined SHARED && (IS_IN (libc) \ - || IS_IN (libpthread)))) -# ifdef __ASSEMBLER__ -/* Note, dst, src, guard, and tmp are all register numbers rather than - register names so they will work with both ILP32 and LP64. */ -# define PTR_MANGLE(dst, src, guard, tmp) \ - LDST_PCREL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local)); \ - PTR_MANGLE2 (dst, src, guard) -/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ -# define PTR_MANGLE2(dst, src, guard)\ - eor x##dst, x##src, x##guard -# define PTR_DEMANGLE(dst, src, guard, tmp)\ - PTR_MANGLE (dst, src, guard, tmp) -# define PTR_DEMANGLE2(dst, src, guard)\ - PTR_MANGLE2 (dst, src, guard) -# else -extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#else -# ifdef __ASSEMBLER__ -/* Note, dst, src, guard, and tmp are all register numbers rather than - register names so they will work with both ILP32 and LP64. */ -# define PTR_MANGLE(dst, src, guard, tmp) \ - LDST_GLOBAL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard)); \ - PTR_MANGLE2 (dst, src, guard) -/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ -# define PTR_MANGLE2(dst, src, guard)\ - eor x##dst, x##src, x##guard -# define PTR_DEMANGLE(dst, src, guard, tmp)\ - PTR_MANGLE (dst, src, guard, tmp) -# define PTR_DEMANGLE2(dst, src, guard)\ - PTR_MANGLE2 (dst, src, guard) -# else -extern uintptr_t __pointer_chk_guard attribute_relro; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* linux/aarch64/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h index 9bdc925168..457bbfe4a8 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h index 9e17d3f60c..3151e75449 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2010-2021 Free Software Foundation, Inc. + Copyright (C) 2010-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h index a000c845f1..d33eb72a32 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, , August 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,8 +32,6 @@ #undef SYS_ify #define SYS_ify(syscall_name) __NR_##syscall_name -#define SINGLE_THREAD_BY_GLOBAL 1 - #ifdef __ASSEMBLER__ #include #include @@ -316,44 +313,4 @@ __LABEL(name) \ }) #endif /* ASSEMBLER */ -/* Pointer mangling support. Note that tls access is slow enough that - we don't deoptimize things by placing the pointer check value there. */ - -#ifdef __ASSEMBLER__ -# if IS_IN (rtld) -# define PTR_MANGLE(dst, src, tmp) \ - ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \ - ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \ - xor src, tmp, dst -# define PTR_MANGLE2(dst, src, tmp) \ - xor src, tmp, dst -# elif defined SHARED -# define PTR_MANGLE(dst, src, tmp) \ - ldq tmp, __pointer_chk_guard; \ - xor src, tmp, dst -# else -# define PTR_MANGLE(dst, src, tmp) \ - ldq tmp, __pointer_chk_guard_local; \ - xor src, tmp, dst -# endif -# define PTR_MANGLE2(dst, src, tmp) \ - xor src, tmp, dst -# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp) -# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp) -#else -# include -# if (IS_IN (rtld) \ - || (!defined SHARED && (IS_IN (libc) \ - || IS_IN (libpthread)))) -extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) -# else -extern uintptr_t __pointer_chk_guard attribute_relro; -# define PTR_MANGLE(var) \ - (var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard) -# endif -# define PTR_DEMANGLE(var) PTR_MANGLE(var) -#endif /* ASSEMBLER */ - #endif /* _LINUX_ALPHA_SYSDEP_H */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h index 6b70ccc687..7f90d64124 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for ARC. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 @@ -20,7 +20,9 @@ #define _LINUX_ARC_SYSDEP_H 1 #include -#include +#include +#include +#include /* "workarounds" for generic code needing to handle 64-bit time_t. */ @@ -132,8 +134,6 @@ L (call_syscall_err): ASM_LINE_SEP \ #else /* !__ASSEMBLER__ */ -# define SINGLE_THREAD_BY_GLOBAL 1 - # if IS_IN (libc) extern long int __syscall_error (long int); hidden_proto (__syscall_error) @@ -141,6 +141,8 @@ hidden_proto (__syscall_error) # define ARC_TRAP_INSN "trap_s 0 \n\t" +# define HAVE_CLONE3_WRAPPER 1 + # undef INTERNAL_SYSCALL_NCS # define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \ ({ \ @@ -180,11 +182,11 @@ hidden_proto (__syscall_error) __ret = (long int) (arg1); \ LOAD_ARGS_0 (nm, arg1) -/* Note that the use of _tmpX might look superflous, however it is needed +/* Note that the use of _tmpX might look superfluous, however it is needed to ensure that register variables are not clobbered if arg happens to be a function call itself. e.g. sched_setaffinity() calling getpid() for arg2 Also this specific order of recursive calling is important to segregate - the tmp args evaluation (function call case described above) and assigment + the tmp args evaluation (function call case described above) and assignment of register variables. */ # define LOAD_ARGS_2(nm, arg1, arg2) \ @@ -217,10 +219,6 @@ hidden_proto (__syscall_error) LOAD_ARGS_6 (nm, arg1, arg2, arg3, arg4, arg5, arg6) \ register long int _arg7 __asm__ ("r6") = _tmp7; -/* Pointer mangling not yet supported. */ -# define PTR_MANGLE(var) (void) (var) -# define PTR_DEMANGLE(var) (void) (var) - # undef HAVE_INTERNAL_BRK_ADDR_SYMBOL # define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h index 61fa9436bc..5c8f76630e 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2006-2021 Free Software Foundation, Inc. + Copyright (C) 2006-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h index 3118f5a709..91e421529a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2021 Free Software Foundation, Inc. +/* Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h index c1722557bd..2f321881c8 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -1,7 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, , August 1995. - ARM changes by Philip Blundell, , May 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -410,8 +408,6 @@ __local_syscall_error: \ #define INTERNAL_SYSCALL_NCS(number, nr, args...) \ INTERNAL_SYSCALL_RAW (number, nr, args) -#define SINGLE_THREAD_BY_GLOBAL 1 - #endif /* __ASSEMBLER__ */ #endif /* linux/arm/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h index 31868c81df..3f53e2a1fb 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h index ee37694e8f..b5601eff2a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2021 Free Software Foundation, Inc. +/* Copyright (C) 1995-2023 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 @@ -25,7 +25,7 @@ struct timex { -# ifdef __USE_TIME_BITS64 +# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32) unsigned int modes; /* mode selector */ int :32; /* pad */ long long offset; /* time offset (usec) */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h index e993021a81..11e9b3f3de 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h @@ -1,5 +1,5 @@ /* Internal definitions for stat functions. Linux/csky. - Copyright (C) 2011-2021 Free Software Foundation, Inc. + Copyright (C) 2011-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h index fd29b64b63..0c5fc2748c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for C-SKY. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 @@ -20,9 +20,9 @@ #define _LINUX_CSKY_SYSDEP_H 1 /* There is some commonality. */ -#include #include #include +#include /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ #include @@ -466,50 +466,4 @@ __local_syscall_error: \ #endif /* __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if (IS_IN (rtld) \ - || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread)))) -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(dst, src, guard) \ - grs t0, 1f; \ -1: \ - lrw guard, 1b@GOTPC; \ - addu t0, guard; \ - lrw guard, __pointer_chk_guard_local@GOT; \ - ldr.w guard, (t0, guard << 0); \ - ldw guard, (guard, 0); \ - xor dst, src, guard; -# define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard) -# define PTR_MANGLE2(dst, src, guard) \ - xor dst, src, guard -# define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard) -# else -extern uintptr_t __pointer_chk_guard_local; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(dst, src, guard) \ - grs t0, 1f; \ -1: \ - lrw guard, 1b@GOTPC; \ - addu t0, guard; \ - lrw guard, __pointer_chk_guard@GOT; \ - ldr.w guard, (t0, guard << 0); \ - ldw guard, (guard, 0); \ - xor dst, src, guard; -# define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard) -# define PTR_MANGLE2(dst, src, guard) \ - xor dst, src, guard -# define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard) -# else -extern uintptr_t __pointer_chk_guard; -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* linux/csky/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h index f07c804065..0b5f064eba 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. Linux version. - Copyright (C) 2005-2021 Free Software Foundation, Inc. + Copyright (C) 2005-2023 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 @@ -24,10 +24,3 @@ we aren't making direct use of it. So enable this across the board. */ #define NEED_DL_SYSINFO_DSO 1 - - -#ifndef __ASSEMBLER__ -/* Get version of the OS. */ -extern int _dl_discover_osversion (void) attribute_hidden; -# define HAVE_DL_DISCOVER_OSVERSION 1 -#endif diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c index 31a172dcc8..252c4f2f98 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c index 46de80b663..124384e57f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c index f0171cf1ec..ec817ca1f6 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 @@ -16,33 +16,11 @@ License along with the GNU C Library; if not, see . */ -#include #include #include #include -#include #if !XSTAT_IS_XSTAT64 -# include - -static inline bool -in_time_t_range (__time64_t t) -{ - time_t s = t; - return s == t; -} - -static inline struct timespec -valid_timespec64_to_timespec (const struct __timespec64 ts64) -{ - struct timespec ts; - - ts.tv_sec = (time_t) ts64.tv_sec; - ts.tv_nsec = ts64.tv_nsec; - - return ts; -} - int __fstatat (int fd, const char *file, struct stat *buf, int flag) { diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c index ea1d6ce14f..3509d3ca6d 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 @@ -18,7 +18,6 @@ #define __fstatat __redirect___fstatat #define fstatat __redirect_fstatat -#include #include #include #include @@ -41,6 +40,12 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t), "__blkcnt_t and __blkcnt64_t must match"); #endif +#if (__WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \ + || defined STAT_HAS_TIME32 \ + || (!defined __NR_newfstatat && !defined __NR_fstatat64) +# define FSTATAT_USE_STATX 1 + static inline int fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, int flag) @@ -54,8 +59,8 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, return r; *buf = (struct __stat64_t64) { - .st_dev = gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor), - .st_rdev = gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor), + .st_dev = __gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor), + .st_rdev = __gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor), .st_ino = tmp.stx_ino, .st_mode = tmp.stx_mode, .st_nlink = tmp.stx_nlink, @@ -74,18 +79,13 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, return r; } +#else +# define FSTATAT_USE_STATX 0 +#endif -static inline struct __timespec64 -valid_timespec_to_timespec64 (const struct timespec ts) -{ - struct __timespec64 ts64; - - ts64.tv_sec = ts.tv_sec; - ts64.tv_nsec = ts.tv_nsec; - - return ts64; -} - +/* Only statx supports 64-bit timestamps for 32-bit architectures with + __ASSUME_STATX, so there is no point in building the fallback. */ +#if !FSTATAT_USE_STATX || (FSTATAT_USE_STATX && !defined __ASSUME_STATX) static inline int fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf, int flag) @@ -146,13 +146,6 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf, return r; } - -#if (__WORDSIZE == 32 \ - && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \ - || defined STAT_HAS_TIME32 -# define FSTATAT_USE_STATX 1 -#else -# define FSTATAT_USE_STATX 0 #endif int diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/typesizes.h deleted file mode 100644 index 0dd33638f0..0000000000 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ /dev/null @@ -1,108 +0,0 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. - - 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 - . */ - -#ifndef _BITS_TYPES_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_TYPESIZES_H -#define _BITS_TYPESIZES_H 1 - -/* See for the meaning of these macros. This file exists so - that need not vary across different GNU platforms. */ -#if __TIMESIZE == 64 && __WORDSIZE == 32 -/* These are the "new" y2038 types defined for architectures added after - the 5.1 kernel. */ -# define __INO_T_TYPE __UQUAD_TYPE -# define __OFF_T_TYPE __SQUAD_TYPE -# define __RLIM_T_TYPE __UQUAD_TYPE -# define __BLKCNT_T_TYPE __SQUAD_TYPE -# define __FSBLKCNT_T_TYPE __UQUAD_TYPE -# define __FSFILCNT_T_TYPE __UQUAD_TYPE -# define __TIME_T_TYPE __SQUAD_TYPE -# define __SUSECONDS_T_TYPE __SQUAD_TYPE -#else -# define __INO_T_TYPE __ULONGWORD_TYPE -# define __OFF_T_TYPE __SLONGWORD_TYPE -# define __RLIM_T_TYPE __ULONGWORD_TYPE -# define __BLKCNT_T_TYPE __SLONGWORD_TYPE -# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -# define __TIME_T_TYPE __SLONGWORD_TYPE -# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#endif - -#define __DEV_T_TYPE __UQUAD_TYPE -#define __UID_T_TYPE __U32_TYPE -#define __GID_T_TYPE __U32_TYPE -#define __INO64_T_TYPE __UQUAD_TYPE -#define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __U32_TYPE -#define __OFF64_T_TYPE __SQUAD_TYPE -#define __PID_T_TYPE __S32_TYPE -#define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT64_T_TYPE __UQUAD_TYPE -#define __FSWORD_T_TYPE __SWORD_TYPE -#define __ID_T_TYPE __U32_TYPE -#define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS64_T_TYPE __SQUAD_TYPE -#define __DADDR_T_TYPE __S32_TYPE -#define __KEY_T_TYPE __S32_TYPE -#define __CLOCKID_T_TYPE __S32_TYPE -#define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __S32_TYPE -#define __FSID_T_TYPE struct { int __val[2]; } -#define __SSIZE_T_TYPE __SWORD_TYPE -#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE -#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE -#define __CPU_MASK_TYPE __ULONGWORD_TYPE - -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) -/* Tell the libc code that off_t and off64_t are actually the same type - for all ABI purposes, even if possibly expressed as different base types - for C type-checking purposes. */ -# define __OFF_T_MATCHES_OFF64_T 1 - -/* Same for ino_t and ino64_t. */ -# define __INO_T_MATCHES_INO64_T 1 - -/* And for __rlim_t and __rlim64_t. */ -# define __RLIM_T_MATCHES_RLIM64_T 1 - -/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ -# define __STATFS_MATCHES_STATFS64 1 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) -#else -# define __RLIM_T_MATCHES_RLIM64_T 0 - -# define __STATFS_MATCHES_STATFS64 0 - -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 -#endif - -/* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 - - -#endif /* bits/typesizes.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/sysdep.h deleted file mode 100644 index 19d5d8d1bf..0000000000 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/sysdep.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2011-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. - - 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 - . */ - -#include -#include -#include -#include - -/* Provide the common name to allow more code reuse. */ -#ifdef __NR_llseek -# define __NR__llseek __NR_llseek -#endif diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/xstatver.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/xstatver.h deleted file mode 100644 index d8fd35beb6..0000000000 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/generic/xstatver.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Versions of the 'struct stat' data structure used in compatibility xstat - functions. */ -#define _STAT_VER_KERNEL 0 -#define _STAT_VER_LINUX 0 -#define _STAT_VER _STAT_VER_KERNEL - -/* Versions of the 'xmknod' interface used in compatibility xmknod - functions. */ -#define _MKNOD_VER_LINUX 0 -#define _MKNOD_VER _MKNOD_VER_LINUX diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel-features.h index e151894dfb..e9e8dc5c6e 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2006-2021 Free Software Foundation, Inc. + Copyright (C) 2006-2023 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 @@ -30,3 +30,6 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +/* QEMU does not support set_robust_list. */ +#undef __ASSUME_SET_ROBUST_LIST diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h index 779bc85e26..c0c4ffe00d 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h @@ -1,8 +1,6 @@ /* Assembler macros for PA-RISC. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, , August 1999. - Linux/PA-RISC changes by Philipp Rumpf, , March 2000. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -55,7 +53,7 @@ #define LOAD_PIC(LREG) \ copy LREG , %r19 /* Inline assembly defines */ -#define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */ +#define TREG_ASM "%r4" /* Can't clobber r3, it holds framemarker */ #define SAVE_ASM_PIC " copy %%r19, %" TREG_ASM "\n" #define LOAD_ASM_PIC " copy %" TREG_ASM ", %%r19\n" #define CLOB_TREG TREG_ASM , @@ -136,7 +134,7 @@ /* SAVE_RP says we do */ ASM_LINE_SEP \ stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \ .cfi_offset 2, -20 ASM_LINE_SEP \ - /*FIXME: Call mcount? (carefull with stack!) */ + /*FIXME: Call mcount? (careful with stack!) */ /* Some syscall wrappers do not call other functions, and hence are classified as leaf, so add NO_CALLS for gdb */ @@ -153,7 +151,7 @@ /* SAVE_RP says we do */ ASM_LINE_SEP \ stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \ .cfi_offset 2, -20 ASM_LINE_SEP \ - /*FIXME: Call mcount? (carefull with stack!) */ + /*FIXME: Call mcount? (careful with stack!) */ #undef END #define END(name) \ @@ -472,10 +470,4 @@ L(pre_end): ASM_LINE_SEP \ #endif /* __ASSEMBLER__ */ -/* Pointer mangling is not yet supported for HPPA. */ -#define PTR_MANGLE(var) (void) (var) -#define PTR_DEMANGLE(var) (void) (var) - -#define SINGLE_THREAD_BY_GLOBAL 1 - #endif /* _LINUX_HPPA_SYSDEP_H */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h index f203d3ccd0..01db7630c4 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. i386 version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h index 8327f822b0..ed7efa3097 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. i386 version. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 @@ -17,21 +17,11 @@ License along with the GNU C Library; if not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SOCKET_SYSCALL 1 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 -# define __ASSUME_GETSOCKNAME_SYSCALL 1 -# define __ASSUME_GETPEERNAME_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_SENDMSG_SYSCALL @@ -41,6 +31,13 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL +# undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h index 8a9911b7ac..87de7d640f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, , August 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -43,13 +42,13 @@ # endif #endif -/* Since GCC 5 and above can properly spill %ebx with PIC when needed, - we can inline syscalls with 6 arguments if GCC 5 or above is used - to compile glibc. Disable GCC 5 optimization when compiling for - profiling or when -fno-omit-frame-pointer is used since asm ("ebp") - can't be used to put the 6th argument in %ebp for syscall. */ -#if !defined PROF && CAN_USE_REGISTER_ASM_EBP -# define OPTIMIZE_FOR_GCC_5 +#if !I386_USE_SYSENTER && IS_IN (libc) && !defined SHARED +/* Inside static libc, we have two versions. For compilation units + with !I386_USE_SYSENTER, the vDSO entry mechanism cannot be + used. */ +# define I386_DO_SYSCALL_STRING "__libc_do_syscall_int80" +#else +# define I386_DO_SYSCALL_STRING "__libc_do_syscall" #endif #ifdef __ASSEMBLER__ @@ -62,7 +61,7 @@ might return a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in %eax is a real error number. Linus said he will make sure the no syscall - returns a value in -1 .. -4095 as a valid result so we can savely + returns a value in -1 .. -4095 as a valid result so we can safely test with -4095. */ /* We don't want the label for the error handle to be global when we define @@ -239,36 +238,6 @@ extern int __syscall_error (int) attribute_hidden __attribute__ ((__regparm__ (1))); -#ifndef OPTIMIZE_FOR_GCC_5 -/* We need some help from the assembler to generate optimal code. We - define some macros here which later will be used. */ -asm (".L__X'%ebx = 1\n\t" - ".L__X'%ecx = 2\n\t" - ".L__X'%edx = 2\n\t" - ".L__X'%eax = 3\n\t" - ".L__X'%esi = 3\n\t" - ".L__X'%edi = 3\n\t" - ".L__X'%ebp = 3\n\t" - ".L__X'%esp = 3\n\t" - ".macro bpushl name reg\n\t" - ".if 1 - \\name\n\t" - ".if 2 - \\name\n\t" - "error\n\t" - ".else\n\t" - "xchgl \\reg, %ebx\n\t" - ".endif\n\t" - ".endif\n\t" - ".endm\n\t" - ".macro bpopl name reg\n\t" - ".if 1 - \\name\n\t" - ".if 2 - \\name\n\t" - "error\n\t" - ".else\n\t" - "xchgl \\reg, %ebx\n\t" - ".endif\n\t" - ".endif\n\t" - ".endm\n\t"); - /* Six-argument syscalls use an out-of-line helper, because an inline asm using all registers apart from %esp cannot work reliably and the assembler does not support describing an asm that saves and @@ -279,7 +248,6 @@ struct libc_do_syscall_args { int ebx, edi, ebp; }; -#endif # define VDSO_NAME "LINUX_2.6" # define VDSO_HASH 61765110 @@ -332,14 +300,8 @@ struct libc_do_syscall_args /* Each object using 6-argument inline syscalls must include a definition of __libc_do_syscall. */ -#ifdef OPTIMIZE_FOR_GCC_5 -# define INTERNAL_SYSCALL_MAIN_6(name, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, 6, args) -# define INTERNAL_SYSCALL_MAIN_NCS_6(name, args...) \ - INTERNAL_SYSCALL_MAIN_NCS(name, 6, args) -#else /* GCC 5 */ -# define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3, \ - arg4, arg5, arg6) \ +#define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3, \ + arg4, arg5, arg6) \ struct libc_do_syscall_args _xv = \ { \ (int) (arg1), \ @@ -348,12 +310,12 @@ struct libc_do_syscall_args }; \ asm volatile ( \ "movl %1, %%eax\n\t" \ - "call __libc_do_syscall" \ + "call " I386_DO_SYSCALL_STRING \ : "=a" (resultvar) \ : "i" (__NR_##name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \ : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS_6(name, arg1, arg2, arg3, \ - arg4, arg5, arg6) \ +#define INTERNAL_SYSCALL_MAIN_NCS_6(name, arg1, arg2, arg3, \ + arg4, arg5, arg6) \ struct libc_do_syscall_args _xv = \ { \ (int) (arg1), \ @@ -362,11 +324,10 @@ struct libc_do_syscall_args }; \ asm volatile ( \ "movl %1, %%eax\n\t" \ - "call __libc_do_syscall" \ + "call " I386_DO_SYSCALL_STRING \ : "=a" (resultvar) \ : "a" (name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \ : "memory", "cc") -#endif /* GCC 5 */ #define INTERNAL_SYSCALL(name, nr, args...) \ ({ \ @@ -380,193 +341,72 @@ struct libc_do_syscall_args (int) resultvar; }) #if I386_USE_SYSENTER -# ifdef OPTIMIZE_FOR_GCC_5 -# ifdef PIC -# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ +# ifdef PIC +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *%%gs:%P2" \ : "=a" (resultvar) \ : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \ ASMARGS_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *%%gs:%P2" \ : "=a" (resultvar) \ : "a" (name), "i" (offsetof (tcbhead_t, sysinfo)) \ ASMARGS_##nr(args) : "memory", "cc") -# else -# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ +# else /* I386_USE_SYSENTER && !PIC */ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *_dl_sysinfo" \ : "=a" (resultvar) \ : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *_dl_sysinfo" \ : "=a" (resultvar) \ : "a" (name) ASMARGS_##nr(args) : "memory", "cc") -# endif -# else /* GCC 5 */ -# ifdef PIC -# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ - EXTRAVAR_##nr \ - asm volatile ( \ - LOADARGS_##nr \ - "movl %1, %%eax\n\t" \ - "call *%%gs:%P2\n\t" \ - RESTOREARGS_##nr \ - : "=a" (resultvar) \ - : "i" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \ - ASMFMT_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ - EXTRAVAR_##nr \ - asm volatile ( \ - LOADARGS_##nr \ - "call *%%gs:%P2\n\t" \ - RESTOREARGS_##nr \ - : "=a" (resultvar) \ - : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \ - ASMFMT_##nr(args) : "memory", "cc") -# else -# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ - EXTRAVAR_##nr \ - asm volatile ( \ - LOADARGS_##nr \ - "movl %1, %%eax\n\t" \ - "call *_dl_sysinfo\n\t" \ - RESTOREARGS_##nr \ - : "=a" (resultvar) \ - : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ - EXTRAVAR_##nr \ - asm volatile ( \ - LOADARGS_##nr \ - "call *_dl_sysinfo\n\t" \ - RESTOREARGS_##nr \ - : "=a" (resultvar) \ - : "0" (name) ASMFMT_##nr(args) : "memory", "cc") -# endif -# endif /* GCC 5 */ -#else -# ifdef OPTIMIZE_FOR_GCC_5 -# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ +# endif /* I386_USE_SYSENTER && !PIC */ +#else /* !I386_USE_SYSENTER */ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "int $0x80" \ : "=a" (resultvar) \ : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "int $0x80" \ : "=a" (resultvar) \ : "a" (name) ASMARGS_##nr(args) : "memory", "cc") -# else /* GCC 5 */ -# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ - EXTRAVAR_##nr \ - asm volatile ( \ - LOADARGS_##nr \ - "movl %1, %%eax\n\t" \ - "int $0x80\n\t" \ - RESTOREARGS_##nr \ - : "=a" (resultvar) \ - : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ - EXTRAVAR_##nr \ - asm volatile ( \ - LOADARGS_##nr \ - "int $0x80\n\t" \ - RESTOREARGS_##nr \ - : "=a" (resultvar) \ - : "0" (name) ASMFMT_##nr(args) : "memory", "cc") -# endif /* GCC 5 */ -#endif +#endif /* !I386_USE_SYSENTER */ -#define LOADARGS_0 -#ifdef __PIC__ -# if I386_USE_SYSENTER && defined PIC -# define LOADARGS_1 \ - "bpushl .L__X'%k3, %k3\n\t" -# define LOADARGS_5 \ - "movl %%ebx, %4\n\t" \ - "movl %3, %%ebx\n\t" -# else -# define LOADARGS_1 \ - "bpushl .L__X'%k2, %k2\n\t" -# define LOADARGS_5 \ - "movl %%ebx, %3\n\t" \ - "movl %2, %%ebx\n\t" -# endif -# define LOADARGS_2 LOADARGS_1 -# define LOADARGS_3 \ - "xchgl %%ebx, %%edi\n\t" -# define LOADARGS_4 LOADARGS_3 -#else -# define LOADARGS_1 -# define LOADARGS_2 -# define LOADARGS_3 -# define LOADARGS_4 -# define LOADARGS_5 -#endif - -#define RESTOREARGS_0 -#ifdef __PIC__ -# if I386_USE_SYSENTER && defined PIC -# define RESTOREARGS_1 \ - "bpopl .L__X'%k3, %k3\n\t" -# define RESTOREARGS_5 \ - "movl %4, %%ebx" -# else -# define RESTOREARGS_1 \ - "bpopl .L__X'%k2, %k2\n\t" -# define RESTOREARGS_5 \ - "movl %3, %%ebx" -# endif -# define RESTOREARGS_2 RESTOREARGS_1 -# define RESTOREARGS_3 \ - "xchgl %%edi, %%ebx\n\t" -# define RESTOREARGS_4 RESTOREARGS_3 -#else -# define RESTOREARGS_1 -# define RESTOREARGS_2 -# define RESTOREARGS_3 -# define RESTOREARGS_4 -# define RESTOREARGS_5 -#endif - -#ifdef OPTIMIZE_FOR_GCC_5 -# define LOADREGS_0() -# define ASMARGS_0() -# define LOADREGS_1(arg1) \ +#define LOADREGS_0() +#define ASMARGS_0() +#define LOADREGS_1(arg1) \ LOADREGS_0 () -# define ASMARGS_1(arg1) \ +#define ASMARGS_1(arg1) \ ASMARGS_0 (), "b" ((unsigned int) (arg1)) -# define LOADREGS_2(arg1, arg2) \ +#define LOADREGS_2(arg1, arg2) \ LOADREGS_1 (arg1) -# define ASMARGS_2(arg1, arg2) \ +#define ASMARGS_2(arg1, arg2) \ ASMARGS_1 (arg1), "c" ((unsigned int) (arg2)) -# define LOADREGS_3(arg1, arg2, arg3) \ +#define LOADREGS_3(arg1, arg2, arg3) \ LOADREGS_2 (arg1, arg2) -# define ASMARGS_3(arg1, arg2, arg3) \ +#define ASMARGS_3(arg1, arg2, arg3) \ ASMARGS_2 (arg1, arg2), "d" ((unsigned int) (arg3)) -# define LOADREGS_4(arg1, arg2, arg3, arg4) \ +#define LOADREGS_4(arg1, arg2, arg3, arg4) \ LOADREGS_3 (arg1, arg2, arg3) -# define ASMARGS_4(arg1, arg2, arg3, arg4) \ +#define ASMARGS_4(arg1, arg2, arg3, arg4) \ ASMARGS_3 (arg1, arg2, arg3), "S" ((unsigned int) (arg4)) -# define LOADREGS_5(arg1, arg2, arg3, arg4, arg5) \ +#define LOADREGS_5(arg1, arg2, arg3, arg4, arg5) \ LOADREGS_4 (arg1, arg2, arg3, arg4) -# define ASMARGS_5(arg1, arg2, arg3, arg4, arg5) \ +#define ASMARGS_5(arg1, arg2, arg3, arg4, arg5) \ ASMARGS_4 (arg1, arg2, arg3, arg4), "D" ((unsigned int) (arg5)) -# define LOADREGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ - register unsigned int _a6 asm ("ebp") = (unsigned int) (arg6); \ - LOADREGS_5 (arg1, arg2, arg3, arg4, arg5) -# define ASMARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ - ASMARGS_5 (arg1, arg2, arg3, arg4, arg5), "r" (_a6) -#endif /* GCC 5 */ #define ASMFMT_0() #ifdef __PIC__ @@ -606,34 +446,6 @@ struct libc_do_syscall_args #endif /* __ASSEMBLER__ */ - -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. Using a global variable - is too complicated here since we have no PC-relative addressing mode. */ -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg) xorl %gs:POINTER_GUARD, reg; \ - roll $9, reg -# define PTR_DEMANGLE(reg) rorl $9, reg; \ - xorl %gs:POINTER_GUARD, reg -# else -# define PTR_MANGLE(var) asm ("xorl %%gs:%c2, %0\n" \ - "roll $9, %0" \ - : "=r" (var) \ - : "0" (var), \ - "i" (offsetof (tcbhead_t, \ - pointer_guard))) -# define PTR_DEMANGLE(var) asm ("rorl $9, %0\n" \ - "xorl %%gs:%c2, %0" \ - : "=r" (var) \ - : "0" (var), \ - "i" (offsetof (tcbhead_t, \ - pointer_guard))) -# endif -#endif - /* Each shadow stack slot takes 4 bytes. Assuming that each stack frame takes 128 bytes, this is used to compute shadow stack size from stack size. */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h index 24650ce31f..3e4d5da820 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. IA-64 version. - Copyright (C) 2003-2021 Free Software Foundation, Inc. + Copyright (C) 2003-2023 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 @@ -48,8 +48,4 @@ extern int _dl_sysinfo_break attribute_hidden; ".previous"); #endif -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - #endif /* dl-sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h index 6661197573..98ebfb74bf 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2010-2021 Free Software Foundation, Inc. + Copyright (C) 2010-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/sysdep.h index 7198c192a0..1d556945c1 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -1,7 +1,5 @@ -/* Copyright (C) 1999-2021 Free Software Foundation, Inc. +/* Copyright (C) 1999-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Written by Jes Sorensen, , April 1999. - Based on code originally written by David Mosberger-Tang The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -46,12 +44,15 @@ #undef SYS_ify #define SYS_ify(syscall_name) __NR_##syscall_name -#if defined USE_DL_SYSINFO \ - && (IS_IN (libc) \ - || IS_IN (libpthread) || IS_IN (librt)) -# define IA64_USE_NEW_STUB -#else -# undef IA64_USE_NEW_STUB +#ifndef IA64_USE_NEW_STUB +# if defined USE_DL_SYSINFO && IS_IN (libc) +# define IA64_USE_NEW_STUB 1 +# else +# define IA64_USE_NEW_STUB 0 +# endif +#endif +#if IA64_USE_NEW_STUB && !USE_DL_SYSINFO +# error IA64_USE_NEW_STUB needs USE_DL_SYSINFO #endif #ifdef __ASSEMBLER__ @@ -85,7 +86,7 @@ a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in %d0 is a real error number. Linus said he will make sure the no syscall returns a value - in -1 .. -4095 as a valid result so we can savely test with -4095. */ + in -1 .. -4095 as a valid result so we can safely test with -4095. */ /* We don't want the label for the error handler to be visible in the symbol table when we define it here. */ @@ -103,7 +104,7 @@ mov r15=num; \ break __IA64_BREAK_SYSCALL -#ifdef IA64_USE_NEW_STUB +#if IA64_USE_NEW_STUB # ifdef SHARED # define DO_CALL(num) \ .prologue; \ @@ -187,7 +188,7 @@ (non-negative) errno on error or the return value on success. */ -#ifdef IA64_USE_NEW_STUB +#if IA64_USE_NEW_STUB # define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ @@ -279,7 +280,7 @@ #define ASM_OUTARGS_5 ASM_OUTARGS_4, "=r" (_out4) #define ASM_OUTARGS_6 ASM_OUTARGS_5, "=r" (_out5) -#ifdef IA64_USE_NEW_STUB +#if IA64_USE_NEW_STUB #define ASM_ARGS_0 #define ASM_ARGS_1 ASM_ARGS_0, "4" (_out0) #define ASM_ARGS_2 ASM_ARGS_1, "5" (_out1) @@ -315,7 +316,7 @@ /* Branch registers. */ \ "b6" -#ifdef IA64_USE_NEW_STUB +#if IA64_USE_NEW_STUB # define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON #else # define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7" @@ -323,24 +324,4 @@ #endif /* not __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg, tmpreg) \ - add tmpreg=-16,r13 \ - ;; \ - ld8 tmpreg=[tmpreg] \ - ;; \ - xor reg=reg, tmpreg -# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) -# else -# define PTR_MANGLE(var) \ - (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* linux/ia64/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h index ec03813795..15b856560a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -1,5 +1,5 @@ /* Internal declarations for sys/timex.h. - Copyright (C) 2014-2021 Free Software Foundation, Inc. + Copyright (C) 2014-2023 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 @@ -23,7 +23,7 @@ # ifndef _ISOMAC -extern int __adjtimex (struct timex *__ntx); +extern int __adjtimex (struct timex *__ntx) __nonnull ((1)); libc_hidden_proto (__adjtimex) # include @@ -77,9 +77,9 @@ struct __timex64 int :32; int :32; }; -extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64); +extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64) __nonnull((2)); libc_hidden_proto (__clock_adjtime64); -extern int ___adjtimex64 (struct __timex64 *tx64); +extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1)); libc_hidden_proto (___adjtimex64) struct __ntptimeval64 @@ -94,9 +94,9 @@ struct __ntptimeval64 long int __glibc_reserved3; long int __glibc_reserved4; }; -extern int __ntp_gettime64 (struct __ntptimeval64 *ntv); +extern int __ntp_gettime64 (struct __ntptimeval64 *ntv) __nonnull ((1)); libc_hidden_proto (__ntp_gettime64) -extern int __ntp_gettimex64 (struct __ntptimeval64 *ntv); +extern int __ntp_gettimex64 (struct __ntptimeval64 *ntv) __nonnull ((1)); libc_hidden_proto (__ntp_gettimex64) # endif diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h index 3930e14322..07b440f4ee 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 @@ -79,6 +79,13 @@ #define __ASSUME_SENDMMSG_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 +#define __ASSUME_BIND_SYSCALL 1 +#define __ASSUME_SOCKET_SYSCALL 1 +#define __ASSUME_SOCKETPAIR_SYSCALL 1 +#define __ASSUME_LISTEN_SYSCALL 1 +#define __ASSUME_SHUTDOWN_SYSCALL 1 +#define __ASSUME_GETSOCKNAME_SYSCALL 1 +#define __ASSUME_GETPEERNAME_SYSCALL 1 /* Support for SysV IPC through wired syscalls. All supported architectures either support ipc syscall and/or all the ipc correspondent syscalls. */ @@ -220,4 +227,29 @@ # define __ASSUME_FACCESSAT2 0 #endif +/* The close_range system call was introduced across all architectures + in Linux 5.9. */ +#if __LINUX_KERNEL_VERSION >= 0x050900 +# define __ASSUME_CLOSE_RANGE 1 +#else +# define __ASSUME_CLOSE_RANGE 0 +#endif + +/* The FUTEX_LOCK_PI2 operation was introduced across all architectures in Linux + 5.14. */ +#if __LINUX_KERNEL_VERSION >= 0x050e00 +# define __ASSUME_FUTEX_LOCK_PI2 1 +#else +# define __ASSUME_FUTEX_LOCK_PI2 0 +#endif + +/* The clone3 system call was introduced across on most architectures in + Linux 5.3. Not all ports implements it, so it should be used along + HAVE_CLONE3_WRAPPER define. */ +#if __LINUX_KERNEL_VERSION >= 0x050300 +# define __ASSUME_CLONE3 1 +#else +# define __ASSUME_CLONE3 0 +#endif + #endif /* kernel-features.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h index 6c1b175cb4..c182400b6e 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h @@ -1,5 +1,5 @@ /* Internal definitions for stat functions. - Copyright (C) 2021 Free Software Foundation, Inc. + Copyright (C) 2021-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c index b79b4cb9f4..535bf7807a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c index 3b45187f61..debc1699e7 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c @@ -1,5 +1,5 @@ /* Get file status. - Copyright (C) 1996-2021 Free Software Foundation, Inc. + Copyright (C) 1996-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h index a65dfce95a..1441440dcd 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2021 Free Software Foundation, Inc. +/* Copyright (C) 2010-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 70f1154559..d0155783b7 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2008-2021 Free Software Foundation, Inc. + Copyright (C) 2008-2023 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 @@ -17,21 +17,11 @@ License along with the GNU C Library. If not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SOCKET_SYSCALL 1 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 -# define __ASSUME_GETSOCKNAME_SYSCALL 1 -# define __ASSUME_GETPEERNAME_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_RECVMMSG_SYSCALL @@ -43,6 +33,13 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL +# undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_SYSCALL #endif /* No support for PI futexes or robust mutexes before 3.10 for m68k. */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h index 8d344f2324..d6d2c33fa1 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2021 Free Software Foundation, Inc. +/* Copyright (C) 2010-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h index b29986339a..037b049958 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -1,7 +1,5 @@ -/* Copyright (C) 1996-2021 Free Software Foundation, Inc. +/* Copyright (C) 1996-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Written by Andreas Schwab, , - December 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -40,7 +38,7 @@ a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in %d0 is a real error number. Linus said he will make sure the no syscall returns a value - in -1 .. -4095 as a valid result so we can savely test with -4095. */ + in -1 .. -4095 as a valid result so we can safely test with -4095. */ /* We don't want the label for the error handler to be visible in the symbol table when we define it here. */ @@ -297,12 +295,6 @@ SYSCALL_ERROR_LABEL: \ #endif /* not __ASSEMBLER__ */ -/* Pointer mangling is not yet supported for M68K. */ -#define PTR_MANGLE(var) (void) (var) -#define PTR_DEMANGLE(var) (void) (var) - -#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO /* M68K needs system-supplied DSO to access TLS helpers even when statically linked. */ -# define NEED_STATIC_SYSINFO_DSO 1 -#endif +#define NEED_STATIC_SYSINFO_DSO 1 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index a8fbc67384..3d6270b633 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2021 Free Software Foundation, Inc. +/* Copyright (C) 2011-2023 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 @@ -18,16 +18,9 @@ #include /* All supported kernel versions for MicroBlaze have these syscalls. */ -#define __ASSUME_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 -#define __ASSUME_LISTEN_SYSCALL 1 -#define __ASSUME_GETSOCKNAME_SYSCALL 1 -#define __ASSUME_GETPEERNAME_SYSCALL 1 -#define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 #include_next diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h index af12ac60c3..31c1b25a05 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h @@ -1,5 +1,5 @@ /* Definition of `struct stat' used in the kernel - Copyright (C) 2013-2021 Free Software Foundation, Inc. + Copyright (C) 2013-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/sysdep.h index 52c1e3d8d0..afc77b0063 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. +/* Copyright (C) 2000-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -43,7 +43,7 @@ #ifdef __ASSEMBLER__ /* In microblaze ABI function call arguments are passed in registers - r5...r10. The return value is stored in r3 (or r3:r4 regiters pair). + r5...r10. The return value is stored in r3 (or r3:r4 register pair). Linux syscall uses the same convention with the addition that the syscall number is passed in r12. To enter the kernel "brki r14,8" instruction is used. @@ -58,7 +58,7 @@ a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in %d0 is a real error number. Linus said he will make sure the no syscall returns a value - in -1 .. -4095 as a valid result so we can savely test with -4095. */ + in -1 .. -4095 as a valid result so we can safely test with -4095. */ /* We don't want the label for the error handler to be visible in the symbol table when we define it here. */ @@ -304,12 +304,6 @@ SYSCALL_ERROR_LABEL_DCL: \ }) -/* Pointer mangling is not yet supported for Microblaze. */ -# define PTR_MANGLE(var) (void) (var) -# define PTR_DEMANGLE(var) (void) (var) - -# define SINGLE_THREAD_BY_GLOBAL 1 - #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h index 7a7c5a0f2d..d0d1c9c52f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h index b336a16de8..1318083195 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. +/* Copyright (C) 2000-2023 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 @@ -337,8 +337,4 @@ libc_hidden_proto (__mips_syscall7, nomips16) #endif /* __ASSEMBLER__ */ -/* Pointer mangling is not yet supported for MIPS. */ -#define PTR_MANGLE(var) (void) (var) -#define PTR_DEMANGLE(var) (void) (var) - #endif /* linux/mips/mips32/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h index ee853483cc..dbadfd3379 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h @@ -1,5 +1,5 @@ /* Struct stat/stat64 to stat/stat64 conversion for Linux. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h index 405832d7c3..d7ae60f596 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. +/* Copyright (C) 2000-2023 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 @@ -300,8 +300,4 @@ typedef long int __syscall_arg_t; #endif /* __ASSEMBLER__ */ -/* Pointer mangling is not yet supported for MIPS. */ -#define PTR_MANGLE(var) (void) (var) -#define PTR_DEMANGLE(var) (void) (var) - #endif /* linux/mips/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h index 4a400a7fe3..ff84a91b31 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h @@ -1,5 +1,5 @@ /* Syscall definitions, Linux MIPS generic version. - Copyright (C) 2019-2021 Free Software Foundation, Inc. + Copyright (C) 2019-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c index 55df90a589..cb0584e003 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c @@ -1,5 +1,5 @@ /* Create a special or ordinary file. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#include #include #include #include diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/kernel_stat.h index 1af30dab6f..77f01e891d 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/kernel_stat.h @@ -1,7 +1,6 @@ /* Internal definitions for stat functions. Linux/nios2. - Copyright (C) 2021 Free Software Foundation, Inc. + Copyright (C) 2021-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/sysdep.h index bd802c40ff..582e76b17f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for Nios II. - Copyright (C) 2000-2021 Free Software Foundation, Inc. + Copyright (C) 2000-2023 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 @@ -19,9 +19,9 @@ #ifndef _LINUX_NIOS2_SYSDEP_H #define _LINUX_NIOS2_SYSDEP_H 1 +#include #include #include -#include /* For RTLD_PRIVATE_ERRNO. */ #include @@ -220,21 +220,4 @@ #endif /* __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE_GUARD(guard) ldw guard, POINTER_GUARD(r23) -# define PTR_MANGLE(dst, src, guard) xor dst, src, guard -# define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard) -# else -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - - #endif /* linux/nios2/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 6c04e187ce..e092d3bd24 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. PowerPC version. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 @@ -18,16 +18,9 @@ . */ /* New syscalls added for PowerPC in 2.6.37. */ -#define __ASSUME_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 -#define __ASSUME_LISTEN_SYSCALL 1 -#define __ASSUME_GETSOCKNAME_SYSCALL 1 -#define __ASSUME_GETPEERNAME_SYSCALL 1 -#define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h index e89ee5fdc8..72b452bed0 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h @@ -1,5 +1,5 @@ /* Definition of `struct stat' used in the kernel. - Copyright (C) 1997-2021 Free Software Foundation, Inc. + Copyright (C) 1997-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index e8785aa8ea..f22dec2926 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h index 4b9d43c636..96a0edc38f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h @@ -1,5 +1,5 @@ /* Syscall definitions, Linux PowerPC generic version. - Copyright (C) 2019-2021 Free Software Foundation, Inc. + Copyright (C) 2019-2023 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 @@ -207,38 +207,6 @@ #define ASM_INPUT_5 ASM_INPUT_4, "5" (r7) #define ASM_INPUT_6 ASM_INPUT_5, "6" (r8) - -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -# ifdef __ASSEMBLER__ -# if defined(__PPC64__) || defined(__powerpc64__) -# define LOAD ld -# define TPREG r13 -# else -# define LOAD lwz -# define TPREG r2 -# endif -# define PTR_MANGLE(reg, tmpreg) \ - LOAD tmpreg,POINTER_GUARD(TPREG); \ - xor reg,tmpreg,reg -# define PTR_MANGLE2(reg, tmpreg) \ - xor reg,tmpreg,reg -# define PTR_MANGLE3(destreg, reg, tmpreg) \ - LOAD tmpreg,POINTER_GUARD(TPREG); \ - xor destreg,tmpreg,reg -# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) -# define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg) -# define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg) -# else -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - /* List of system calls which are supported as vsyscalls. */ #define VDSO_NAME "LINUX_2.6.15" #define VDSO_HASH 123718565 @@ -246,6 +214,7 @@ #if defined(__PPC64__) || defined(__powerpc64__) #define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres" #define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime" +#define HAVE_CLONE3_WRAPPER 1 #else #define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres" #define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime" @@ -255,11 +224,4 @@ #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" #define HAVE_GET_TBFREQ "__kernel_get_tbfreq" -#if defined(__PPC64__) || defined(__powerpc64__) -# define HAVE_SIGTRAMP_RT64 "__kernel_sigtramp_rt64" -#else -# define HAVE_SIGTRAMP_32 "__kernel_sigtramp32" -# define HAVE_SIGTRAMP_RT32 "__kernel_sigtramp_rt32" -#endif - #endif /* _LINUX_POWERPC_SYSDEP_H */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h index 74c4c27ca1..2ce110528b 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. RISC-V version. - Copyright (C) 2018-2021 Free Software Foundation, Inc. + Copyright (C) 2018-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h index 37ff07a0d7..5583b96d23 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -19,7 +19,8 @@ #ifndef _LINUX_RISCV_SYSDEP_H #define _LINUX_RISCV_SYSDEP_H 1 -#include +#include +#include #include #undef SYS_ify @@ -102,7 +103,7 @@ # else # define SYSCALL_ERROR_HANDLER(name) \ .Lsyscall_error ## name: \ - j __syscall_error; + tail __syscall_error; # endif /* Performs a system call, not setting errno. */ @@ -120,7 +121,7 @@ # undef ret_NOERRNO # define ret_NOERRNO ret -/* Perfroms a system call, returning the error code. */ +/* Performs a system call, returning the error code. */ # undef PSEUDO_ERRVAL # define PSEUDO_ERRVAL(name, syscall_name, args) \ PSEUDO_NOERRNO (name, syscall_name, args) \ @@ -150,6 +151,7 @@ /* RV32 does not support the gettime VDSO syscalls. */ # endif +# define HAVE_CLONE3_WRAPPER 1 /* List of system calls which are supported as vsyscalls (for RV32 and RV64). */ @@ -357,8 +359,4 @@ extern long int __syscall_error (long int neg_errno); #endif /* ! __ASSEMBLER__ */ -/* Pointer mangling is not supported. */ -#define PTR_MANGLE(var) (void) (var) -#define PTR_DEMANGLE(var) (void) (var) - #endif /* linux/riscv/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index 82e77e1e03..dc5c116d25 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/s390 version. - Copyright (C) 2003-2021 Free Software Foundation, Inc. + Copyright (C) 2003-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h index 4757e9eb02..fb87a57a15 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. S/390 version. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 @@ -17,21 +17,11 @@ License along with the GNU C Library; if not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SOCKET_SYSCALL 1 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 -# define __ASSUME_GETSOCKNAME_SYSCALL 1 -# define __ASSUME_GETPEERNAME_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_RECVMMSG_SYSCALL @@ -43,6 +33,13 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL +# undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_SYSCALL #endif /* s390 only supports ipc syscall before 5.1. */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 34fb5dbf5e..26d1a7c6d8 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -1,5 +1,4 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). +/* Copyright (C) 2000-2023 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 @@ -43,7 +42,7 @@ a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in gpr2 is a real error number. Linus said he will make sure that no syscall returns a value - in -1 .. -4095 as a valid result so we can savely test with -4095. */ + in -1 .. -4095 as a valid result so we can safely test with -4095. */ #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ @@ -156,12 +155,8 @@ lr %r0,%r7; \ l %r7,96(%r15); \ .endif; \ - .if SYS_ify (syscall) < 256; \ - svc SYS_ify (syscall); \ - .else; \ lhi %r1,SYS_ify (syscall); \ svc 0; \ - .endif; \ .if args > 5; \ lr %r7,%r0; \ .endif @@ -182,25 +177,4 @@ #endif /* __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -/* For the time being just use stack_guard rather than a separate - pointer_guard. */ -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg, tmpreg) \ - ear tmpreg,%a0; \ - x reg,STACK_GUARD(tmpreg) -# define PTR_MANGLE2(reg, tmpreg) \ - x reg,STACK_GUARD(tmpreg) -# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) -# else -# define PTR_MANGLE(var) \ - (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* _LINUX_S390_SYSDEP_H */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index cbf2553cd8..7230e97448 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -1,6 +1,5 @@ /* Assembler macros for 64 bit S/390. - Copyright (C) 2001-2021 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + Copyright (C) 2001-2023 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 @@ -47,7 +46,7 @@ a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in gpr2 is a real error number. Linus said he will make sure that no syscall returns a value - in -1 .. -4095 as a valid result so we can savely test with -4095. */ + in -1 .. -4095 as a valid result so we can safely test with -4095. */ #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ @@ -154,12 +153,8 @@ lgr %r0,%r7; \ lg %r7,160(%r15); \ .endif; \ - .if SYS_ify (syscall) < 256; \ - svc SYS_ify (syscall); \ - .else; \ lghi %r1,SYS_ify (syscall); \ svc 0; \ - .endif; \ .if args > 5; \ lgr %r7,%r0; \ .endif @@ -180,27 +175,4 @@ #endif /* __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -/* For the time being just use stack_guard rather than a separate - pointer_guard. */ -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg, tmpreg) \ - ear tmpreg,%a0; \ - sllg tmpreg,tmpreg,32; \ - ear tmpreg,%a1; \ - xg reg,STACK_GUARD(tmpreg) -# define PTR_MANGLE2(reg, tmpreg) \ - xg reg,STACK_GUARD(tmpreg) -# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) -# else -# define PTR_MANGLE(var) \ - (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* _LINUX_S390_SYSDEP_H */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h index 565277a1ea..33f183a9a7 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. +/* Copyright (C) 2000-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h index 683d1349c4..b2621630f0 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h @@ -1,5 +1,5 @@ /* Syscall definitions, Linux s390 version. - Copyright (C) 2019-2021 Free Software Foundation, Inc. + Copyright (C) 2019-2023 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 @@ -21,32 +21,6 @@ #undef SYS_ify #define SYS_ify(syscall_name) __NR_##syscall_name -#undef INTERNAL_SYSCALL_DIRECT -#define INTERNAL_SYSCALL_DIRECT(name, nr, args...) \ - ({ \ - DECLARGS_##nr(args) \ - register long int _ret __asm__("2"); \ - __asm__ __volatile__ ( \ - "svc %b1\n\t" \ - : "=d" (_ret) \ - : "i" (__NR_##name) ASMFMT_##nr \ - : "memory" ); \ - _ret; }) - -#undef INTERNAL_SYSCALL_SVC0 -#define INTERNAL_SYSCALL_SVC0(name, nr, args...) \ - ({ \ - DECLARGS_##nr(args) \ - register unsigned long int _nr __asm__("1") = \ - (unsigned long int)(__NR_##name); \ - register long int _ret __asm__("2"); \ - __asm__ __volatile__ ( \ - "svc 0\n\t" \ - : "=d" (_ret) \ - : "d" (_nr) ASMFMT_##nr \ - : "memory" ); \ - _ret; }) - #undef INTERNAL_SYSCALL_NCS #define INTERNAL_SYSCALL_NCS(no, nr, args...) \ ({ \ @@ -61,10 +35,8 @@ _ret; }) #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, nr, args...) \ - (((__NR_##name) < 256) \ - ? INTERNAL_SYSCALL_DIRECT(name, nr, args) \ - : INTERNAL_SYSCALL_SVC0(name, nr, args)) +#define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_NCS(__NR_##name, nr, args) #define DECLARGS_0() #define DECLARGS_1(arg1) \ @@ -93,9 +65,6 @@ #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6) #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7) -#define SINGLE_THREAD_BY_GLOBAL 1 - - #define VDSO_NAME "LINUX_2.6.29" #define VDSO_HASH 123718585 @@ -110,4 +79,5 @@ #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" #define HAVE_GETCPU_VSYSCALL "__kernel_getcpu" +#define HAVE_CLONE3_WRAPPER 1 #endif diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h index 15f5cc2c85..953fa8dff0 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. SH version. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 @@ -23,16 +23,9 @@ #include /* These syscalls were added for SH in 2.6.37. */ -#define __ASSUME_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 -#define __ASSUME_LISTEN_SYSCALL 1 -#define __ASSUME_GETSOCKNAME_SYSCALL 1 -#define __ASSUME_GETPEERNAME_SYSCALL 1 -#define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 #include_next diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/sysdep.h index 97aa92dfa2..73df0a52ea 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -1,7 +1,5 @@ -/* Copyright (C) 1992-2021 Free Software Foundation, Inc. +/* Copyright (C) 1992-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, , August 1995. - Changed by Kaz Kojima, . The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -43,7 +41,7 @@ might return a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in R0 is a real error number. Linus said he will make sure the no syscall - returns a value in -1 .. -4095 as a valid result so we can savely + returns a value in -1 .. -4095 as a valid result so we can safely test with -4095. */ #define _IMM1 #-1 @@ -317,23 +315,4 @@ #endif /* __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. Using a global variable - is too complicated here since we have no PC-relative addressing mode. */ -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg, tmp) \ - stc gbr,tmp; mov.l @(POINTER_GUARD,tmp),tmp; xor tmp,reg -# define PTR_MANGLE2(reg, tmp) xor tmp,reg -# define PTR_DEMANGLE(reg, tmp) PTR_MANGLE (reg, tmp) -# define PTR_DEMANGLE2(reg, tmp) PTR_MANGLE2 (reg, tmp) -# else -# define PTR_MANGLE(var) \ - (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* linux/sh/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h index 2fac8dcc11..9bbd988938 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h @@ -1,5 +1,5 @@ /* Single thread optimization, Linux version. - Copyright (C) 2019-2021 Free Software Foundation, Inc. + Copyright (C) 2019-2023 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 @@ -19,6 +19,10 @@ #ifndef _SINGLE_THREAD_H #define _SINGLE_THREAD_H +#ifndef __ASSEMBLER__ +# include +#endif + /* The default way to check if the process is single thread is by using the pthread_t 'multiple_threads' field. However, for some architectures it is faster to either use an extra field on TCB or global variables (the TCB @@ -27,16 +31,11 @@ The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single thread check to use global variables instead of the pthread_t field. */ -#ifndef __ASSEMBLER__ -extern int __libc_multiple_threads; -libc_hidden_proto (__libc_multiple_threads) -#endif - #if !defined SINGLE_THREAD_BY_GLOBAL || IS_IN (rtld) # define SINGLE_THREAD_P \ (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0) #else -# define SINGLE_THREAD_P (__libc_multiple_threads == 0) +# define SINGLE_THREAD_P (__libc_single_threaded_internal != 0) #endif #define RTLD_SINGLE_THREAD_P SINGLE_THREAD_P diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h index 7aaca9757d..051318e35c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version. - Copyright (C) 2002-2021 Free Software Foundation, Inc. + Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 2c28393647..98c938c16d 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. SPARC version. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 @@ -40,16 +40,19 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL -#else -# define __ASSUME_SOCKET_SYSCALL 1 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 +#endif + +/* There syscalls were added for 32-bit in compat syscall table only + in 4.20 (but present for 64-bit in all supported kernel versions). */ +#if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400 +# undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_SYSCALL #endif /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ -#if __LINUX_KERNEL_VERSION >= 0x040400 -# define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 +#if __LINUX_KERNEL_VERSION < 0x040400 +# undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL #endif #ifdef __arch64__ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h index 7cbfdada63..99a4941abf 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Miguel de Icaza , January 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -126,24 +125,4 @@ ENTRY(name); \ #endif /* __ASSEMBLER__ */ -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(dreg, reg, tmpreg) \ - ld [%g7 + POINTER_GUARD], tmpreg; \ - xor reg, tmpreg, dreg -# define PTR_DEMANGLE(dreg, reg, tmpreg) PTR_MANGLE (dreg, reg, tmpreg) -# define PTR_MANGLE2(dreg, reg, tmpreg) \ - xor reg, tmpreg, dreg -# define PTR_DEMANGLE2(dreg, reg, tmpreg) PTR_MANGLE2 (dreg, reg, tmpreg) -# else -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* linux/sparc/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h index 7d7c629add..27968b26ad 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h @@ -1,5 +1,5 @@ /* Struct kernel_stat64 to stat64. Linux/SPARC version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h index 5aa80e32bf..dc59334df5 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* Copyright (C) 1997-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Richard Henderson , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -128,24 +127,4 @@ ENTRY(name); \ register windows. So if you poke stack memory directly you add this. */ #define STACK_BIAS 2047 -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(dreg, reg, tmpreg) \ - ldx [%g7 + POINTER_GUARD], tmpreg; \ - xor reg, tmpreg, dreg -# define PTR_DEMANGLE(dreg, reg, tmpreg) PTR_MANGLE (dreg, reg, tmpreg) -# define PTR_MANGLE2(dreg, reg, tmpreg) \ - xor reg, tmpreg, dreg -# define PTR_DEMANGLE2(dreg, reg, tmpreg) PTR_MANGLE2 (dreg, reg, tmpreg) -# else -# define PTR_MANGLE(var) \ - (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) -# define PTR_DEMANGLE(var) PTR_MANGLE (var) -# endif -#endif - #endif /* linux/sparc64/sysdep.h */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h index 0c55902178..a4b5897802 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h @@ -1,6 +1,5 @@ -/* Copyright (C) 2000-2021 Free Software Foundation, Inc. +/* Copyright (C) 2000-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 2000. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c index 95a50016fc..4271b85a7a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c index 329ab11f4b..17d69c34a4 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c index 0755584419..0d8e5ba11a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c @@ -1,5 +1,5 @@ /* Struct stat/stat64 to stat/stat64 conversion for Linux. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 @@ -22,25 +22,6 @@ #include #if __TIMESIZE != 64 - -static inline bool -in_time_t_range (__time64_t t) -{ - time_t s = t; - return s == t; -} - -static inline struct timespec -valid_timespec64_to_timespec (const struct __timespec64 ts64) -{ - struct timespec ts; - - ts.tv_sec = (time_t) ts64.tv_sec; - ts.tv_nsec = ts64.tv_nsec; - - return ts; -} - int __cp_stat64_t64_stat64 (const struct __stat64_t64 *st64_t64, struct stat64 *st64) diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h index 94a8c8a60d..7251fffaa3 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h @@ -1,5 +1,5 @@ /* Copy to/from struct stat with and without 64-bit time_t support. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h index 260d1812be..72ccf6aed4 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h @@ -1,5 +1,5 @@ /* Struct stat with 64-bit time support. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h index e2344058ad..2ec1b96586 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2021 Free Software Foundation, Inc. +/* Copyright (C) 1995-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h index e17265c607..1d17e57ea0 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2021 Free Software Foundation, Inc. +/* Copyright (C) 1995-2023 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 @@ -55,26 +55,26 @@ struct ntptimeval __BEGIN_DECLS #ifndef __USE_TIME_BITS64 -extern int adjtimex (struct timex *__ntx) __THROW; -extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; +extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1)); +extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW __nonnull ((1)); # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), - ntp_gettimex); + ntp_gettimex) __nonnull ((1)); # else # define ntp_gettime ntp_gettimex # endif -extern int ntp_adjtime (struct timex *__tntx) __THROW; +extern int ntp_adjtime (struct timex *__tntx) __THROW __nonnull ((1)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx), - ___adjtimex64); + ___adjtimex64) __nonnull ((1)); extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), - __ntp_gettime64); + __ntp_gettime64) __nonnull ((1)); extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv), - __ntp_gettimex64); + __ntp_gettimex64) __nonnull ((1)); extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx), - ___adjtimex64); + ___adjtimex64) __nonnull ((1)); # else # define adjtimex ___adjtimex64 # define ntp_adjtime ___adjtimex64 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h index 3ef72dc805..cc975e9f3e 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 Free Software Foundation, Inc. +/* Copyright (C) 2015-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h index 060af056f8..6b6ec0d288 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h index 1e49281e07..88efa3b6b2 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2021 Free Software Foundation, Inc. +/* Copyright (C) 1998-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h index 84888db77c..68322ff476 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. x86-64 version. - Copyright (C) 1999-2021 Free Software Foundation, Inc. + Copyright (C) 1999-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h index 327e59388b..c350ee157a 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Free Software Foundation, Inc. +/* Copyright (C) 2001-2023 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 @@ -43,7 +43,7 @@ might return a large offset. Therefore we must not anymore test for < 0, but test for a real error by making sure the value in %eax is a real error number. Linus said he will make sure the no syscall - returns a value in -1 .. -4095 as a valid result so we can savely + returns a value in -1 .. -4095 as a valid result so we can safely test with -4095. */ /* We don't want the label for the error handle to be global when we define @@ -379,50 +379,8 @@ # define HAVE_CLONE3_WRAPPER 1 -# define SINGLE_THREAD_BY_GLOBAL 1 - #endif /* __ASSEMBLER__ */ - -/* Pointer mangling support. */ -#if IS_IN (rtld) -/* We cannot use the thread descriptor because in ld.so we use setjmp - earlier than the descriptor is initialized. */ -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg) xor __pointer_chk_guard_local(%rip), reg; \ - rol $2*LP_SIZE+1, reg -# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \ - xor __pointer_chk_guard_local(%rip), reg -# else -# define PTR_MANGLE(reg) asm ("xor __pointer_chk_guard_local(%%rip), %0\n" \ - "rol $2*" LP_SIZE "+1, %0" \ - : "=r" (reg) : "0" (reg)) -# define PTR_DEMANGLE(reg) asm ("ror $2*" LP_SIZE "+1, %0\n" \ - "xor __pointer_chk_guard_local(%%rip), %0" \ - : "=r" (reg) : "0" (reg)) -# endif -#else -# ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg) xor %fs:POINTER_GUARD, reg; \ - rol $2*LP_SIZE+1, reg -# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \ - xor %fs:POINTER_GUARD, reg -# else -# define PTR_MANGLE(var) asm ("xor %%fs:%c2, %0\n" \ - "rol $2*" LP_SIZE "+1, %0" \ - : "=r" (var) \ - : "0" (var), \ - "i" (offsetof (tcbhead_t, \ - pointer_guard))) -# define PTR_DEMANGLE(var) asm ("ror $2*" LP_SIZE "+1, %0\n" \ - "xor %%fs:%c2, %0" \ - : "=r" (var) \ - : "0" (var), \ - "i" (offsetof (tcbhead_t, \ - pointer_guard))) -# endif -#endif - /* How to pass the off{64}_t argument on p{readv,writev}{64}. */ #undef LO_HI_LONG #define LO_HI_LONG(val) (val), 0 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h index 62c9737c6b..60224afb14 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2021 Free Software Foundation, Inc. +/* Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/xstatver.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/xstatver.h index 8e1801b603..d8fd35beb6 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/xstatver.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/xstatver.h @@ -1,13 +1,10 @@ /* Versions of the 'struct stat' data structure used in compatibility xstat functions. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 0 +#define _STAT_VER _STAT_VER_KERNEL /* Versions of the 'xmknod' interface used in compatibility xmknod functions. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER_LINUX 0 #define _MKNOD_VER _MKNOD_VER_LINUX diff --git a/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h b/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h index 225b6bdebc..1b104ed0f6 100644 --- a/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2021 Free Software Foundation, Inc. +/* Copyright (C) 1991-2023 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 diff --git a/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h b/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h index 3e7c54bd0c..0ccd15eb72 100644 --- a/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for divdi3 symbol manipulation. - Copyright (C) 2004-2021 Free Software Foundation, Inc. + Copyright (C) 2004-2023 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 @@ -23,7 +23,8 @@ assembler. Note: in_divdi3_c is only used to avoid symbol alias on divdi3 build itself. */ -#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED +#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) \ + && defined SHARED && !defined LIBC_NONSHARED asm ("__divdi3 = __divdi3_internal"); asm ("__udivdi3 = __udivdi3_internal"); asm ("__moddi3 = __moddi3_internal"); diff --git a/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h index 4ebc4f9748..20b3854d8a 100644 --- a/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. +/* Copyright (C) 2002-2023 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 diff --git a/lib/libc/glibc/sysdeps/x86/sysdep.h b/lib/libc/glibc/sysdeps/x86/sysdep.h index cac1d762fb..0b3483a77a 100644 --- a/lib/libc/glibc/sysdeps/x86/sysdep.h +++ b/lib/libc/glibc/sysdeps/x86/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for x86. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 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 @@ -78,15 +78,18 @@ enum cf_protection_level #define ASM_SIZE_DIRECTIVE(name) .size name,.-name; /* Define an entry point visible from C. */ -#define ENTRY(name) \ +#define ENTRY_P2ALIGN(name, alignment) \ .globl C_SYMBOL_NAME(name); \ .type C_SYMBOL_NAME(name),@function; \ - .align ALIGNARG(4); \ + .align ALIGNARG(alignment); \ C_LABEL(name) \ cfi_startproc; \ _CET_ENDBR; \ CALL_MCOUNT +/* Common entry 16 byte aligns. */ +#define ENTRY(name) ENTRY_P2ALIGN (name, 4) + #undef END #define END(name) \ cfi_endproc; \ @@ -108,7 +111,8 @@ enum cf_protection_level /* Local label name for asm code. */ #ifndef L /* ELF-like local names start with `.L'. */ -# define L(name) .L##name +# define LOCAL_LABEL(name) .L##name +# define L(name) LOCAL_LABEL(name) #endif #define atom_text_section .section ".text.atom", "ax" diff --git a/lib/libc/glibc/sysdeps/x86_64/crti.S b/lib/libc/glibc/sysdeps/x86_64/crti.S index 129d1befc7..3633899377 100644 --- a/lib/libc/glibc/sysdeps/x86_64/crti.S +++ b/lib/libc/glibc/sysdeps/x86_64/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for x86-64. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/x86_64/crtn.S b/lib/libc/glibc/sysdeps/x86_64/crtn.S index b06fe62f26..e959cdff1c 100644 --- a/lib/libc/glibc/sysdeps/x86_64/crtn.S +++ b/lib/libc/glibc/sysdeps/x86_64/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for x86-64. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 diff --git a/lib/libc/glibc/sysdeps/x86_64/start.S b/lib/libc/glibc/sysdeps/x86_64/start.S index 1b3e36826b..4cedc7214d 100644 --- a/lib/libc/glibc/sysdeps/x86_64/start.S +++ b/lib/libc/glibc/sysdeps/x86_64/start.S @@ -1,7 +1,6 @@ /* Startup code compliant to the ELF x86-64 ABI. - Copyright (C) 2001-2021 Free Software Foundation, Inc. + Copyright (C) 2001-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Andreas Jaeger , 2001. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/glibc/sysdeps/x86_64/sysdep.h b/lib/libc/glibc/sysdeps/x86_64/sysdep.h index 7bebdeb210..6ca169573d 100644 --- a/lib/libc/glibc/sysdeps/x86_64/sysdep.h +++ b/lib/libc/glibc/sysdeps/x86_64/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for x86-64. - Copyright (C) 2001-2021 Free Software Foundation, Inc. + Copyright (C) 2001-2023 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 @@ -20,6 +20,7 @@ #define _X86_64_SYSDEP_H 1 #include +#include #ifdef __ASSEMBLER__ @@ -68,9 +69,6 @@ lose: \ # define JUMPTARGET(name) name #endif -/* Long and pointer size in bytes. */ -#define LP_SIZE 8 - /* Instruction to operate on long and pointer. */ #define LP_OP(insn) insn##q @@ -99,13 +97,31 @@ lose: \ to avoid RTM abort triggered by VZEROUPPER inside transactionally. */ #define ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST \ xtest; \ - jz 1f; \ - vzeroall; \ + jnz 1f; \ + vzeroupper; \ ret; \ 1: \ - vzeroupper; \ + vzeroall; \ ret +/* Can be used to replace vzeroupper that is not directly before a + return. This is useful when hoisting a vzeroupper from multiple + return paths to decrease the total number of vzerouppers and code + size. */ +#define COND_VZEROUPPER_XTEST \ + xtest; \ + jz 1f; \ + vzeroall; \ + jmp 2f; \ +1: \ + vzeroupper; \ +2: + +/* In RTM define this as COND_VZEROUPPER_XTEST. */ +#ifndef COND_VZEROUPPER +# define COND_VZEROUPPER vzeroupper +#endif + /* Zero upper vector registers and return. */ #ifndef ZERO_UPPER_VEC_REGISTERS_RETURN # define ZERO_UPPER_VEC_REGISTERS_RETURN \ @@ -119,9 +135,6 @@ lose: \ #else /* __ASSEMBLER__ */ -/* Long and pointer size in bytes. */ -#define LP_SIZE "8" - /* Instruction to operate on long and pointer. */ #define LP_OP(insn) #insn "q" diff --git a/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h b/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h index e902176879..8b7ef01f91 100644 --- a/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h +++ b/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for x32. - Copyright (C) 2012-2021 Free Software Foundation, Inc. + Copyright (C) 2012-2023 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 @@ -17,8 +17,8 @@ . */ #include +#include -#undef LP_SIZE #undef LP_OP #undef ASM_ADDR @@ -41,8 +41,6 @@ #ifdef __ASSEMBLER__ -# define LP_SIZE 4 - # define LP_OP(insn) insn##l # define ASM_ADDR .long @@ -66,8 +64,6 @@ #else /* __ASSEMBLER__ */ -# define LP_SIZE "4" - # define LP_OP(insn) #insn "l" # define ASM_ADDR ".long"