about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* resolv: Handle transaction ID collisions in parallel queries (bug 26600)Florian Weimer2020-10-143-20/+356
| | | | | | 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.
* support: Provide a way to clear the RA bit in DNS server responsesFlorian Weimer2020-10-142-1/+7
|
* support: Provide a way to reorder responses within the DNS test serverFlorian Weimer2020-10-145-28/+135
|
* Add missing stat/mknod symbol on libc.abilist some ABIsAdhemerval Zanella2020-10-136-0/+36
| | | | | | 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.
* manual: correct the spelling of "MALLOC_PERTURB_" [BZ #23015]Benno Schulenberg2020-10-131-1/+1
| | | | Reported-by: Martin Dorey <martin.dorey@hds.com>
* manual: replace an obsolete collation example with a valid oneBenno Schulenberg2020-10-131-3/+3
| | | | | | | | | | | | | 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.
* rtld: fix typo in commentRolf Eike Beer2020-10-131-1/+1
|
* elf: Add missing <dl-procinfo.h> header to elf/dl-usage.cMatheus Castanho2020-10-121-0/+1
|
* hurd: support clock_gettime(CLOCK_PROCESS/THREAD_CPUTIME_ID)Samuel Thibault2020-10-111-14/+74
| | | | | * sysdeps/mach/clock_gettime.c (__clock_gettime): Add support for CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
* linux: Move xmknod{at} to compat symbolsAdhemerval Zanella2020-10-098-40/+101
| | | | | | | | | | | 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>
* linux: Add {f}stat{at} y2038 supportAdhemerval Zanella2020-10-0914-47/+354
| | | | | | | | | | | | | | | | | | | | 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>
* linux: Move {f}xstat{at} to compat symbolsAdhemerval Zanella2020-10-0921-31/+181
| | | | | | | | | | | 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>
* linux: Disentangle fstatat from fxstatatAdhemerval Zanella2020-10-0926-45/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* linux: Implement {l}fstat{at} in terms of fstatatAdhemerval Zanella2020-10-098-0/+275
| | | | | | | | | | | 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>
* linux: Move the struct stat{64} to struct_stat.hAdhemerval Zanella2020-10-0913-493/+206
| | | | | | | | | | | 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>
* Remove mknod wrapper functions, move them to symbolsAdhemerval Zanella2020-10-0958-172/+132
| | | | | | | | | | | | | | | | | | | 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>
* Remove stat wrapper functions, move them to exported symbolsAdhemerval Zanella2020-10-0967-493/+427
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* <sys/platform/x86.h>: Add FSRCS/FSRS/FZLRM supportH.J. Lu2020-10-094-0/+27
| | | | | 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>.
* <sys/platform/x86.h>: Add Intel HRESET supportH.J. Lu2020-10-093-0/+7
| | | | Add Intel HRESET support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add AVX-VNNI supportH.J. Lu2020-10-094-0/+10
| | | | Add AVX-VNNI support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add AVX512_FP16 supportH.J. Lu2020-10-094-3/+10
| | | | Add AVX512_FP16 support to <sys/platform/x86.h>.
* <sys/platform/x86.h>: Add Intel UINTR supportH.J. Lu2020-10-093-3/+7
| | | | Add Intel UINTR support to <sys/platform/x86.h>.
* elf: Do not pass GLRO(dl_platform), GLRO(dl_platformlen) to _dl_important_hwcapsFlorian Weimer2020-10-093-14/+12
| | | | | | | In the current code, the function can easily obtain the information on its own. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Enhance ld.so --help to print HWCAP subdirectoriesFlorian Weimer2020-10-091-0/+62
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Add library search path information to ld.so --helpFlorian Weimer2020-10-091-0/+56
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sunrpc: Adjust RPC function declarations to match Sun's (bug 26686]Martin Sebor2020-10-082-6/+7
| | | | | | | | | | | | | | | | | 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.
* Avoid GCC 11 -Warray-parameter warnings [BZ #26686].Martin Sebor2020-10-081-2/+2
| | | | | | | | 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.
* elf: Make __rtld_env_path_list and __rtld_search_dirs global variablesFlorian Weimer2020-10-082-26/+31
| | | | | | | | | 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>
* elf: Print the full name of the dynamic loader in the ld.so help messageFlorian Weimer2020-10-082-1/+4
| | | | | | | | 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>
* elf: Use the term "program interpreter" in the ld.so help messageFlorian Weimer2020-10-081-11/+11
| | | | | | This is the term that the ELF standard itself uses. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* scripts/update-copyrights: Update csu/version.c, elf/dl-usage.cFlorian Weimer2020-10-081-0/+6
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Implement ld.so --versionFlorian Weimer2020-10-083-0/+20
| | | | | | | | 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>
* nptl: Add missing cancellation flags on lockfAdhemerval Zanella2020-10-081-2/+2
| | | | | It also removes CFLAGS-lockf.c duplicate rule. It fixes nptl/tst-cancelx16 on mips64-linux-gnu.
* Update mips64 libm-test-ulpsAdhemerval Zanella2020-10-081-1/+1
|
* Update alpha libm-test-ulpsAdhemerval Zanella2020-10-081-1/+1
|
* elf: Implement ld.so --helpFlorian Weimer2020-10-083-13/+75
| | | | | | | | | | | | | | | --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>
* elf: Record whether paths come from LD_LIBRARY_PATH or --library-pathFlorian Weimer2020-10-085-6/+14
| | | | | | This allows more precise LD_DEBUG diagnostics. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Move ld.so error/help output to _dl_usageFlorian Weimer2020-10-084-26/+65
| | | | | | | 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>
* elf: Extract command-line/environment variables state from rtld.cFlorian Weimer2020-10-082-96/+157
| | | | | | | | | 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.
* elf: Implement __rtld_malloc_is_completeFlorian Weimer2020-10-082-0/+12
| | | | | | | | 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>
* __vfscanf_internal: fix aliasing violation (bug 26690)Andreas Schwab2020-10-081-11/+11
| | | | | | | As noted in <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97264>, the cast in the call to the read_int function is an aliasing violation. Change the type of local variable f to a pointer to unsigned, which allows to eliminate most casts while only adding three new ones.
* Revert "Fix missing redirects in testsuite targets"Andreas Schwab2020-10-0810-19/+19
| | | | | This reverts commit d5afb38503. The log files are actually created by the various shell scripts that drive the tests.
* nptl: Add missing cancellation flags on futex_internal and pselect32Adhemerval Zanella2020-10-072-0/+2
| | | | | | | It fixes the tst-cancelx{4,5} and tst-cancel24-{static} regression on some platforms (arm and sparc32). Checked on arm-linux-gnueabihf and sparcv9-linux-gnu.
* elf: Implement _dl_writeFlorian Weimer2020-10-074-1/+93
| | | | | | | | The generic version is parallel to _dl_writev. It cannot use _dl_writev directly because the errno value needs to be obtained under a lock. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Do not search HWCAP subdirectories in statically linked binariesFlorian Weimer2020-10-073-2/+20
| | | | | | | | | This functionality does not seem to be useful since static dlopen is mostly used for iconv/character set conversion and NSS support. gconv modules are loaded with full paths anyway, so that the HWCAP subdirectory logic does not apply. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Require properly configured /dev/pts for PTYsFlorian Weimer2020-10-076-209/+60
| | | | | | | | | | | | | Current systems do not have BSD terminals, so the fallback code in posix_openpt/getpt does not do anything. Also remove the file system check for /dev/pts. Current systems always have a devpts file system mounted there if /dev/ptmx exists. grantpt is now essentially a no-op. It only verifies that the argument is a ptmx-descriptor. Therefore, this change indirectly addresses bug 24941. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: unlockpt needs to fail with EINVAL, not ENOTTY (bug 26053)Florian Weimer2020-10-072-20/+21
| | | | | | | | | | The EINVAL error code is mandated by POSIX and documented in the manual. Also clean up the unlockpt implementation a bit, assuming that TIOCSPTLCK is always defined. Enhance login/tst-grantpt to cover unlockpt corner cases. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* login/tst-grantpt: Convert to support framework, more error checkingFlorian Weimer2020-10-071-35/+58
| | | | | | | | | | The test now requires working /dev/pts pseudo-terminals. A new subtest (test_not_ptmx) attempts to call grantpt on a pseudo-terminal that is not a ptmx device. POSIX requires an EINVAL error in this case. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* posix: Fix -Warray-bounds instances building timer_create [BZ #26687]Adhemerval Zanella2020-10-068-89/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 11 -Warray-bounds triggers invalid warnings when building Linux timer_create.c: ../sysdeps/unix/sysv/linux/timer_create.c: In function '__timer_create_new': ../sysdeps/unix/sysv/linux/timer_create.c:83:17: warning: array subscript 'struct timer[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds] 83 | newp->sigev_notify = (evp != NULL | ^~ ../sysdeps/unix/sysv/linux/timer_create.c:59:47: note: referencing an object of size 8 allocated by 'malloc' 59 | struct timer *newp = (struct timer *) malloc (offsetof (struct timer, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | thrfunc)); | ~~~~~~~~~ The struct allocated for !SIGEV_THREAD timers only requires two 'int' fields (sigev_notify and ktimerid) and the offsetof trick tries minimize the memory usage by only allocation the required size. However, although the resulting size is suffice for !SIGEV_THREAD time, accessing the partially allocated object is error-prone and UB. This patch fixes both issues by embedding the information whether the timer if a SIGEV_THREAD in the returned 'timer_t'. For !SIGEV_THREAD, the resulting 'timer_t' is the returned kernel timer identifer (kernel_timer_t), while for SIGEV_THREAD it uses the fact malloc returns at least _Alignof (max_align_t) pointers plus that valid kernel_timer_t are always positive to set MSB bit of the returned 'timer_t' to indicate the timer handles a SIGEV_THREAD. It allows to remove the memory allocation for !SIGEV_THREAD and also remove the 'sigev_notify' field from 'struct timer'. Checked on x86_64-linux-gnu and i686-linux-gnu.
* Replace Minumum/minumum with Minimum/minimumH.J. Lu2020-10-064-4/+4
| | | | Replace Minumum/minumum in comments with Minimum/minimum.