aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-15shm tests: Append PID to names passed to shm_open [BZ #26737]H.J. Lu
Append PID to names passed to shm_open in shm tests to avoid random FAIL: rt/tst-shm-cancel FAIL: rt/tst-shm due to the same name passed to shm_open and shm_unlink when more than one "make check" running in parallel on the same machine. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-15sysvipc: Fix tst-sysvshm-linux on x32Adhemerval Zanella
The Linux shminfo fields are '__syscall_ulong_t' (which is 64-bit for x32). This patch fixes the test to compare againt the correct type and to only clamp the value if '__syscall_ulong_t' is the same size of 'unsigned long int'. Checked on x86_64-linux-gnu-x32.
2020-10-15x86/CET: Update vfork to prevent child returnH.J. Lu
Child of vfork should either call _exit or one of the exec family of functions. But normally there is nothing to prevent child of vfork from return of the vfork-calling function. Simpilfy x86 vfork when shadow stack is in use to introduce mismatched shadow stack in child of vfork to trigger SIGSEGV when the child returns from the function in which vfork was called.
2020-10-15resolv: Serialize processing in resolv/tst-resolv-txnid-collisionFlorian Weimer
When switching name servers, response processing by two server threads clobbers the global test state. (There is still some risk that this test is negatively impact by packet drops and packet reordering, but this applies to many of the resolver tests and is difficult to avoid.) Fixes commit f1f00c072138af90ae6da180f260111f09afe7a3 ("resolv: Handle transaction ID collisions in parallel queries (bug 26600)").
2020-10-15statfs: add missing f_flags assignmentChen Li
f_flags is added into struct statfs since Linux 2.6.36, which is lacked in glibc's statfs64.c until now. So mount flags is uninitialized on platforms having no statfs64 syscall in kernel, e.g., alpha and its derivation
2020-10-15y2038: Remove not used __fstatat_time64 defineLukasz Majewski
This define is only present in the ./include/sys/stat.h file. As it is not used in any other place it is eligible to be removed.
2020-10-15y2038: nptl: Convert pthread_mutex_{clock|timed}lock to support 64 bitLukasz Majewski
The pthread_mutex_clocklock and pthread_mutex_timedlock have been converted to support 64 bit time. This change uses: - New __futex_clocklock_wait64 (instead of lll_timedwait) from ./sysdeps/nptl/futex-helpers.c and - New __futex_clocklock64 function (instead of lll_clocklock) - New futex_lock_pi64 defined in sysdeps/nptl/futex-internal.h The pthread_mutex_{clock|timed}lock only accepts absolute time. Moreover, there is no need to check for NULL passed as *abstime pointer to the syscalls as those calls have exported symbols marked with __nonull attribute for abstime. Some architectures - namely x86, powerpc and s390 - do support lock elision. For those - adjustments have been made in arch specific elision-*.c files to use __futex_clocklock64 instead of lll_clocklock. The __lll_lock_elision (aliased to __lll_clocklock_elision in e.g. sysdeps/unix/sysv/linux/s390/elision-timed.c) just uses, in this patch provided, __futex_clocklock64. For systems with __TIMESIZE != 64 && __WORDSIZE == 32: - Conversions between 64 bit time to 32 bit are necessary - Redirection to pthread_mutex_{clock|timed}lock will provide support for 64 bit time Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-14sysvipc: Return EINVAL for invalid shmctl commandsAdhemerval Zanella
It avoids regressions on possible future commands that might require additional libc support. The downside is new commands added by newer kernels will need further glibc support. Checked on x86_64-linux-gnu and i686-linux-gnu (Linux v4.15 and v5.4).
2020-10-14sysvipc: Fix IPC_INFO and SHM_INFO handling [BZ #26636]Adhemerval Zanella
Both commands are Linux extensions where the third argument is either a 'struct shminfo' (IPC_INFO) or a 'struct shm_info' (SHM_INFO) instead of 'struct shmid_ds'. And their information does not contain any time related fields, so there is no need to extra conversion for __IPC_TIME64. The regression testcase checks for Linux specifix SysV ipc message control extension. For SHM_INFO it tries to match the values against the tunable /proc values and for MSG_STAT/MSG_STAT_ANY it check if the create\ shared memory is within the global list returned by the kernel. Checked on x86_64-linux-gnu and on i686-linux-gnu (Linux v5.4 and on Linux v4.15).
2020-10-14AArch64: Use __memcpy_simd on Neoverse N2/V1Wilco Dijkstra
Add CPU detection of Neoverse N2 and Neoverse V1, and select __memcpy_simd as the memcpy/memmove ifunc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-14resolv: Handle transaction ID collisions in parallel queries (bug 26600)Florian Weimer
If the transaction IDs are equal, the old check attributed both responses to the first query, not recognizing the second response. This fixes bug 26600.
2020-10-14support: Provide a way to clear the RA bit in DNS server responsesFlorian Weimer
2020-10-14support: Provide a way to reorder responses within the DNS test serverFlorian Weimer
2020-10-13Add missing stat/mknod symbol on libc.abilist some ABIsAdhemerval Zanella
It adds the missing new symbols from 8ed005daf0 and 589260cef8 (which added versioned symbols for {f,l}stat{at}{64} and mknod{a}t) on some libc.abilist ABIs.
2020-10-13manual: correct the spelling of "MALLOC_PERTURB_" [BZ #23015]Benno Schulenberg
Reported-by: Martin Dorey <martin.dorey@hds.com>
2020-10-13manual: replace an obsolete collation example with a valid oneBenno Schulenberg
In the Spanish language, the digraph "ll" has not been considered a separate letter since 1994: https://www.rae.es/consultas/exclusion-de-ch-y-ll-del-abecedario Since January 1998 (commit 49891c106244888123557fca7fddda4fa1f96b1d), glibc's locale data no longer specifies "ch" and "ll" as separate collation elements. So, it's better to not use "ll" in an example. Also, the Czech "ch" is a better example as it collates in a more surprising place.
2020-10-13rtld: fix typo in commentRolf Eike Beer
2020-10-12elf: Add missing <dl-procinfo.h> header to elf/dl-usage.cMatheus Castanho
2020-10-11hurd: support clock_gettime(CLOCK_PROCESS/THREAD_CPUTIME_ID)Samuel Thibault
* sysdeps/mach/clock_gettime.c (__clock_gettime): Add support for CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
2020-10-09linux: Move xmknod{at} to compat symbolsAdhemerval Zanella
It also decouple mknod{at} from xmknod{at}. The riscv32 ABI was added on 2.33, so it is safe to remove the old __xmknot{at} symbols and just provide the newer mknod{at} ones. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09linux: Add {f}stat{at} y2038 supportAdhemerval Zanella
A new struct __stat{64}_t64 type is added with the required __timespec64 time definition. Only LFS is added, 64-bit time with 32-bit offsets is not supposed to be supported (no existing glibc configuration supports such a combination). It is done with an extra __NR_statx call plus a conversion to the new __stat{64}_t64 type. The statx call is done only for 32-bit time_t ABIs. Internally some extra routines to copy from/to struct stat{64} to struct __stat{64} used on multiple implementations (stat, fstat, lstat, and fstatat) are added on a extra implementation (stat_t64_cp.c). Alse some extra routines to copy from statx to __stat{64} is added on statx_cp.c. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09linux: Move {f}xstat{at} to compat symbolsAdhemerval Zanella
They are no interna uses anymore. The riscv32 ABI was added on 2.33, so it is safe to remove the old __{f,l}stat{at} symbols and just provide the newer {f,l}stat{at} ones. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09linux: Disentangle fstatat from fxstatatAdhemerval Zanella
It implements all the required syscall for the all Linux kABIS on fstatat{64} instead of calling fxstatat{64}. On non-LFS implementation, it handles 3 cases: 1. New kABIs which uses generic pre 64-bit time Linux ABI (csky and nios): it issues __NR_fstat64 plus handle the overflow on st_ino, st_size, or st_blocks. 2. Old KABIs with old non-LFS support (arm, i386, hppa, m68k, microblaze, mips32, s390, sh, powerpc, and sparc32): it issues __NR_fstatat64 and convert the result to struct stat. 3. 64-bit kABI outliers (mips64 and mips64-n32): it issues __NR_newfstatat and convert the result to struct stat. The generic LFS implementation handles multiple cases: 1. XSTAT_IS_XSTAT64 being 1: 1.1. 64-bit kABI (aarch64, ia64, powerpc64*, s390x, riscv64, and x86_64): it issues __NR_newfstatat. 1.2. 64-bit kABI outlier (alpha): it issues __NR_fstatat64. 1.3. 64-bit kABI outlier where struct stat64 does not match kernel one (sparc64): it issues __NR_fstatat64 and convert the result to struct stat64. 1.4. 32-bit kABI with default 64-bit time_t (arc, riscv32): it issues __NR_statx and convert the result to struct stat64. 2. Old ABIs with XSTAT_IS_XSTAT64 being 0: 2.1. All kABIs with non-LFS support (arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32, and sparc32): it issues __NR_fstatat64. 2.2. 64-bit kABI outliers (mips64 and mips64-n32): it issues __NR_newfstatat and convert the result to struct stat64. It allows to remove all the hidden definitions from the {f,l}xstat{64} (some are still kept because Hurd requires it). Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09linux: Implement {l}fstat{at} in terms of fstatatAdhemerval Zanella
Both fstatat and fstata64 calls the old fxstatat and fxstatat64 repectivelly with _STAT_VER, the one currently exported as default for all ABIs. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09linux: Move the struct stat{64} to struct_stat.hAdhemerval Zanella
The common definitions are moved to a Linux generic stat.h while the struct stat{64} definition are moved to a arch-specific struct_stat.h header. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09Remove mknod wrapper functions, move them to symbolsAdhemerval Zanella
This patch removes the mknod and mknodat static wrapper and add the symbols on the libc with the expected names. Both the prototypes of the internal symbol linked by the static wrappers and the inline redirectors are also removed from the installed sys/stat.h header file. The wrapper implementation license LGPL exception is also removed since it is no longer statically linked to binaries. Internally the _STAT_VER* definitions are moved to the arch-specific xstatver.h file. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09Remove stat wrapper functions, move them to exported symbolsAdhemerval Zanella
This patch removes the stat, stat64, lstat, lstat64, fstat, fstat64, fstatat, and fstatat64 static wrapper and add the symbol on the libc with the expected names. Both the prototypes of the internal symbol linked by the static wrappers and the inline redirectors are also removed from the installed sys/stat.h header file. The wrapper implementation license LGPL exception is also removed since it is no longer statically linked to binaries. Internally the _STAT_VER* definitions are moved to a arch-specific xstatver.h file. The internal defines that redirects internals {f}stat{at} to their {f}xstat{at} counterparts are removed for Linux (!NO_RTLD_HIDDEN). Hurd still requires them since {f}stat{at} pulls extra objects that makes the loader build fail otherwise (I haven't dig into why exactly). Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09<sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM supportH.J. Lu
Add Fast Short REP CMP and SCA (FSRCS), Fast Short REP STO (FSRS) and Fast Zero-Length REP MOV (FZLRM) support to <sys/platform/x86.h>.
2020-10-09<sys/platform/x86.h>: Add Intel HRESET supportH.J. Lu
Add Intel HRESET support to <sys/platform/x86.h>.
2020-10-09<sys/platform/x86.h>: Add AVX-VNNI supportH.J. Lu
Add AVX-VNNI support to <sys/platform/x86.h>.
2020-10-09<sys/platform/x86.h>: Add AVX512_FP16 supportH.J. Lu
Add AVX512_FP16 support to <sys/platform/x86.h>.
2020-10-09<sys/platform/x86.h>: Add Intel UINTR supportH.J. Lu
Add Intel UINTR support to <sys/platform/x86.h>.
2020-10-09elf: Do not pass GLRO(dl_platform), GLRO(dl_platformlen) to _dl_important_hwcapsFlorian Weimer
In the current code, the function can easily obtain the information on its own. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-09elf: Enhance ld.so --help to print HWCAP subdirectoriesFlorian Weimer
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-09elf: Add library search path information to ld.so --helpFlorian Weimer
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08sunrpc: Adjust RPC function declarations to match Sun's (bug 26686]Martin Sebor
Building Glibc with the latest GCC 11 shows a number of instances of the new -Warray-parameter warning designed to encourage consistency in the forms of array arguments in redeclarations of the same function (and, ultimately, to enable the detection of out of bounds accesses via such arguments). To avoid the subset of these warnings for the RPC APIs, this patch changes the declarations of these functions to match both their definitions and the Oracle RPC documentation. Besides avoiding the -Warray-parameter warnings the effect of this change is for GCC to issue warnings when either the functions are passed an array with fewer than MAXNETNAMELEN + 1 elements, or when the functions themselves access elements outside the array bounds.
2020-10-08Avoid GCC 11 -Warray-parameter warnings [BZ #26686].Martin Sebor
Building Glibc with the latest GCC 11 also shows a couple of instances of the new -Warray-parameter warning in the thread db APIs. To avoid these, this patch changes the deefinitions of the two functions to match their definitions.
2020-10-08elf: Make __rtld_env_path_list and __rtld_search_dirs global variablesFlorian Weimer
They have been renamed from env_path_list and rtld_search_dirs to avoid linknamespace issues. This change will allow future use these variables in diagnostics. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08elf: Print the full name of the dynamic loader in the ld.so help messageFlorian Weimer
This requires defining a macro for the full path, matching the -Wl,--dynamic-link= arguments used for linking glibc programs, and ldd script. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08elf: Use the term "program interpreter" in the ld.so help messageFlorian Weimer
This is the term that the ELF standard itself uses. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08scripts/update-copyrights: Update csu/version.c, elf/dl-usage.cFlorian Weimer
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08elf: Implement ld.so --versionFlorian Weimer
This prints out version information for the dynamic loader and exits immediately, without further command line processing (which seems to match what some GNU tools do). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08nptl: Add missing cancellation flags on lockfAdhemerval Zanella
It also removes CFLAGS-lockf.c duplicate rule. It fixes nptl/tst-cancelx16 on mips64-linux-gnu.
2020-10-08Update mips64 libm-test-ulpsAdhemerval Zanella
2020-10-08Update alpha libm-test-ulpsAdhemerval Zanella
2020-10-08elf: Implement ld.so --helpFlorian Weimer
--help processing is deferred to the point where the executable has been loaded, so that it is possible to eventually include information from the main executable in the help output. As suggested in the GNU command-line interface guidelines, the help message is printed to standard output, and the exit status is successful. Handle usage errors closer to the GNU command-line interface guidelines. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08elf: Record whether paths come from LD_LIBRARY_PATH or --library-pathFlorian Weimer
This allows more precise LD_DEBUG diagnostics. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08elf: Move ld.so error/help output to _dl_usageFlorian Weimer
Also add a comment to elf/Makefile, explaining why we cannot use config.status for autoconf template processing. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-08elf: Extract command-line/environment variables state from rtld.cFlorian Weimer
Introduce struct dl_main_state and move it to <dl-main.h>. Rename enum mode to enum rtld_mode and add the rtld_mode_ prefix to the enum constants. This avoids the need for putting state that is only needed during startup into the ld.so data segment.
2020-10-08elf: Implement __rtld_malloc_is_completeFlorian Weimer
In some cases, it is difficult to determine the kind of malloc based on the execution context, so a function to determine that is helpful. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>