summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* Regenerate configure.Carlos O'Donell2022-02-031-1/+7
|
* Linux: Use ptrdiff_t for __rseq_offsetFlorian Weimer2022-02-0212-13/+14
| | | | | | | | This matches the data size initial-exec relocations use on most targets. Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* posix: Replace posix_spawnattr_tc{get,set}pgrp_np with ↵Adhemerval Zanella2022-02-0236-92/+57
| | | | | | | | | | | | | | | | | | posix_spawn_file_actions_addtcsetpgrp_np The posix_spawnattr_tcsetpgrp_np works on a file descriptor (the controlling terminal), so it would make more sense to actually fit it on the file actions API. Also, POSIX_SPAWN_TCSETPGROUP is not really required since it is implicit by the presence of tcsetpgrp file action. The posix/tst-spawn6.c is also fixed when TTY can is not present. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* or1k: Define PI_STATIC_AND_HIDDENStafford Horne2022-02-022-0/+9
| | | | | | | | | | | PI_STATIC_AND_HIDDEN means that references to static functions, data and symbols with hidden visibility do not need any run-time relocations after the final link, with the build flags used by glibc. OpenRISC follows this so enabled PI_STATIC_AND_HIDDEN by adding configure.ac and generating configure. Suggested-by: Florian Weimer <fweimer@redhat.com>
* SET_RELHOOK: merge i386 and x86_64, and move to sysdeps/mach/hurd/x86Samuel Thibault2022-02-013-31/+3
| | | | | | | It is not Hurd-specific, but H.J. Lu wants it there. Also, dc.a can be used to avoid hardcoding .long vs .quad and thus use the same implementation for i386 and x86_64.
* elf: Fix runtime linker auditing on aarch64 (BZ #26643)Ben Woodard2022-02-0114-40/+773
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rtld audit support show two problems on aarch64: 1. _dl_runtime_resolve does not preserve x8, the indirect result location register, which might generate wrong result calls depending of the function signature. 2. The NEON Q registers pushed onto the stack by _dl_runtime_resolve were twice the size of D registers extracted from the stack frame by _dl_runtime_profile. While 2. might result in wrong information passed on the PLT tracing, 1. generates wrong runtime behaviour. The aarch64 rtld audit support is changed to: * Both La_aarch64_regs and La_aarch64_retval are expanded to include both x8 and the full sized NEON V registers, as defined by the ABI. * dl_runtime_profile needed to extract registers saved by _dl_runtime_resolve and put them into the new correctly sized La_aarch64_regs structure. * The LAV_CURRENT check is change to only accept new audit modules to avoid the undefined behavior of not save/restore x8. * Different than other architectures, audit modules older than LAV_CURRENT are rejected (both La_aarch64_regs and La_aarch64_retval changed their layout and there are no requirements to support multiple audit interface with the inherent aarch64 issues). * A new field is also reserved on both La_aarch64_regs and La_aarch64_retval to support variant pcs symbols. Similar to x86, a new La_aarch64_vector type to represent the NEON register is added on the La_aarch64_regs (so each type can be accessed directly). Since LAV_CURRENT was already bumped to support bind-now, there is no need to increase it again. Checked on aarch64-linux-gnu. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* elf: Issue la_symbind for bind-now (BZ #23734)Adhemerval Zanella2022-02-015-1/+52
| | | | | | | | | | | | | | | | | | | | | | | The audit symbind callback is not called for binaries built with -Wl,-z,now or when LD_BIND_NOW=1 is used, nor the PLT tracking callbacks (plt_enter and plt_exit) since this would change the expected program semantics (where no PLT is expected) and would have performance implications (such as for BZ#15533). LAV_CURRENT is also bumped to indicate the audit ABI change (where la_symbind flags are set by the loader to indicate no possible PLT trace). To handle powerpc64 ELFv1 function descriptor, _dl_audit_symbind requires to know whether bind-now is used so the symbol value is updated to function text segment instead of the OPD (for lazy binding this is done by PPC64_LOAD_FUNCPTR on _dl_runtime_resolve). Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu, powerpc64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* elf: Fix initial-exec TLS access on audit modules (BZ #28096)Adhemerval Zanella2022-02-011-1/+1
| | | | | | | | | | | | | | | | | For audit modules and dependencies with initial-exec TLS, we can not set the initial TLS image on default loader initialization because it would already be set by the audit setup. However, subsequent thread creation would need to follow the default behaviour. This patch fixes it by setting l_auditing link_map field not only for the audit modules, but also for all its dependencies. This is used on _dl_allocate_tls_init to avoid the static TLS initialization at load time. Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* elf: Add <dl-r_debug.h>H.J. Lu2022-01-312-0/+100
| | | | | | | | Add <dl-r_debug.h> to get the adddress of the r_debug structure after relocation and its offset before relocation from the PT_DYNAMIC segment to support DT_DEBUG, DT_MIPS_RLD_MAP_REL and DT_MIPS_RLD_MAP. Co-developed-by: Xi Ruoyao <xry111@mengyan1223.wang>
* tst-socket-timestamp-compat.c: Check __TIMESIZE [BZ #28837]H.J. Lu2022-01-291-1/+1
| | | | | time_t size is defined by __TIMESIZE, not __WORDSIZE. Check __TIMESIZE, instead of __WORDSIZE, for time_t size. This fixes BZ #28837.
* Linux: Only generate 64 bit timestamps for 64 bit time_t recvmsg/recvmmsgAdhemerval Zanella2022-01-285-24/+322
| | | | | | | | | | | | | | | | | | | | | | | The timestamps created by __convert_scm_timestamps only make sense for 64 bit time_t programs, 32 bit time_t programs will ignore 64 bit time_t timestamps since SO_TIMESTAMP will be defined to old values (either by glibc or kernel headers). Worse, if the buffer is not suffice MSG_CTRUNC is set to indicate it (which breaks some programs [1]). This patch makes only 64 bit time_t recvmsg and recvmmsg to call __convert_scm_timestamps. Also, the assumption to called it is changed from __ASSUME_TIME64_SYSCALLS to __TIMESIZE != 64 since the setsockopt might be called by libraries built without __TIME_BITS=64. The MSG_CTRUNC is only set for the 64 bit symbols, it should happen only if 64 bit time_t programs run older kernels. Checked on x86_64-linux-gnu and i686-linux-gnu. [1] https://github.com/systemd/systemd/pull/20567 Reviewed-by: Florian Weimer <fweimer@redhat.com>
* linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350)Adhemerval Zanella2022-01-284-6/+348
| | | | | | | | | | | | | | | | | | | | The __convert_scm_timestamps only updates the control message last pointer for SOL_SOCKET type, so if the message control buffer contains multiple ancillary message types the converted timestamp one might overwrite a valid message. The test checks if the extra ancillary space is correctly handled by recvmsg/recvmmsg, where if there is no extra space for the 64-bit time_t converted message the control buffer should be marked with MSG_TRUNC. It also check if recvmsg/recvmmsg handle correctly multiple ancillary data. Checked on x86_64-linux and on i686-linux-gnu on both 5.11 and 4.15 kernel. Co-authored-by: Fabian Vogt <fvogt@suse.de> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* Fix glibc 2.34 ABI omission (missing GLIBC_2.34 in dynamic loader)Florian Weimer2022-01-2730-0/+30
| | | | | | | | | | | | | The glibc 2.34 release really should have added a GLIBC_2.34 symbol to the dynamic loader. With it, we could move functions such as dlopen or pthread_key_create that work on process-global state into the dynamic loader (once we have fixed a longstanding issue with static linking). Without the GLIBC_2.34 symbol, yet another new symbol version would be needed because old glibc will fail to load binaries due to the missing symbol version in ld.so that newly linked programs will require. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* x86: Use CHECK_FEATURE_PRESENT to check HLE [BZ #27398]H.J. Lu2022-01-261-1/+1
| | | | | HLE is disabled on blacklisted CPUs. Use CHECK_FEATURE_PRESENT, instead of CHECK_FEATURE_ACTIVE, to check HLE.
* hurd: Add posix_spawnattr_tc{get,set}pgrp_np on libc.abilistAdhemerval Zanella2022-01-261-0/+2
| | | | Commit 342cc934a3bf74ac missed the update-abi for the ABI.
* posix: Add terminal control setting support for posix_spawnAdhemerval Zanella2022-01-2536-1/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there is no proper way to set the controlling terminal through posix_spawn in race free manner [1]. This forces shell implementations to keep using fork+exec when launching background process groups, even when using posix_spawn yields better performance. This patch adds a new GNU extension so the creating process can configure the created process terminal group. This is done with a new flag, POSIX_SPAWN_TCSETPGROUP, along with two new attribute functions: posix_spawnattr_tcsetpgrp_np, and posix_spawnattr_tcgetpgrp_np. The function sets a new attribute, spawn-tcgroupfd, that references to the controlling terminal. The controlling terminal is set after the spawn-pgroup attribute, and uses the spawn-tcgroupfd along with current creating process group (so it is composable with POSIX_SPAWN_SETPGROUP). To create a process and set the controlling terminal, one can use the following sequence: posix_spawnattr_t attr; posix_spawnattr_init (&attr); posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP); posix_spawnattr_tcsetpgrp_np (&attr, tcfd); If the idea is also to create a new process groups: posix_spawnattr_t attr; posix_spawnattr_init (&attr); posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP | POSIX_SPAWN_SETPGROUP); posix_spawnattr_tcsetpgrp_np (&attr, tcfd); posix_spawnattr_setpgroup (&attr, 0); The controlling terminal file descriptor is ignored if the new flag is not set. This interface is slight different than the one provided by QNX [2], which only provides the POSIX_SPAWN_TCSETPGROUP flag. The QNX documentation does not specify how the controlling terminal is obtained nor how it iteracts with POSIX_SPAWN_SETPGROUP. Since a glibc implementation is library based, it is more straightforward and avoid requires additional file descriptor operations to request the caller to setup the controlling terminal file descriptor (and it also allows a bit less error handling by posix_spawn). Checked on x86_64-linux-gnu and i686-linux-gnu. [1] https://github.com/ksh93/ksh/issues/79 [2] https://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/posix_spawn.html Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Linux: Detect user namespace support in io/tst-getcwd-smallbuffFlorian Weimer2022-01-241-0/+18
| | | | | | Otherwise the test fails with certain container runtimes. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)Siddhesh Poyarekar2022-01-243-1/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No valid path returned by getcwd would fit into 1 byte, so reject the size early and return NULL with errno set to ERANGE. This change is prompted by CVE-2021-3999, which describes a single byte buffer underflow and overflow when all of the following conditions are met: - The buffer size (i.e. the second argument of getcwd) is 1 byte - The current working directory is too long - '/' is also mounted on the current working directory Sequence of events: - In sysdeps/unix/sysv/linux/getcwd.c, the syscall returns ENAMETOOLONG because the linux kernel checks for name length before it checks buffer size - The code falls back to the generic getcwd in sysdeps/posix - In the generic func, the buf[0] is set to '\0' on line 250 - this while loop on line 262 is bypassed: while (!(thisdev == rootdev && thisino == rootino)) since the rootfs (/) is bind mounted onto the directory and the flow goes on to line 449, where it puts a '/' in the byte before the buffer. - Finally on line 458, it moves 2 bytes (the underflowed byte and the '\0') to the buf[0] and buf[1], resulting in a 1 byte buffer overflow. - buf is returned on line 469 and errno is not set. This resolves BZ #28769. Reviewed-by: Andreas Schwab <schwab@linux-m68k.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Qualys Security Advisory <qsa@qualys.com> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* htl: Fix cleaning the reply portSamuel Thibault2022-01-221-9/+17
| | | | | | | | | | | | | If any RPC fails, the reply port will already be deallocated. __pthread_thread_terminate thus has to defer taking its name until the very last __thread_terminate_release which doesn't reply a message. But then we have to read from the pthread structure. This introduces __pthread_dealloc_finish() which does the recording of the thread termination, so the slot can be reused really only just before the __thread_terminate_release call. Only the real thread can set it, so let's decouple this from the pthread_state by just removing the PTHREAD_TERMINATED state and add a terminated field.
* mips: Move DT_MIPS into <ldsodefs.h>Florian Weimer2022-01-192-4/+4
| | | | | | | ELF_MACHINE_XHASH_SETUP in that file needs it. Fixes commit c90363403b57b3b7919061851cb3e6d9c85e784a ("elf: Move _dl_setup_hash to its own file").
* x86: Black list more Intel CPUs for TSX [BZ #27398]H.J. Lu2022-01-181-3/+31
| | | | | | | | | | Disable TSX and enable RTM_ALWAYS_ABORT for Intel CPUs listed in: https://www.intel.com/content/www/us/en/support/articles/000059422/processors.html This fixes BZ #27398. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* htl: Fix build error in annexcSamuel Thibault2022-01-171-2/+4
| | | | | | | | | | | We were getting ../scripts/evaluate-test.sh posix/annexc $? true false > /usr/src/glibc-upstream/build/posix/annexc.test-result In file included from ../include/pthread.h:1, from <stdin>:1: ../sysdeps/htl/include/pthread.h:7:62: error: missing binary operator before token "(" 7 | # if defined __USE_EXTERN_INLINES && defined _LIBC && !IS_IN (libsupport) | ^
* x86: use default cache size if it cannot be determined [BZ #28784]Aurelien Jarno2022-01-171-4/+10
| | | | | | | | | | | | | | | | | | | | | | In some cases (e.g QEMU, non-Intel/AMD CPU) the cache information can not be retrieved and the corresponding values are set to 0. Commit 2d651eb9265d ("x86: Move x86 processor cache info to cpu_features") changed the behaviour in such case by defining the __x86_shared_cache_size and __x86_data_cache_size variables to 0 instead of using the default values. This cause an issue with the i686 SSE2 optimized bzero/routine which assumes that the cache size is at least 128 bytes, and otherwise tries to zero/set the whole address space minus 128 bytes. Fix that by restoring the original code to only update __x86_shared_cache_size and __x86_data_cache_size variables if the corresponding cache sizes are not zero. Fixes bug 28784 Fixes commit 2d651eb9265d Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Linux: Add epoll_pwait2 (BZ #27359)Adhemerval Zanella2022-01-1739-1/+338
| | | | | | | | | | | | | It is similar to epoll_wait, with the difference the timeout has nanosecond resoluting by using struct timespec instead of int. Although Linux interface only provides 64 bit time_t support, old 32 bit interface is also provided (so keep in sync with current practice and to no force opt-in on 64 bit time_t). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* elf: Fix 64 time_t support for installed statically binariesAdhemerval Zanella2022-01-171-3/+3
| | | | | | | | | | | | | | The usage of internal static symbol for statically linked binaries does not work correctly for objects built with -D_TIME_BITS=64, since the internal definition does not provide the expected aliases. This patch makes it to use the default stat functions instead (which uses the default 64 time_t alias and types). Checked on i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Revert "elf: Fix 64 time_t support for installed statically binaries"Adhemerval Zanella2022-01-171-3/+3
| | | | This reverts commit 0b8e83eb1455f3c0332eeb1f96fbc262fbd054e0.
* hurd: optimize exec cleanupSamuel Thibault2022-01-161-12/+14
| | | | | When ports are nul we do not need to request their deallocation. It is also useless to look for them in portnames.
* hurd: Add __rtld_execveSamuel Thibault2022-01-152-2/+126
| | | | | It trivially execs with the same dtable, portarray and intarray, and only has to take care of deallocating / destroying ports (file, notably).
* htl: Hide __pthread_attr's __schedparam type [BZ #23088]Samuel Thibault2022-01-156-79/+11
| | | | | | | | | | The content of the structure is only used internally, so we can make __pthread_attr_getschedparam and __pthread_attr_setschedparam convert between the public sched_param type and an internal __sched_param. This allows to avoid to spuriously expose the sched_param type. This fixes BZ #23088.
* htl: Clear kernel_thread field before releasing the thread structureSamuel Thibault2022-01-151-3/+3
| | | | Otherwise this is a use-after-free.
* hurd: Fix timer/clock_getres crash on NULL res parameterSamuel Thibault2022-01-151-2/+5
| | | | POSIX allows res to be NULL.
* hurd: Fix pthread_kill on exiting/ted threadSamuel Thibault2022-01-152-0/+7
| | | | | | We have to drop the kernel_thread port from the thread structure, to avoid pthread_kill's call to _hurd_thread_sigstate trying to reference it and fail.
* [hurd] Drop spurious #ifdef SHAREDSamuel Thibault2022-01-151-2/+0
| | | | The whole file is already #ifdef SHARED
* [hurd] Call _dl_sort_maps_init in _dl_sysdep_startSamuel Thibault2022-01-151-0/+3
| | | | | This follows 15a0c5730d1d ("elf: Fix slow DSO sorting behavior in dynamic loader (BZ #17645)").
* s390x: Use <gcc-macros.h> in early HWCAP checkFlorian Weimer2022-01-141-2/+3
| | | | | | | | This is required so that the checks still work if $(early-cflags) selects a different ISA level. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* x86: Add x86-64-vN check to early startupFlorian Weimer2022-01-142-1/+31
| | | | | | | | This ISA level covers the glibc build itself. <dl-hwcap-check.h> cannot be used because this check (by design) happens before DL_PLATFORM_INIT and the x86 CPU flags initialization. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* powerpc64le: Use <gcc-macros.h> in early HWCAP checkFlorian Weimer2022-01-141-4/+5
| | | | | | | | This is required so that the checks still work if $(early-cflags) selects a different ISA level. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* x86: HAVE_X86_LAHF_SAHF, HAVE_X86_MOVBE and -march=x86-64-vN (bug 28782)Florian Weimer2022-01-142-4/+4
| | | | | | | | | | HAVE_X86_LAHF_SAHF is implied by x86-64-v2, and HAVE_X86_MOVBE by x86-64-v3. The individual flag does not appear in -fverbose-asm flag output even if the ISA level implies it. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* math: Add more inputs to atan2 accuracy tests [BZ #28765]Sunil K Pandey2022-01-141-4/+4
| | | | | | | | | | | | | | | This patch adds following inputs: 0x1.bcab29da0e947p-54 0x1.bc41f4d2294b8p-54 0x1.a11891ec004d4p-348 0x1.814830510be26p-348 0x1.b836ed678be29p-588 0x1.b7be6f5a03a8cp-588 0x1.a83f842ef3f73p-633 0x1.a799d8a6677ep-633 to atan2 tests and updates x86_64 double atan2 ulps. This fixes BZ #28765. Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
* Update syscall lists for Linux 5.16Joseph Myers2022-01-1327-2/+29
| | | | | | | | Linux 5.16 has one new syscall, futex_waitv. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
* i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771)Florian Weimer2022-01-133-251/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The configure check for CAN_USE_REGISTER_ASM_EBP tried to compile a simple function that uses %ebp as an inline assembly operand. If compilation failed, CAN_USE_REGISTER_ASM_EBP was set 0, which eventually had these consequences: (1) %ebx was avoided as an inline assembly operand, with an assembler macro hack to avoid unnecessary register moves. (2) %ebp was avoided as an inline assembly operand, using an out-of-line syscall function for 6-argument system calls. (1) is no longer needed for any GCC version that is supported for building glibc. %ebx can be used directly as a register operand. Therefore, this commit removes the %ebx avoidance completely. This avoids the assembler macro hack, which turns out to be incompatible with the current Systemtap probe macros (which switch to .altmacro unconditionally). (2) is still needed in many build configurations. The existing configure check cannot really capture that because the simple function succeeds to compile, while the full glibc build still fails. Therefore, this commit removes the check, the CAN_USE_REGISTER_ASM_EBP macro, and uses the out-of-line syscall function for 6-argument system calls unconditionally. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* x86_64: Fix SSE4.2 libmvec atan2 function accuracy [BZ #28765]Sunil K Pandey2022-01-121-148/+173
| | | | | | | | | | | | This patch fixes SSE4.2 libmvec atan2 function accuracy for following inputs to less than 4 ulps. {0x1.bcab29da0e947p-54,0x1.bc41f4d2294b8p-54} 4.19888 ulps {0x1.b836ed678be29p-588,0x1.b7be6f5a03a8cp-588} 4.09889 ulps This fixes BZ #28765. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Revert "linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ ↵Adhemerval Zanella2022-01-124-354/+5
| | | | | | #28350)" This reverts commit 21e0f45c7d73df6fe30c77ffcc9f81410e2ee369.
* linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ #28350)Adhemerval Zanella2022-01-124-5/+354
| | | | | | | | | | | | | | | | | | The __convert_scm_timestamps() only updates the control message last pointer for SOL_SOCKET type, so if the message control buffer contains multiple ancillary message types the converted timestamp one might overwrite a valid message. The test check if the extra ancillary space is correctly handled by recvmsg/recvmmsg, where if there is no extra space for the 64-bit time_t converted message the control buffer should be marked with MSG_TRUNC. It also check if recvmsg/recvmmsg handle correctly multiple ancillary data. Checked on x86_64-linux and on i686-linux-gnu on both 5.11 and 4.15 kernel. Co-authored-by: Fabian Vogt <fvogt@suse.de>
* elf: Fix 64 time_t support for installed statically binariesAdhemerval Zanella2022-01-121-3/+3
| | | | | | | | | | | The usage of internal static symbol for statically linked binaries does not work correctly for objects built with -D_TIME_BITS=64, since the internal definition does not provide the expected aliases. This patch makes it to use the default stat functions instead (which uses the default 64 time_t alias and types). Checked on i686-linux-gnu.
* aarch64: Add HWCAP2_ECV from Linux 5.16Szabolcs Nagy2022-01-111-0/+1
| | | | | | Indicates the availability of enhanced counter virtualization extension of armv8.6-a with self-synchronized virtual counter CNTVCTSS_EL0 usable in userspace.
* x86: Fix __wcsncmp_evex in strcmp-evex.S [BZ# 28755]Noah Goldstein2022-01-101-0/+10
| | | | | | | | | | Fixes [BZ# 28755] for wcsncmp by redirecting length >= 2^56 to __wcscmp_evex. For x86_64 this covers the entire address range so any length larger could not possibly be used to bound `s1` or `s2`. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* x86: Fix __wcsncmp_avx2 in strcmp-avx2.S [BZ# 28755]Noah Goldstein2022-01-101-0/+10
| | | | | | | | | | Fixes [BZ# 28755] for wcsncmp by redirecting length >= 2^56 to __wcscmp_avx2. For x86_64 this covers the entire address range so any length larger could not possibly be used to bound `s1` or `s2`. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* math: Fix float conversion regressions with gcc-12 [BZ #28713]Szabolcs Nagy2022-01-107-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converting double precision constants to float is now affected by the runtime dynamic rounding mode instead of being evaluated at compile time with default rounding mode (except static object initializers). This can change the computed result and cause performance regression. The known correctness issues (increased ulp errors) are already fixed, this patch fixes remaining cases of unnecessary runtime conversions. Add float M_* macros to math.h as new GNU extension API. To avoid conversions the new M_* macros are used and instead of casting double literals to float, use float literals (only required if the conversion is inexact). The patch was tested on aarch64 where the following symbols had new spurious conversion instructions that got fixed: __clog10f __gammaf_r_finite@GLIBC_2.17 __j0f_finite@GLIBC_2.17 __j1f_finite@GLIBC_2.17 __jnf_finite@GLIBC_2.17 __kernel_casinhf __lgamma_negf __log1pf __y0f_finite@GLIBC_2.17 __y1f_finite@GLIBC_2.17 cacosf cacoshf casinhf catanf catanhf clogf gammaf_positive Fixes bug 28713. Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
* Restore ENTRY_POINT definition on hppa, ia64 (bug 28749)Florian Weimer2022-01-072-0/+16
| | | | | ENTRY_POINT is still needed for elf/rtld.c. Fixes commit 4fb4e7e821e3 ("csu: Always use __executable_start in gmon-start.c").