about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
Commit message (Collapse)AuthorAgeFilesLines
* aarch64: Update ILP32 abilists for glibc 2.33 schwab/ilp32-2.33 schwab/ilp32Andreas Schwab2021-03-071-0/+11
|
* linux: Consolidate fxstat{64}Andreas Schwab2021-03-072-0/+9
|
* aarch64: update ILP32 arch-syscall.hAndreas Schwab2021-03-071-0/+3
|
* linux: Define STAT64_IS_KERNEL_STAT64Andreas Schwab2021-03-071-0/+1
|
* linux: Always define STAT_IS_KERNEL_STATAndreas Schwab2021-03-071-1/+1
|
* aarch64: update ILP32 arch-syscall.hAndreas Schwab2021-03-071-0/+3
|
* aarch64: Update ILP32 abilists for glibc 2.32Andreas Schwab2021-03-074-24/+18
|
* aarch64: adjust bits/typesizes.hAndreas Schwab2021-03-071-2/+14
|
* aarch64: use correct VSYSCALL definition for ILP32Andreas Schwab2021-03-071-0/+5
|
* aarch64: Fix bits/utmpx.h for GCC 8Andreas Schwab2021-03-071-4/+8
|
* aarch64: Fix bits/utmp.h for GCC 8Andreas Schwab2021-03-071-3/+4
|
* aarch64: Update ILP32 abilists for glibc 2.31Andreas Schwab2021-03-072-14/+17
|
* aarch64: add ILP32 arch-syscall.hAndreas Schwab2021-03-072-0/+310
|
* aarch64: Update ILP32 abilists for glibc 2.30Szabolcs Nagy2021-03-072-0/+9
| | | | | | | | | This will need to be merged with the initial ilp32 abilist commit. 2019-08-01 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Update.
* aarch64: Update ILP32 abilists for glibc 2.29Szabolcs Nagy2021-03-071-0/+3
| | | | | | | | This will need to be merged with the initial ilp32 abilist commit. 2019-05-09 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update.
* aarch64: Update ILP32 abilists for glibc 2.28Szabolcs Nagy2021-03-073-0/+80
| | | | | | | | | | This will need to be merged with the initial ilp32 abilist commit. 2018-08-03 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Likewise.
* aarch64: Ignore absolute symbols in ILP32 abilistsSzabolcs Nagy2021-03-0713-13/+0
| | | | | | | | | | | | | | | | | | | | | | This will need to be merged with the initial ilp32 abilist commit. 2018-08-03 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/ld.abilist: Ignore absolute symbols. * sysdeps/unix/sysv/linux/aarch64/ilp32/libBrokenLocale.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libanl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libcrypt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libdl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libnsl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/librt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libthread_db.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libutil.abilist: Likewise.
* aarch64: Fix bits/utmp.h for GCC 8Szabolcs Nagy2021-03-071-3/+6
| | | | | | | | | | The same suppression of -Wstringop-truncation warnings as in commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c but for aarch64. 2018-02-21 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/bits/utmp.h (struct utmp): Use __attribute_nonstring__.
* aarch64: Update ILP32 abilistsSzabolcs Nagy2021-03-073-1/+334
| | | | | | | | | | | | Update libc and libm abilists with copy_file_range, mlock2, pkey_* and _FloatN related symbols. Remove pthread_self from the libpthread abilist. This will need to be merged with the initial ilp32 abilist commit. 2018-01-26 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Update.
* aarch64: Fix jmp_buf-macros.h for ILP32.Szabolcs Nagy2021-03-071-1/+5
| | | | | | | | | The offset is different on ILP32 because __saved_mask is 4 byte aligned. 2017-11-28 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h (SAVED_MASK_OFFSET): Fix for ILP32.
* aarch64: Update ILP32 abilistsSzabolcs Nagy2021-03-074-2/+219
| | | | | | | | | | | | | Update libc and libm abilists with memfd_create and new _FloatN symbols. Remove __nis_hash and __p_secstodate from libnsl and libresolv abilists. This will need to be merged with the initial ilp32 abilist commit. 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libnsl.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist: Update.
* aarch64: Update ILP32 abilistsSzabolcs Nagy2021-03-075-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | Update abilist files because a number of symbols got removed for GLIBC_2.27. ILP32 now needs separate localplt.data as well because it has no matherr PLT anymore. (Eventually this will be merged into the initial abilist commit.) 2017-09-29 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist (__nss_group_lookup): Remove. (__nss_hosts_lookup): Remove. (__nss_passwd_lookup): Remove. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist (_LIB_VERSION): Remove. (matherr): Remove. (pow10): Remove. (pow10f): Remove. (pow10l): Remove. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist (_res_opcodes): Remove. * sysdeps/unix/sysv/linux/aarch64/ilp32/localplt.data: New file.
* aarch64: Set ilp32 minimum linux version to 4.12Szabolcs Nagy2021-03-072-2/+2
| | | | | | | | | | | | Mainline linux does not support ilp32 yet, but there is support for this abi since linux v4.12 in the arm64 linux repo under ilp32 staging branches. 2017-09-01 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/configure.ac (arch_minimum_kernel): Set to 4.12.0 on ILP32. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate.
* aarch64: Add ILP32 supportSteve Ellcey2021-03-0721-11/+700
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the ILP32 abi variant to aarch64. 2017-09-01 Andrew Pinski <andrew.pinski@caviumnetworks.com> Yury Norov <ynorov@caviumnetworks.com> Steve Ellcey <sellcey@caviumnetworks.com> * elf/cache.c (print_entry): Add FLAG_AARCH64_LIB32. * sysdeps/aarch64/configure.ac (HAVE_AARCH64_ILP32): New define. (default-abi): Allow for ilp32 ABI. * sysdeps/aarch64/configure: Regenerate. * sysdeps/aarch64/Implies: Deleted. * sysdeps/aarch64/ilp32/Implies: New file. * sysdeps/aarch64/ilp32/Implies-after: New file. * sysdeps/aarch64/lp64/Implies: New file. * sysdeps/aarch64/lp64/Implies-after: New file. * sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h (__PTHREAD_RWLOCK_INT_FLAGS_SHARED): Set to 1. * sysdeps/aarch64/preconfigure (machine): Check for ilp32/lp64. * sysdeps/aarch64/tls-macros.h (TLS_IE): Remove register specification for __result and ifdef for ILP32. * sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB32): New define. * sysdeps/unix/sysv/linux/aarch64/Implies: Remove generic and wordsize-64 entries. * sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants): Add new variants for ilp32 and ilp32_be. (abi-lp64-condition, abi-lp64_be-condition): Check for __WORDSIZE equal to 64. (abi-ilp32-condition, abi-ilp32_be-condition): New. * sysdeps/unix/sysv/linux/aarch64/configure.ac (arch_minimum_kernel): Use different value for ILP32. (LIBC_SLIBDIR_RTLDDIR): Modify for ILP32. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate. * sysdeps/unix/sysv/linux/aarch64/ilp32/Implies: New file. * sysdeps/unix/sysv/linux/aarch64/ilp32/c++-types.data: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/statfs.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/utmp.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/kernel-features.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/Implies: Add unix/sysv/linux/aarch64. * sysdeps/unix/sysv/linux/aarch64/ioctl.S: Move to lp64 directory. * sysdeps/unix/sysv/linux/aarch64/mmap.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/aarch64/c++-types.data: Likewise. * sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed: Likewise. * sysdeps/unix/sysv/linux/aarch64/ipc_priv.h (__IPC_64): Check __ILP32 when setting. * sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file): Check for EM_AARCH64 when processing ELFCLASS32 object. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h (F_GETLK, F_SETLCK, F_SETLKW): Check for __OFF_T_MATCHES_OFF64_T when defining.
* aarch64: Add abilists for ILP32 supportSteve Ellcey2021-03-0726-0/+3060
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename lp64 abilist files and add new ilp32 abilist files with GLIBC_2.27 symbol versions. 2017-09-01 Andrew Pinski <andrew.pinski@caviumnetworks.com> Yury Norov <ynorov@caviumnetworks.com> Steve Ellcey <sellcey@caviumnetworks.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/ld.abilist: New file. * sysdeps/unix/sysv/linux/aarch64/ilp32/libBrokenLocale.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libanl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libcrypt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libdl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libnsl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/librt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libthread_db.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libutil.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ld.abilist: Moved to lp64 directory. * sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libanl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libdl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libnsl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libresolv.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/librt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libutil.abilist: Likewise.
* ia64: Fix brk call on statupAdhemerval Zanella2021-01-281-0/+22
| | | | | | | | | brk used by statup before TCB is properly set, so we can't use IA64_USE_NEW_STUB. This patch fixes a regression introduced by 720480934ab910. Checked on ia64-linux-gnu.
* linux: mips: Fix getdents64 fallback on mips64-n32Adhemerval Zanella2021-01-222-24/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC mainline shows the following error: ../sysdeps/unix/sysv/linux/mips/mips64/getdents64.c: In function '__getdents64': ../sysdeps/unix/sysv/linux/mips/mips64/getdents64.c:121:7: error: 'memcpy' forming offset [4, 7] is out of the bounds [0, 4] [-Werror=array-bounds] 121 | memcpy (((char *) dp + offsetof (struct dirent64, d_ino)), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | KDP_MEMBER (kdp, d_ino), sizeof ((struct dirent64){0}.d_ino)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/unix/sysv/linux/mips/mips64/getdents64.c:123:7: error: 'memcpy' forming offset [4, 7] is out of the bounds [0, 4] [-Werror=array-bounds] 123 | memcpy (((char *) dp + offsetof (struct dirent64, d_off)), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124 | KDP_MEMBER (kdp, d_off), sizeof ((struct dirent64){0}.d_off)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The issue is due both d_ino and d_off fields for mips64-n32 kernel_dirent are 32-bits, while this is using memcpy to copy 64 bits from it into the glibc dirent64. The fix is to use a temporary buffer to read the correct type from kernel_dirent. Checked with a build-many-glibcs.py for mips64el-linux-gnu and I also checked the tst-getdents64 on mips64el 4.1.4 kernel with and without fallback enabled (by manually setting the getdents64_supported).
* x86-64: Update tst-glibc-hwcaps-2.c for x86-64 baselineH.J. Lu2021-01-221-1/+1
| | | | | Return EXIT_FAILURE only if the level 2 libx86-64-isa-level.so is used on x86-64 baseline machine.
* powerpc64: Select POWER9 machine for the scv instructionFlorian Weimer2021-01-222-1/+7
| | | | | | | | | It is not available with the baseline ISA. Fixes commit 68ab82f56690ada86ac1e0c46bad06ba189a10ef ("powerpc: Runtime selection between sc and scv for syscalls"). Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* Revert "linux: Move {f}xstat{at} to compat symbols" for static buildAdhemerval Zanella2021-01-218-16/+17
| | | | | | | | | | | | | | This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 for static library. This avoids the need to rebuild the world for the case where libstdc++ (and potentially other libraries) are linked to a old glibc. To avoid requering to provide xstat symbols for newer ABIs (such as riscv32) a new LIB_COMPAT macro is added. It is similar to SHLIB_COMPAT but also works for static case (thus evaluating similar to SHLIB_COMPAT for both shared and static case). Checked with a check-abi on all affected ABIs. I also check if the static library does contains the xstat symbols.
* Use hidden visibility for early static PIE codeSzabolcs Nagy2021-01-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Extern symbol access in position independent code usually involves GOT indirection which needs RELATIVE reloc in a static linked PIE. (On some targets this is avoided e.g. because the linker can relax a GOT access to a pc-relative access, but this is not generally true.) Code that runs before static PIE self relocation must avoid relying on dynamic relocations which can be ensured by using hidden visibility. However we cannot just make all symbols hidden: On i386, all calls to IFUNC functions must go through PLT and calls to hidden functions CANNOT go through PLT in PIE since EBX used in PIE PLT may not be set up for local calls to hidden IFUNC functions. This patch aims to make symbol references hidden in code that is used before and by _dl_relocate_static_pie when building a static PIE libc. Note: for an object that is used in the startup code, its references and definition may not have consistent visibility: it is only forced hidden in the startup code. This is needed for fixing bug 27072. Co-authored-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* <sys/platform/x86.h>: Remove the C preprocessor magicH.J. Lu2021-01-217-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In <sys/platform/x86.h>, define CPU features as enum instead of using the C preprocessor magic to make it easier to wrap this functionality in other languages. Move the C preprocessor magic to internal header for better GCC codegen when more than one features are checked in a single expression as in x86-64 dl-hwcaps-subdirs.c. 1. Rename COMMON_CPUID_INDEX_XXX to CPUID_INDEX_XXX. 2. Move CPUID_INDEX_MAX to sysdeps/x86/include/cpu-features.h. 3. Remove struct cpu_features and __x86_get_cpu_features from <sys/platform/x86.h>. 4. Add __x86_get_cpuid_feature_leaf to <sys/platform/x86.h> and put it in libc. 5. Make __get_cpu_features() private to glibc. 6. Replace __x86_get_cpu_features(N) with __get_cpu_features(). 7. Add _dl_x86_get_cpu_features to GLIBC_PRIVATE. 8. Use a single enum index for each CPU feature detection. 9. Pass the CPUID feature leaf to __x86_get_cpuid_feature_leaf. 10. Return zero struct cpuid_feature for the older glibc binary with a smaller CPUID_INDEX_MAX [BZ #27104]. 11. Inside glibc, use the C preprocessor magic so that cpu_features data can be loaded just once leading to more compact code for glibc. 256 bits are used for each CPUID leaf. Some leaves only contain a few features. We can add exceptions to such leaves. But it will increase code sizes and it is harder to provide backward/forward compatibilities when new features are added to such leaves in the future. When new leaves are added, _rtld_global_ro offsets will change which leads to race condition during in-place updates. We may avoid in-place updates by 1. Rename the old glibc. 2. Install the new glibc. 3. Remove the old glibc. NB: A function, __x86_get_cpuid_feature_leaf , is used to avoid the copy relocation issue with IFUNC resolver as shown in IFUNC resolver tests.
* Use <startup.h> in __libc_init_secureH.J. Lu2021-01-191-2/+27
| | | | | | | | | Since __libc_init_secure is called before ARCH_SETUP_TLS, it must use "int $0x80" for system calls in i386 static PIE. Add startup_getuid, startup_geteuid, startup_getgid and startup_getegid to <startup.h>. Update __libc_init_secure to use them. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* ldconfig/x86: Store ISA level in cache and aux cacheH.J. Lu2021-01-1312-81/+295
| | | | | | | | | | | Store ISA level in the portion of the unused upper 32 bits of the hwcaps field in cache and the unused pad field in aux cache. ISA level is stored and checked only for shared objects in glibc-hwcaps subdirectories. The shared objects in the default directories aren't checked since there are no fallbacks for these shared objects. Tested on x86-64-v2, x86-64-v3 and x86-64-v4 machines with --disable-hardcoded-path-in-tests and --enable-hardcoded-path-in-tests.
* Add SEGV_MTEAERR and SEGV_MTESERR from Linux 5.10.Joseph Myers2021-01-061-1/+5
| | | | | | | Linux 5.10 adds constants SEGV_MTEAERR and SEGV_MTESERR to asm-generic/siginfo.h. Add these to glibc's bits/siginfo-consts.h. Tested for x86_64.
* stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ #26341] ↵Adhemerval Zanella2021-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | [BZ #24970] It sync with gnulib version ae9fb3d66. The testcase for BZ#23741 (stdlib/test-bz22786.c) is adjusted to check also for ENOMEM. The patch fixes multiple realpath issues: - Portability fixes for errno clobbering on free (BZ#10635). The function does not call free directly anymore, although it might be done through scratch_buffer_free. The free errno clobbering is being tracked by BZ#17924. - Pointer arithmetic overflows in realpath (BZ#26592). - Realpath cyclically call __alloca(path_max) to consume too much stack space (BZ#26341). - Realpath mishandles EOVERFLOW; stat not needed anyway (BZ#24970). The check is done through faccessat now. Checked on x86_64-linux-gnu and i686-linux-gnu.
* alpha: Provide wait4 for static library [BZ #27150]Adhemerval Zanella2021-01-051-0/+2
| | | | | | | | This ia regression from 09153638cfef91, versioned_symbol acts as weak_alias for !SHARED but it is undefined to avoid non versioned alias from the generic implementation. Checked with a build for alpha-linux-gnu.
* Update copyright dates not handled by scripts/update-copyrights.Paul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | I've updated copyright dates in glibc for 2021. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files. As well as the usual annual updates, mainly dates in --version output (minus csu/version.c which previously had to be handled manually but is now successfully updated by update-copyrights), there is a small change to the copyright notice in NEWS which should let NEWS get updated automatically next year. Please remember to include 2021 in the dates for any new files added in future (which means updating any existing uncommitted patches you have that add new files to use the new copyright dates in them).
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021459-1459/+1459
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* aarch64: use PTR_ARG and SIZE_ARG instead of DELOUSESzabolcs Nagy2020-12-314-10/+9
| | | | | | | | | | | | | | | DELOUSE was added to asm code to make them compatible with non-LP64 ABIs, but it is an unfortunate name and the code was not compatible with ABIs where pointer and size_t are different. Glibc currently only supports the LP64 ABI so these macros are not really needed or tested, but for now the name is changed to be more meaningful instead of removing them completely. Some DELOUSE macros were dropped: clone, strlen and strnlen used it unnecessarily. The out of tree ILP32 patches are currently not maintained and will likely need a rework to rebase them on top of the time64 changes.
* powerpc: Use scv instruction on clone when availableMatheus Castanho2020-12-301-3/+30
| | | | | | | | | | clone already uses r31 to temporarily save input arguments before doing the syscall, so we use a different register to read from the TCB. We can also avoid allocating another stack frame, which is not needed since we can simply extend the usage of the red zone. Tested-by: Lucas A. M. Magalhães <lamm@linux.ibm.com> Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc: Runtime selection between sc and scv for syscallsMatheus Castanho2020-12-304-31/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux kernel v5.9 added support for system calls using the scv instruction for POWER9 and later. The new codepath provides better performance (see below) if compared to using sc. For the foreseeable future, both sc and scv mechanisms will co-exist, so this patch enables glibc to do a runtime check and use scv when it is available. Before issuing the system call to the kernel, we check hwcap2 in the TCB for PPC_FEATURE2_SCV to see if scv is supported by the kernel. If not, we fallback to sc and keep the old behavior. The kernel implements a different error return convention for scv, so when returning from a system call we need to handle the return value differently depending on the instruction we used to enter the kernel. For syscalls implemented in ASM, entry and exit are implemented by different macros (PSEUDO and PSEUDO_RET, resp.), which may be used in sequence (e.g. for templated syscalls) or with other instructions in between (e.g. clone). To avoid accessing the TCB a second time on PSEUDO_RET to check which instruction we used, the value read from hwcap2 is cached on a non-volatile register. This is not needed when using INTERNAL_SYSCALL macro, since entry and exit are bundled into the same inline asm directive. The dynamic loader may issue syscalls before the TCB has been setup so it always uses sc with no extra checks. For the static case, there is no compile-time way to determine if we are inside startup code, so we also check the value of the thread pointer before effectively accessing the TCB. For such situations in which the availability of scv cannot be determined, sc is always used. Support for scv in syscalls implemented in their own ASM file (clone and vfork) will be added later. For now simply use sc as before. Average performance over 1M calls for each syscall "type": - stat: C wrapper calling INTERNAL_SYSCALL - getpid: templated ASM syscall - syscall: call to gettid using syscall function Standard: stat : 1.573445 us / ~3619 cycles getpid : 0.164986 us / ~379 cycles syscall : 0.162743 us / ~374 cycles With scv: stat : 1.537049 us / ~3535 cycles <~ -84 cycles / -2.32% getpid : 0.109923 us / ~253 cycles <~ -126 cycles / -33.25% syscall : 0.116410 us / ~268 cycles <~ -106 cycles / -28.34% Tested on powerpc, powerpc64, powerpc64le (with and without scv) Tested-by: Lucas A. M. Magalhães <lamm@linux.ibm.com> Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* io: Remove xmknod{at} implementationsAdhemerval Zanella2020-12-292-29/+2
| | | | | | | | | | With xmknod wrapper functions removed (589260cef8), the mknod functions are now properly exported, and version is done using symbols versioning instead of the extra _MKNOD_* argument. It also allows us to consolidate Linux and Hurd mknod implementation. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* io: Remove xstat implementationsAdhemerval Zanella2020-12-291-1/+3
| | | | | | | | With xstat wrapper functions removed (8ed005daf0), the stat functions are now properly exported, and version is done using symbols versioning instead of the extra _STAT_* argument. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* aarch64: Add sysv specific enabling code for memory taggingRichard Earnshaw2020-12-214-0/+34
| | | | | | | | | | | | | | | | | | | Add various defines and stubs for enabling MTE on AArch64 sysv-like systems such as Linux. The HWCAP feature bit is copied over in the same way as other feature bits. Similarly we add a new wrapper header for mman.h to define the PROT_MTE flag that can be used with mmap and related functions. We add a new field to struct cpu_features that can be used, for example, to check whether or not certain ifunc'd routines should be bound to MTE-safe versions. Finally, if we detect that MTE should be enabled (ie via the glibc tunable); we enable MTE during startup as required. Support in the Linux kernel was added in version 5.10. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* linux: Add compatibility definitions to sys/prctl.h for MTERichard Earnshaw2020-12-211-0/+18
| | | | | | | | | Older versions of the Linux kernel headers obviously lack support for memory tagging, but we still want to be able to build in support when using those (obviously it can't be enabled on such systems). The linux kernel extensions are made to the platform-independent header (linux/prctl.h), so this patch takes a similar approach.
* alpha: Remove anonymous union in struct stat [BZ #27042]Matt Turner2020-12-213-63/+66
| | | | | | | | | | This is clever, but it confuses downstream detection in at least zstd and GNOME's glib. zstd has preprocessor tests for the 'st_mtime' macro, which is not provided by the path using the anonymous union; glib checks for the presence of 'st_mtimensec' in struct stat but then tries to access that field in struct statx (which might be a bug on its own). Checked with a build for alpha-linux-gnu.
* Update kernel version to 5.10 in tst-mman-consts.py.Joseph Myers2020-12-171-1/+1
| | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.10. (There are no new MAP_* constants covered by this test in 5.10 that need any other header changes.) Tested with build-many-glibcs.py.
* Update syscall lists for Linux 5.10.Joseph Myers2020-12-1626-2/+28
| | | | | | | | Linux 5.10 has one new syscall, process_madvise. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
* Fix spelling and grammar in several commentsJonny Grant2020-12-121-2/+1
|