]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
2 years agomath: Add more input to atanh accuracy tests
Sunil K Pandey [Tue, 15 Feb 2022 20:51:46 +0000 (12:51 -0800)] 
math: Add more input to atanh accuracy tests

This patch adds following input to atanh accuracy test.

    0x1.f80094p-8

Tested on x86-64 and i686 platforms.
Other platforms may have to regenerate ulps file.

Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2 years agoresolv: Fix tst-resolv tests for 2.35 ABIs and later
Stafford Horne [Fri, 11 Feb 2022 23:17:55 +0000 (08:17 +0900)] 
resolv: Fix tst-resolv tests for 2.35 ABIs and later

The commit 737e873b30 ("resolv: Do not build libanl.so for ABIs starting
at 2.35") disabled building libanl for ports supporting only 2.35 and
later like OpenRISC.

However, the if statement was not updated quite correctly and the change
ends up disabling many tst-resolv* tests.  This was not supposed to be
done and it causes test dependency errors like:

     make: Entering directory 'gnu-home/glibc/resolv'
     make: *** No rule to make target 'gnu-home/build-glibc/resolv/tst-resolv-res_ninit.out', needed by 'gnu-home/build-glibc/resolv/mtrace-tst-resolv-res_ninit.out'. Stop.
     make: Leaving directory 'gnu-home/glibc/resolv'

This patch move the extra-libs += libanl definition and condition down
to be closer to other libanl definitions.  The $(have-GLIBC_2.34)
condition now includes libanl-routines and libanl-shared-only-routines as
well.

Also, I have added a comment to endif of $(have-thread-library) to help
show the bondary of the have-thread-library definitions.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agox86_64: Disable libmvec tests if multiarch not enabled [BZ# 28869]
Sunil K Pandey [Wed, 23 Feb 2022 16:43:45 +0000 (08:43 -0800)] 
x86_64: Disable libmvec tests if multiarch not enabled [BZ# 28869]

This patch disable libmvec math tests if multiarch not enabled.

This fixes [BZ# 28869]

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agobenchtests: Add benches for memset with 0 value
H.J. Lu [Wed, 9 Feb 2022 15:31:41 +0000 (07:31 -0800)] 
benchtests: Add benches for memset with 0 value

memset with zero as the value to set is by far the majority value (99%+
for Python3 and GCC).  Add bench-memset-zero-large.c,
bench-memset-zero-walk.c and bench-memset-zero.c to measure memset
implementations for zeroing.

Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2 years agoi686: Remove bzero optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 17:55:44 +0000 (14:55 -0300)] 
i686: Remove bzero optimizations

The symbol is not present in current POSIX specification and compiler
already generates memset call.

2 years agos390: Remove bzero optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 17:47:17 +0000 (14:47 -0300)] 
s390: Remove bzero optimizations

The symbol is not present in current POSIX specification and compiler
already generates memset call.

2 years agopowerpc: Remove powerpc64 bzero optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 17:18:28 +0000 (14:18 -0300)] 
powerpc: Remove powerpc64 bzero optimizations

The symbol is not present in current POSIX specification and compiler
already generates memset call.

2 years agopowerpc: Remove powerpc32 bzero optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 16:58:34 +0000 (13:58 -0300)] 
powerpc: Remove powerpc32 bzero optimizations

The symbol is not present in current POSIX specification and compiler
already generates memset call.

2 years agosparc: Remove bzero optimization
Adhemerval Zanella [Thu, 10 Feb 2022 15:51:24 +0000 (12:51 -0300)] 
sparc: Remove bzero optimization

The symbol is not present in current POSIX specification and compiler
already generates memset call.

2 years agoia64: Remove bzero optimization
Adhemerval Zanella [Thu, 10 Feb 2022 14:31:03 +0000 (11:31 -0300)] 
ia64: Remove bzero optimization

The symbol is not present current POSIX specification and compiler
already generates memset call.  The arch specific implementation
is just to avoid the __bzero symbol creation (which ia64 abi does
not export).

2 years agoalpha: Remove bzero optimization
Adhemerval Zanella [Thu, 10 Feb 2022 14:28:45 +0000 (11:28 -0300)] 
alpha: Remove bzero optimization

The symbols is not present in current POSIX specification and compiler
already generates memmove call.

2 years agox86_64: Remove bcopy optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 14:23:24 +0000 (11:23 -0300)] 
x86_64: Remove bcopy optimizations

The symbols is not present in current POSIX specification and compiler
already generates memmove call.

2 years agoi386: Remove bcopy optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 14:20:54 +0000 (11:20 -0300)] 
i386: Remove bcopy optimizations

The symbols is not present in current POSIX specification and compiler
already generates memmove call.

2 years agopowerpc: Remove bcopy optimizations
Adhemerval Zanella [Thu, 10 Feb 2022 14:08:59 +0000 (11:08 -0300)] 
powerpc: Remove bcopy optimizations

The symbols is not present in current POSIX specification and compiler
already generates memmove call.

2 years agoia64: Remove bcopy
Adhemerval Zanella [Thu, 10 Feb 2022 13:44:23 +0000 (10:44 -0300)] 
ia64: Remove bcopy

It just call memmove as the generic implementation.

2 years agohppa: Fix warnings from _dl_lookup_address
John David Anglin [Tue, 22 Feb 2022 18:51:35 +0000 (18:51 +0000)] 
hppa: Fix warnings from _dl_lookup_address

This change fixes two warnings from _dl_lookup_address.

The first warning comes from dropping the volatile keyword from
desc in the call to _dl_read_access_allowed.  We now have a full
atomic barrier between loading desc[0] and the access check, so
desc no longer needs to be declared as volatile.

The second warning comes from the implicit declaration of
_dl_fix_reloc_arg.  This is fixed by including dl-runtime.h and
declaring _dl_fix_reloc_arg in dl-runtime.h.

2 years agohppa: Revise gettext trampoline design
John David Anglin [Tue, 22 Feb 2022 17:28:46 +0000 (17:28 +0000)] 
hppa: Revise gettext trampoline design

The current getcontext return trampoline is overly complex and it
unnecessarily clobbers several registers.  By saving the context
pointer (r26) in the context, __getcontext_ret can restore any
registers not restored by setcontext.  This allows getcontext to
save and restore the entire register context present when getcontext
is entered.  We use the unused oR0 context slot for the return
from __getcontext_ret.

While this is not directly useful in C, it can be exploited in
assembly code.  Registers r20, r23, r24 and r25 are not clobbered
in the call path to getcontext.  This allows a small simplification
of swapcontext.

It also allows saving and restoring the 6-bit SAR register in the
LSB of the oSAR context slot.  The getcontext flag value can be
stored in the MSB of the oSAR slot.

2 years agoAdd SOL_MPTCP, SOL_MCTP from Linux 5.16 to bits/socket.h
Joseph Myers [Mon, 21 Feb 2022 22:49:36 +0000 (22:49 +0000)] 
Add SOL_MPTCP, SOL_MCTP from Linux 5.16 to bits/socket.h

Linux 5.16 adds constants SOL_MPTCP and SOL_MCTP to the getsockopt /
setsockopt levels; add these constants to bits/socket.h.

Tested for x86_64.

2 years agoelf: Check invalid hole in PT_LOAD segments [BZ #28838]
H.J. Lu [Tue, 15 Feb 2022 14:57:11 +0000 (06:57 -0800)] 
elf: Check invalid hole in PT_LOAD segments [BZ #28838]

Changes in v2:

1. Update commit log.

commit 163f625cf9becbb82dfec63a29e566324129c0cd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Dec 21 12:35:47 2021 -0800

    elf: Remove excessive p_align check on PT_LOAD segments [BZ #28688]

removed the p_align check against the page size.  It caused the loader
error or crash on elf/tst-p_align3 when loading elf/tst-p_alignmod3.so,
which has the invalid p_align in PT_LOAD segments, added by

commit d8d94863ef125a392b929732b37e07dc927fbcd1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Dec 21 13:42:28 2021 -0800

The loader failure caused by a negative length passed to __mprotect is
random, depending on architecture and toolchain.  Update _dl_map_segments
to detect invalid holes.  This fixes BZ #28838.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 years agorealpath: Do not copy result on failure (BZ #28815)
Siddhesh Poyarekar [Mon, 21 Feb 2022 02:56:06 +0000 (08:26 +0530)] 
realpath: Do not copy result on failure (BZ #28815)

On failure, the contents of the resolved buffer passed in by the caller
to realpath are undefined.  Do not copy any partial resolution to the
buffer and also do not test resolved contents in test-canon.c.

Resolves: BZ #28815

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agox86: Fix TEST_NAME to make it a string in tst-strncmp-rtm.c
Noah Goldstein [Fri, 18 Feb 2022 23:00:25 +0000 (17:00 -0600)] 
x86: Fix TEST_NAME to make it a string in tst-strncmp-rtm.c

Previously TEST_NAME was passing a function pointer. This didn't fail
because of the -Wno-error flag (to allow for overflow sizes passed
to strncmp/wcsncmp)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86: Test wcscmp RTM in the wcsncmp overflow case [BZ #28896]
Noah Goldstein [Fri, 18 Feb 2022 20:19:15 +0000 (14:19 -0600)] 
x86: Test wcscmp RTM in the wcsncmp overflow case [BZ #28896]

In the overflow fallback strncmp-avx2-rtm and wcsncmp-avx2-rtm would
call strcmp-avx2 and wcscmp-avx2 respectively. This would have
not checks around vzeroupper and would trigger spurious
aborts. This commit fixes that.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass on
AVX2 machines with and without RTM.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agohppa: Fix swapcontext
John David Anglin [Fri, 18 Feb 2022 20:38:25 +0000 (20:38 +0000)] 
hppa: Fix swapcontext

This change fixes the failure of stdlib/tst-setcontext2 and
stdlib/tst-setcontext7 on hppa.  The implementation of swapcontext
in C is broken.  C saves the return pointer (rp) and any non
call-clobbered registers (in this case r3, r4 and r5) on the
stack.  However, the setcontext call in swapcontext pops the
stack and subsequent calls clobber the saved registers.  When
the context in oucp is restored, both tests fault.

Here we rewrite swapcontext in assembly code to avoid using
the stack for register values that need to be used after
restoration.  The getcontext and setcontext routines are
revised to save and restore register ret1 for normal returns.
We copy the oucp pointer to ret1.  This allows access to
the old context after calling getcontext and setcontext.

2 years agox86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #28896]
Noah Goldstein [Tue, 15 Feb 2022 14:18:15 +0000 (08:18 -0600)] 
x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #28896]

In the overflow fallback strncmp-avx2-rtm and wcsncmp-avx2-rtm would
call strcmp-avx2 and wcscmp-avx2 respectively. This would have
not checks around vzeroupper and would trigger spurious
aborts. This commit fixes that.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass on
AVX2 machines with and without RTM.

Co-authored-by: H.J. Lu <hjl.tools@gmail.com>
2 years agostring: Add a testcase for wcsncmp with SIZE_MAX [BZ #28755]
H.J. Lu [Thu, 17 Feb 2022 16:10:35 +0000 (08:10 -0800)] 
string: Add a testcase for wcsncmp with SIZE_MAX [BZ #28755]

Verify that wcsncmp (L("abc"), L("abd"), SIZE_MAX) == 0.  The new test
fails without

commit ddf0992cf57a93200e0c782e2a94d0733a5a0b87
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Sun Jan 9 16:02:21 2022 -0600

    x86: Fix __wcsncmp_avx2 in strcmp-avx2.S [BZ# 28755]

and

commit 7e08db3359c86c94918feb33a1182cd0ff3bb10b
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Sun Jan 9 16:02:28 2022 -0600

    x86: Fix __wcsncmp_evex in strcmp-evex.S [BZ# 28755]

This is for BZ #28755.

Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2 years agomicroblaze: Use the correct select syscall (BZ #28883)
Adhemerval Zanella [Wed, 16 Feb 2022 16:51:42 +0000 (13:51 -0300)] 
microblaze: Use the correct select syscall (BZ #28883)

On Microblaze only __NR_newselect is implemented, even though kernel
advertise __NR_select on asm/unistd.h.  Since microblaze is the
only architecture that undef __ASSUME_PSELECT, the generic code
change is simpler than chaging the architecture syscall number.

Acked-by: Mark Hatle <mark.hatle@xilinx.com>
2 years agoUpdate kernel version to 5.16 in tst-mman-consts.py
Joseph Myers [Wed, 16 Feb 2022 14:19:24 +0000 (14:19 +0000)] 
Update kernel version to 5.16 in tst-mman-consts.py

This patch updates the kernel version in the test tst-mman-consts.py
to 5.16.  (There are no new MAP_* constants covered by this test in
5.16 that need any other header changes.)

Tested with build-many-glibcs.py.

2 years agopthread: Use 64 bit time_t stat internally for sem_open (BZ #28880)
Adhemerval Zanella [Fri, 11 Feb 2022 12:29:08 +0000 (09:29 -0300)] 
pthread: Use 64 bit time_t stat internally for sem_open (BZ #28880)

The __sem_check_add_mapping internal stat calls fails with
EOVERFLOW if system time is larger than 32 bit.

It is a missing spot from 52a5fe70a2c fix to use 64 bit stat
internally.

Checked on x86_64-linux-gnu and i686-linux-gnu.

2 years agox86: Fix bug in strncmp-evex and strncmp-avx2 [BZ #28895]
Noah Goldstein [Wed, 16 Feb 2022 02:27:21 +0000 (20:27 -0600)] 
x86: Fix bug in strncmp-evex and strncmp-avx2 [BZ #28895]

Logic can read before the start of `s1` / `s2` if both `s1` and `s2`
are near the start of a page. To avoid having the result contimated by
these comparisons the `strcmp` variants would mask off these
comparisons. This was missing in the `strncmp` variants causing
the bug. This commit adds the masking to `strncmp` so that out of
range comparisons don't affect the result.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass as
well a full xcheck on x86_64 linux.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agoString: Strength memset tests in test-memset.c
Noah Goldstein [Mon, 14 Feb 2022 01:40:37 +0000 (19:40 -0600)] 
String: Strength memset tests in test-memset.c

The prior sentinel logic was broken and was checking the SIMPLE_MEMSET
as opposed to the tested implementation. As well `s` (the test buffer)
was not reset between implementation tests so it was possible for a
buggy implementation to be hidden by a previously executed correct
one.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2 years agox86-64: Define __memcmpeq in ld.so
H.J. Lu [Mon, 14 Feb 2022 02:46:23 +0000 (18:46 -0800)] 
x86-64: Define __memcmpeq in ld.so

Define __memcmpeq in ld.so so that compiler can generate __memcmpeq call
when compiling for ld.so.

2 years agohtl: Destroy thread-specific data before releasing joins
Samuel Thibault [Mon, 14 Feb 2022 00:39:35 +0000 (01:39 +0100)] 
htl: Destroy thread-specific data before releasing joins

Applications may want to assume that after pthread_join() returns, all
thread-specific data has been released.

2 years agohtl: Fix initializing the key lock
Samuel Thibault [Mon, 14 Feb 2022 00:38:03 +0000 (01:38 +0100)] 
htl: Fix initializing the key lock

The static pthread_once_t in the pt-key.h header was creating one
pthread_once_t per includer.  We have to use a shared common
pthread_once_t instead.

2 years agomach: Fix LLL_SHARED value
Samuel Thibault [Sun, 13 Feb 2022 23:47:18 +0000 (00:47 +0100)] 
mach: Fix LLL_SHARED value

Mach defines GSYNC_SHARED, not SYNC_SHARED.

2 years agohtl: Make pthread_[gs]etspecific not check for key validity
Samuel Thibault [Sun, 13 Feb 2022 23:15:13 +0000 (00:15 +0100)] 
htl: Make pthread_[gs]etspecific not check for key validity

Since __pthread_key_create might be concurrently reallocating the
__pthread_key_destructors array, it's not safe to access it without the
mutex held. Posix explicitly says we are allowed to prefer performance
over error detection.

2 years agox86-64: Remove bzero weak alias in SS2 memset
H.J. Lu [Thu, 10 Feb 2022 19:52:50 +0000 (11:52 -0800)] 
x86-64: Remove bzero weak alias in SS2 memset

commit 3d9f171bfb5325bd5f427e9fc386453358c6e840
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 7 05:55:15 2022 -0800

    x86-64: Optimize bzero

added the optimized bzero.  Remove bzero weak alias in SS2 memset to
avoid undefined __bzero in memset-sse2-unaligned-erms.

2 years agohppa: Fix typo
John David Anglin [Mon, 14 Feb 2022 17:41:59 +0000 (17:41 +0000)] 
hppa: Fix typo

2 years agolinux: Use socket-constants-time64.h on tst-socket-timestamp-compat
Adhemerval Zanella [Mon, 14 Feb 2022 13:35:30 +0000 (10:35 -0300)] 
linux: Use socket-constants-time64.h on tst-socket-timestamp-compat

The kernel header might not define the SO_TIMESTAMP{NS}_OLD or
SO_TIMESTAMP{NS}_NEW if it older than v5.1.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2 years agox86/configure.ac: Define PI_STATIC_AND_HIDDEN/SUPPORT_STATIC_PIE
H.J. Lu [Mon, 7 Feb 2022 22:11:42 +0000 (14:11 -0800)] 
x86/configure.ac: Define PI_STATIC_AND_HIDDEN/SUPPORT_STATIC_PIE

Move PI_STATIC_AND_HIDDEN and SUPPORT_STATIC_PIE to
sysdeps/x86/configure.ac.

2 years agoFix elf/tst-audit2 on hppa
John David Anglin [Mon, 14 Feb 2022 15:14:49 +0000 (15:14 +0000)] 
Fix elf/tst-audit2 on hppa

The test elf/tst-audit2 fails on hppa with a segmentation fault in the
long branch stub used to call malloc from calloc.  This occurs because
the test is not a PIC executable and calloc is called from the dynamic
linker before the dp register is initialized in _dl_start_user.

The fix is to move the dp register initialization into
elf_machine_runtime_setup.  Since the address of $global$ can't be
loaded directly, we continue to use the DT_PLTGOT value from the
the main_map to initialize dp.

2 years agox86: Use CHECK_FEATURE_PRESENT on PCONFIG
H.J. Lu [Wed, 26 Jan 2022 20:18:30 +0000 (12:18 -0800)] 
x86: Use CHECK_FEATURE_PRESENT on PCONFIG

PCONFIG is a privileged instruction.  Use CHECK_FEATURE_PRESENT, instead
of CHECK_FEATURE_ACTIVE, on PCONFIG in tst-cpu-features-supports.c.

2 years agox86: Don't check PTWRITE in tst-cpu-features-cpuinfo.c
H.J. Lu [Wed, 26 Jan 2022 20:18:21 +0000 (12:18 -0800)] 
x86: Don't check PTWRITE in tst-cpu-features-cpuinfo.c

Don't check PTWRITE against /proc/cpuinfo since kernel doesn't report
PTWRITE in /proc/cpuinfo.

2 years agox86: Set .text section in memset-vec-unaligned-erms
Noah Goldstein [Sat, 12 Feb 2022 06:45:00 +0000 (00:45 -0600)] 
x86: Set .text section in memset-vec-unaligned-erms

commit 3d9f171bfb5325bd5f427e9fc386453358c6e840
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 7 05:55:15 2022 -0800

    x86-64: Optimize bzero

Remove setting the .text section for the code. This commit
adds that back.

2 years agoLinux: Include <dl-auxv.h> in dl-sysdep.c only for SHARED
Florian Weimer [Fri, 11 Feb 2022 18:03:04 +0000 (19:03 +0100)] 
Linux: Include <dl-auxv.h> in dl-sysdep.c only for SHARED

Otherwise, <dl-auxv.h> on POWER ends up being included twice,
once in dl-sysdep.c, once in dl-support.c.  That leads to a linker
failure due to multiple definitions of _dl_cache_line_size.

Fixes commit d96d2995c1121d3310102afda2deb1f35761b5e6
("Revert "Linux: Consolidate auxiliary vector parsing").

2 years agoRevert "Linux: Consolidate auxiliary vector parsing"
Florian Weimer [Fri, 11 Feb 2022 15:01:19 +0000 (16:01 +0100)] 
Revert "Linux: Consolidate auxiliary vector parsing"

This reverts commit 8c8510ab2790039e58995ef3a22309582413d3ff.  The
revert is not perfect because the commit included a bug fix for
_dl_sysdep_start with an empty argv, introduced in commit
2d47fa68628e831a692cba8fc9050cef435afc5e ("Linux: Remove
DL_FIND_ARG_COMPONENTS"), and this bug fix is kept.

The revert is necessary because the reverted commit introduced an
early memset call on aarch64, which leads to crash due to lack of TCB
initialization.

2 years agoString: Ensure 'MIN_PAGE_SIZE' is multiple of 'getpagesize'
Noah Goldstein [Tue, 8 Feb 2022 21:24:59 +0000 (15:24 -0600)] 
String: Ensure 'MIN_PAGE_SIZE' is multiple of 'getpagesize'

When 'TEST_LEN' was defined as (4096 * 3) the allocation size Would
not be a multiple of system page size if system page size > 4096.

2 years agoUse binutils 2.38 branch in build-many-glibcs.py
Joseph Myers [Thu, 10 Feb 2022 15:52:21 +0000 (15:52 +0000)] 
Use binutils 2.38 branch in build-many-glibcs.py

This patch makes build-many-glibcs.py use binutils 2.38 branch.

Tested with build-many-glibcs.py (compilers and glibcs builds).

2 years agoelf: Remove LD_USE_LOAD_BIAS
Adhemerval Zanella [Thu, 13 Jan 2022 21:04:49 +0000 (18:04 -0300)] 
elf: Remove LD_USE_LOAD_BIAS

It is solely for prelink with PIE executables [1].

[1] https://sourceware.org/legacy-ml/libc-hacker/2003-11/msg00127.html

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2 years agomalloc: Remove LD_TRACE_PRELINKING usage from mtrace
Adhemerval Zanella [Fri, 21 Jan 2022 13:20:50 +0000 (10:20 -0300)] 
malloc: Remove LD_TRACE_PRELINKING usage from mtrace

The fix for BZ#22716 replacde LD_TRACE_LOADED_OBJECTS with
LD_TRACE_PRELINKING so mtrace could record executable address
position.

To provide the same information, LD_TRACE_LOADED_OBJECTS is
extended where a value or '2' also prints the executable address
as well.  It avoid adding another loader environment variable
to be used solely for mtrace.  The vDSO will be printed as
a default library (with '=>' pointing the same name), which is
ok since both mtrace and ldd already handles it.

The mtrace script is changed to also parse the new format.  To
correctly support PIE and non-PIE executables, both the default
mtrace address and the one calculated as used (it fixes mtrace
for non-PIE exectuable as for BZ#22716 for PIE).

Checked on x86_64-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2 years agoelf: Remove prelink support
Adhemerval Zanella [Thu, 13 Jan 2022 20:58:00 +0000 (17:58 -0300)] 
elf: Remove prelink support

Prelinked binaries and libraries still work, the dynamic tags
DT_GNU_PRELINKED, DT_GNU_LIBLIST, DT_GNU_CONFLICT just ignored
(meaning the process is reallocated as default).

The loader environment variable TRACE_PRELINKING is also removed,
since it used solely on prelink.

Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2 years agoLinux: Consolidate auxiliary vector parsing
Florian Weimer [Thu, 3 Feb 2022 09:58:59 +0000 (10:58 +0100)] 
Linux: Consolidate auxiliary vector parsing

And optimize it slightly.

The large switch statement in _dl_sysdep_start can be replaced with
a large array.  This reduces source code and binary size.  On
i686-linux-gnu:

Before:

   text    data     bss     dec     hex filename
   7791      12       0    7803    1e7b elf/dl-sysdep.os

After:

   text    data     bss     dec     hex filename
   7135      12       0    7147    1beb elf/dl-sysdep.os

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agoLinux: Assume that NEED_DL_SYSINFO_DSO is always defined
Florian Weimer [Thu, 3 Feb 2022 09:58:59 +0000 (10:58 +0100)] 
Linux: Assume that NEED_DL_SYSINFO_DSO is always defined

The definition itself is still needed for generic code.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agoLinux: Remove DL_FIND_ARG_COMPONENTS
Florian Weimer [Thu, 3 Feb 2022 09:58:59 +0000 (10:58 +0100)] 
Linux: Remove DL_FIND_ARG_COMPONENTS

The generic definition is always used since the Native Client
port has been removed.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agoLinux: Remove HAVE_AUX_SECURE, HAVE_AUX_XID, HAVE_AUX_PAGESIZE
Florian Weimer [Thu, 3 Feb 2022 09:58:59 +0000 (10:58 +0100)] 
Linux: Remove HAVE_AUX_SECURE, HAVE_AUX_XID, HAVE_AUX_PAGESIZE

They are always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agoelf: Merge dl-sysdep.c into the Linux version
Florian Weimer [Thu, 3 Feb 2022 09:58:59 +0000 (10:58 +0100)] 
elf: Merge dl-sysdep.c into the Linux version

The generic version is the de-facto Linux implementation.  It
requires an auxiliary vector, so Hurd does not use it.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agohppa: Fix bind-now audit (BZ #28857)
Adhemerval Zanella [Fri, 4 Feb 2022 18:54:59 +0000 (15:54 -0300)] 
hppa: Fix bind-now audit (BZ #28857)

On hppa, a function pointer returned by la_symbind is actually a function
descriptor has the plabel bit set (bit 30).  This must be cleared to get
the actual address of the descriptor.  If the descriptor has been bound,
the first word of the descriptor is the physical address of theA function,
otherwise, the first word of the descriptor points to a trampoline in the
PLT.

This patch also adds a workaround on tests because on hppa (and it seems
to be the only ABI I have see it), some shared library adds a dynamic PLT
relocation to am empty symbol name:

$ readelf -r elf/tst-audit25mod1.so
[...]
Relocation section '.rela.plt' at offset 0x464 contains 6 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00002008  00000081 R_PARISC_IPLT                508
[...]

It breaks some assumptions on the test, where a symbol with an empty
name ("") is passed on la_symbind.

Checked on x86_64-linux-gnu and hppa-linux-gnu.

2 years agox86-64: Optimize bzero
H.J. Lu [Mon, 7 Feb 2022 13:55:15 +0000 (05:55 -0800)] 
x86-64: Optimize bzero

memset with zero as the value to set is by far the majority value (99%+
for Python3 and GCC).

bzero can be slightly more optimized for this case by using a zero-idiom
xor for broadcasting the set value to a register (vector or GPR).

Co-developed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agobenchtests: Add benches for bzero
H.J. Lu [Mon, 7 Feb 2022 15:10:05 +0000 (07:10 -0800)] 
benchtests: Add benches for bzero

Add bench-bzero-large.c, bench-bzero-walk.c and bench-bzero.c.

2 years agolinux: fix accuracy of get_nprocs and get_nprocs_conf [BZ #28865]
Dmitry V. Levin [Sat, 5 Feb 2022 08:00:00 +0000 (08:00 +0000)] 
linux: fix accuracy of get_nprocs and get_nprocs_conf [BZ #28865]

get_nprocs() and get_nprocs_conf() use various methods to obtain an
accurate number of processors.  Re-introduce __get_nprocs_sched() as
a source of information, and fix the order in which these methods are
used to return the most accurate information.  The primary source of
information used in both functions remains unchanged.

This also changes __get_nprocs_sched() error return value from 2 to 0,
but all its users are already prepared to handle that.

Old fallback order:
  get_nprocs:
    /sys/devices/system/cpu/online -> /proc/stat -> 2
  get_nprocs_conf:
    /sys/devices/system/cpu/ -> /proc/stat -> 2

New fallback order:
  get_nprocs:
    /sys/devices/system/cpu/online -> /proc/stat -> sched_getaffinity -> 2
  get_nprocs_conf:
    /sys/devices/system/cpu/ -> /proc/stat -> sched_getaffinity -> 2

Fixes: 342298278e ("linux: Revert the use of sched_getaffinity on get_nproc")
Closes: BZ #28865
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 years agox86: Remove SSSE3 instruction for broadcast in memset.S (SSE2 Only)
Noah Goldstein [Mon, 7 Feb 2022 06:32:23 +0000 (00:32 -0600)] 
x86: Remove SSSE3 instruction for broadcast in memset.S (SSE2 Only)

commit b62ace2740a106222e124cc86956448fa07abf4d
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Sun Feb 6 00:54:18 2022 -0600

    x86: Improve vec generation in memset-vec-unaligned-erms.S

Revert usage of 'pshufb' in broadcast logic as it is an SSSE3
instruction and memset.S is restricted to only SSE2 instructions.

2 years agobenchtests: Sort benches in Makefile
H.J. Lu [Mon, 7 Feb 2022 14:37:39 +0000 (06:37 -0800)] 
benchtests: Sort benches in Makefile

Put one bench per line and sort them.

2 years agoBenchtests: Add length zero benchmark for memset in bench-memset.c
Noah Goldstein [Sun, 6 Feb 2022 05:51:07 +0000 (23:51 -0600)] 
Benchtests: Add length zero benchmark for memset in bench-memset.c

Zero is a relevant size for some workloads (roughly 5% of uses for
GCC) so we should be testing it's performance as well.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86: Improve vec generation in memset-vec-unaligned-erms.S
Noah Goldstein [Sun, 6 Feb 2022 06:54:18 +0000 (00:54 -0600)] 
x86: Improve vec generation in memset-vec-unaligned-erms.S

No bug.

Split vec generation into multiple steps. This allows the
broadcast in AVX2 to use 'xmm' registers for the L(less_vec)
case. This saves an expensive lane-cross instruction and removes
the need for 'vzeroupper'.

For SSE2 replace 2x 'punpck' instructions with zero-idiom 'pxor' for
byte broadcast.

Results for memset-avx2 small (geomean of N = 20 benchset runs).

size, New Time, Old Time, New / Old
   0,    4.100,    3.831,     0.934
   1,    5.074,    4.399,     0.867
   2,    4.433,    4.411,     0.995
   4,    4.487,    4.415,     0.984
   8,    4.454,    4.396,     0.987
  16,    4.502,    4.443,     0.987

All relevant string/wcsmbs tests are passing.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector tan/tanf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:35:48 +0000 (11:35 -0800)] 
x86-64: Add vector tan/tanf to libmvec microbenchmark

Add vector tan/tanf and input files to libmvec microbenchmark.

libmvec-tan-inputs:
  90% Normal random distribution
  range: (-DBL_MAX, DBL_MAX)
  mean: 0.0
  sigma: 5.0
  10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-tanf-inputs:
  90% Normal random distribution
  range: (-FLT_MAX, FLT_MAX)
  mean: 0.0f
  sigma: 5.0f
  10% uniform random distribution in range (-1000.0f, 1000.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector erfc/erfcf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:30:58 +0000 (11:30 -0800)] 
x86-64: Add vector erfc/erfcf to libmvec microbenchmark

Add vector erfc/erfcf and input files to libmvec microbenchmark.

libmvec-erfc-inputs:
  90% Normal random distribution
  range: (-6.0, 6.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-5.9, 5.9)

libmvec-erfcf-inputs:
  90% Normal random distribution
  range: (-4.0f, 4.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-3.9f, 3.9f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector asinh/asinhf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:26:16 +0000 (11:26 -0800)] 
x86-64: Add vector asinh/asinhf to libmvec microbenchmark

Add vector asinh/asinhf and input files to libmvec microbenchmark.

libmvec-asinh-inputs:
  90% Normal random distribution
  range: (-DBL_MAX, DBL_MAX)
  mean: 0.0
  sigma: 2.0
  10% uniform random distribution in range (-1.0e6, 1.0e6)

libmvec-asinhf-inputs:
  90% Normal random distribution
  range: (-FLT_MAX, FLT_MAX)
  mean: 0.0f
  sigma: 2.0f
  10% uniform random distribution in range (-1.0e6f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector tanh/tanhf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:21:36 +0000 (11:21 -0800)] 
x86-64: Add vector tanh/tanhf to libmvec microbenchmark

Add vector tanh/tanhf and input files to libmvec microbenchmark.

libmvec-tanh-inputs:
  90% Normal random distribution
  range: (-19.0, 19.0)
  mean: 0.0
  sigma: 2.0
  10% uniform random distribution in range (-16.0, 16.0)

libmvec-tanhf-inputs:
  90% Normal random distribution
  range: (-10.0f, 10.0f)
  mean: 0.0f
  sigma: 2.0f
  10% uniform random distribution in range (-8.0f, 8.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector erf/erff to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:16:54 +0000 (11:16 -0800)] 
x86-64: Add vector erf/erff to libmvec microbenchmark

Add vector erf/erff and input files to libmvec microbenchmark.

libmvec-erf-inputs:
  90% Normal random distribution
  range: (-6.0, 6.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-5.9, 5.9)

libmvec-erff-inputs:
  90% Normal random distribution
  range: (-4.0f, 4.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-3.9f, 3.9f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector acosh/acoshf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:12:23 +0000 (11:12 -0800)] 
x86-64: Add vector acosh/acoshf to libmvec microbenchmark

Add vector acosh/acoshf and input files to libmvec microbenchmark.

libmvec-acosh-inputs:
  90% Normal random distribution
  range: (1.0, DBL_MAX)
  mean: 1.0
  sigma: 8.0
  10% uniform random distribution in range (1.0, 1.0e6)

libmvec-acoshf-inputs:
  90% Normal random distribution
  range: (1.0f, FLT_MAX)
  mean: 1.0f
  sigma: 4.0f
  10% uniform random distribution in range (1.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector atanh/atanhf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:07:55 +0000 (11:07 -0800)] 
x86-64: Add vector atanh/atanhf to libmvec microbenchmark

Add vector atanh/atanhf and input files to libmvec microbenchmark.

libmvec-atanh-inputs:
  90% Normal random distribution
  range: (-1.0, 1.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-1.0, 1.0)

libmvec-atanhf-inputs:
  90% Normal random distribution
  range: (-1.0f, 1.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-1.0f, 1.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector log1p/log1pf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 19:03:28 +0000 (11:03 -0800)] 
x86-64: Add vector log1p/log1pf to libmvec microbenchmark

Add vector log1p/log1pf and input files to libmvec microbenchmark.

libmvec-log1p-inputs:
  70% Normal random distribution
  range: (-1.0, DBL_MAX)
  mean: 0.0
  sigma: 50.0
  30% uniform random distribution in range (-1.0, 1.0e6)

libmvec-log1pf-inputs:
  70% Normal random distribution
  range: (-1.0f, FLT_MAX)
  mean: 0.0f
  sigma: 50.0f
  30% uniform random distribution in range (-1.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector log2/log2f to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:59:06 +0000 (10:59 -0800)] 
x86-64: Add vector log2/log2f to libmvec microbenchmark

Add vector log2/log2f and input files to libmvec microbenchmark.

libmvec-log2-inputs:
  70% Normal random distribution
  range: (0.0, DBL_MAX)
  mean: 1.0
  sigma: 50.0
  30% uniform random distribution in range (0.0, 1.0e6)

libmvec-log2f-inputs:
  70% Normal random distribution
  range: (0.0f, FLT_MAX)
  mean: 1.0f
  sigma: 50.0f
  30% uniform random distribution in range (0.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector log10/log10f to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:54:49 +0000 (10:54 -0800)] 
x86-64: Add vector log10/log10f to libmvec microbenchmark

Add vector log10/log10f and input files to libmvec microbenchmark.

libmvec-log10-inputs:
  70% Normal random distribution
  range: (0.0, DBL_MAX)
  mean: 1.0
  sigma: 50.0
  30% uniform random distribution in range (0.0, 1.0e6)

libmvec-log10f-inputs:
  70% Normal random distribution
  range: (0.0f, FLT_MAX)
  mean: 1.0f
  sigma: 50.0f
  30% uniform random distribution in range (0.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector atan2/atan2f to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:50:35 +0000 (10:50 -0800)] 
x86-64: Add vector atan2/atan2f to libmvec microbenchmark

Add vector atan2/atan2f and input files to libmvec microbenchmark.

libmvec-atan2-inputs:
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)
  arg2:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)

libmvec-atan2f-inputs:
  arg1:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)
  arg2:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector cbrt/cbrtf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:46:23 +0000 (10:46 -0800)] 
x86-64: Add vector cbrt/cbrtf to libmvec microbenchmark

Add vector cbrt/cbrtf and input files to libmvec microbenchmark.

libmvec-cbrt-inputs:
  90% Normal random distribution
  range: (-DBL_MAX, DBL_MAX)
  mean: 0.0
  sigma: 10.0
  10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-cbrtf-inputs:
  90% Normal random distribution
  range: (-FLT_MAX, FLT_MAX)
  mean: 0.0f
  sigma: 10.0f
  10% uniform random distribution in range (-1000.0f, 1000.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector sinh/sinhf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:42:16 +0000 (10:42 -0800)] 
x86-64: Add vector sinh/sinhf to libmvec microbenchmark

Add vector sinh/sinhf and input files to libmvec microbenchmark.

libmvec-sinh-inputs:
  90% Normal random distribution
  range: (-710.0, 710.0)
  mean: 0.0
  sigma: 32.0
  10% uniform random distribution in range (-500.0, 500.0)

libmvec-sinhf-inputs:
  90% Normal random distribution
  range: (-89.0f, 89.0f)
  mean: 0.0f
  sigma: 16.0f
  10% uniform random distribution in range (-50.0f, 50.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector expm1/expm1f to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:38:12 +0000 (10:38 -0800)] 
x86-64: Add vector expm1/expm1f to libmvec microbenchmark

Add vector expm1/expm1f and input files to libmvec microbenchmark.

libmvec-expm1-inputs:
  90% Normal random distribution
  range: (-708.0, 709.0)
  mean: 0.0
  sigma: 16.0
  10% uniform random distribution in range (-500.0, 500.0)

libmvec-expm1f-inputs:
  90% Normal random distribution
  range: (-87.0f, 88.0f)
  mean: 0.0f
  sigma: 8.0f
  10% uniform random distribution in range (-50.0f, 50.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector cosh/coshf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:34:12 +0000 (10:34 -0800)] 
x86-64: Add vector cosh/coshf to libmvec microbenchmark

Add vector cosh/coshf and input files to libmvec microbenchmark.

libmvec-cosh-inputs:
  90% Normal random distribution
  range: (-710.0, 710.0)
  mean: 0.0
  sigma: 32.0
  10% uniform random distribution in range (-500.0, 500.0)

libmvec-coshf-inputs:
  90% Normal random distribution
  range: (-89.0f, 89.0f)
  mean: 0.0f
  sigma: 16.0f
  10% uniform random distribution in range (-50.0f, 50.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector exp10/exp10f to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:30:16 +0000 (10:30 -0800)] 
x86-64: Add vector exp10/exp10f to libmvec microbenchmark

Add vector exp10/exp10f and input files to libmvec microbenchmark.

libmvec-exp10-inputs:
  90% Normal random distribution
  range: (-307.0, 308.0)
  mean: 0.0
  sigma: 16.0
  10% uniform random distribution in range (-250.0, 250.0)

libmvec-exp10f-inputs:
  90% Normal random distribution
  range: (-37.0f, 38.0f)
  mean: 0.0f
  sigma: 8.0f
  10% uniform random distribution in range (-25.0f, 25.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector exp2/exp2f to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:26:23 +0000 (10:26 -0800)] 
x86-64: Add vector exp2/exp2f to libmvec microbenchmark

Add vector exp2/exp2f and input files to libmvec microbenchmark.

libmvec-exp2-inputs:
  90% Normal random distribution
  range: (-1022.0, 1024.0)
  mean: 0.0
  sigma: 16.0
  10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-exp2f-inputs:
  90% Normal random distribution
  range: (-126.0f, 128.0f)
  mean: 0.0f
  sigma: 8.0f
  10% uniform random distribution in range (-100.0f, 100.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector hypot/hypotf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:22:34 +0000 (10:22 -0800)] 
x86-64: Add vector hypot/hypotf to libmvec microbenchmark

Add vector hypot/hypotf and input files to libmvec microbenchmark.

libmvec-hypot-inputs:
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 10.0
    10% uniform random distribution in range (-1000.0, 1000.0)
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 10.0
    10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-hypotf-inputs:
  arg1:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 10.0f
    10% uniform random distribution in range (-1000.0f, 1000.0f)
  arg2:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 10.0f
    10% uniform random distribution in range (-1000.0f, 1000.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector asin/asinf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:18:48 +0000 (10:18 -0800)] 
x86-64: Add vector asin/asinf to libmvec microbenchmark

Add vector asin/asinf and input files to libmvec microbenchmark.

libmvec-asin-inputs:
  90% Normal random distribution
  range: (-1.0, 1.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-1.0, 1.0)

libmvec-asinf-inputs:
  90% Normal random distribution
  range: (-1.0f, 1.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-1.0f, 1.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Add vector atan/atanf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:15:03 +0000 (10:15 -0800)] 
x86-64: Add vector atan/atanf to libmvec microbenchmark

Add vector atan/atanf and input files to libmvec microbenchmark.

libmvec-atan-inputs:
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)
  arg2:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)

libmvec-atanf-inputs:
  arg1:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)
  arg2:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agoelf: Replace tst-audit24bmod2.so with tst-audit24bmod2
H.J. Lu [Sun, 6 Feb 2022 19:12:24 +0000 (11:12 -0800)] 
elf: Replace tst-audit24bmod2.so with tst-audit24bmod2

Replace tst-audit24bmod2.so with tst-audit24bmod2 to silence:

make[2]: Entering directory '/export/gnu/import/git/gitlab/x86-glibc/elf'
Makefile:2201: warning: overriding recipe for target '/export/build/gnu/tools-build/glibc-gitlab/build-x86_64-linux/elf/tst-audit24bmod2.so'
../Makerules:765: warning: ignoring old recipe for target '/export/build/gnu/tools-build/glibc-gitlab/build-x86_64-linux/elf/tst-audit24bmod2.so'

2 years agox86_64/multiarch: Sort sysdep_routines and put one entry per line
H.J. Lu [Sat, 5 Feb 2022 19:52:33 +0000 (11:52 -0800)] 
x86_64/multiarch: Sort sysdep_routines and put one entry per line

2 years agostring: Sort headers, routines, tests and tests-translation
H.J. Lu [Sat, 5 Feb 2022 19:28:50 +0000 (11:28 -0800)] 
string: Sort headers, routines, tests and tests-translation

Sort headers, routines, tests and tests-translation.  Put one entry per
line.

2 years agox86: Improve L to support L(XXX_SYMBOL (YYY, ZZZ))
H.J. Lu [Sat, 5 Feb 2022 19:06:01 +0000 (11:06 -0800)] 
x86: Improve L to support L(XXX_SYMBOL (YYY, ZZZ))

2 years agoBenchtests: move 'alloc_bufs' from loop in bench-memset.c
Noah Goldstein [Sat, 5 Feb 2022 09:10:44 +0000 (03:10 -0600)] 
Benchtests: move 'alloc_bufs' from loop in bench-memset.c

One buf allocation is sufficient. Calling `alloc_bufs' in the loop
just adds unnecessary syscall overhead.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 years agox86-64: Fix strcmp-evex.S
H.J. Lu [Fri, 4 Feb 2022 19:11:08 +0000 (11:11 -0800)] 
x86-64: Fix strcmp-evex.S

Change "movl %edx, %rdx" to "movl %edx, %edx" in:

commit 8418eb3ff4b781d31c4ed5dc6c0bd7356bc45db9
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Mon Jan 10 15:35:39 2022 -0600

    x86: Optimize strcmp-evex.S

2 years agox86-64: Fix strcmp-avx2.S
H.J. Lu [Fri, 4 Feb 2022 19:09:10 +0000 (11:09 -0800)] 
x86-64: Fix strcmp-avx2.S

Change "movl %edx, %rdx" to "movl %edx, %edx" in:

commit b77b06e0e296f1a2276c27a67e1d44f2cfa38d45
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Mon Jan 10 15:35:38 2022 -0600

    x86: Optimize strcmp-avx2.S

2 years agox86-64: Add vector acos/acosf to libmvec microbenchmark
Sunil K Pandey [Thu, 30 Dec 2021 18:11:23 +0000 (10:11 -0800)] 
x86-64: Add vector acos/acosf to libmvec microbenchmark

Add vector acos/acosf and input files to libmvec microbenchmark.

libmvec-acos-inputs:
  90% Normal random distribution
  range: (-1.0, 1.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-1.0, 1.0)

libmvec-acosf-inputs:
  90% Normal random distribution
  range: (-1.0f, 1.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-1.0f, 1.0f)

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agobenchtests: Add more coverage for strcmp and strncmp benchmarks
Noah Goldstein [Mon, 10 Jan 2022 21:35:40 +0000 (15:35 -0600)] 
benchtests: Add more coverage for strcmp and strncmp benchmarks

Add more small and medium sized tests for strcmp and strncmp.

As well for strcmp add option for more direct control of
alignment. Previously alignment was being pushed to the end of the
page. While this is the most difficult case to implement, it is far
from the common case and so shouldn't be the only benchmark.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agox86: Optimize strcmp-evex.S
Noah Goldstein [Mon, 10 Jan 2022 21:35:39 +0000 (15:35 -0600)] 
x86: Optimize strcmp-evex.S

Optimization are primarily to the loop logic and how the page cross
logic interacts with the loop.

The page cross logic is at times more expensive for short strings near
the end of a page but not crossing the page. This is done to retest
the page cross conditions with a non-faulty check and to improve the
logic for entering the loop afterwards. This is only particular cases,
however, and is general made up for by more than 10x improvements on
the transition from the page cross -> loop case.

The non-page cross cases as well are nearly universally improved.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agox86: Optimize strcmp-avx2.S
Noah Goldstein [Mon, 10 Jan 2022 21:35:38 +0000 (15:35 -0600)] 
x86: Optimize strcmp-avx2.S

Optimization are primarily to the loop logic and how the page cross
logic interacts with the loop.

The page cross logic is at times more expensive for short strings near
the end of a page but not crossing the page. This is done to retest
the page cross conditions with a non-faulty check and to improve the
logic for entering the loop afterwards. This is only particular cases,
however, and is general made up for by more than 10x improvements on
the transition from the page cross -> loop case.

The non-page cross cases are improved most for smaller sizes [0, 128]
and go about even for (128, 4096]. The loop page cross logic is
improved so some more significant speedup is seen there as well.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agostring: Improve coverage in test-strcmp.c and test-strncmp.c
Noah Goldstein [Mon, 10 Jan 2022 21:35:37 +0000 (15:35 -0600)] 
string: Improve coverage in test-strcmp.c and test-strncmp.c

Add additional test cases for small / medium sizes.

Add tests in test-strncmp.c where `n` is near ULONG_MAX or LONG_MIN to
test for overflow bugs in length handling.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agostring/test-str*cmp: remove stupid_[strcmp, strncmp, wcscmp, wcsncmp].
Noah Goldstein [Mon, 10 Jan 2022 21:35:36 +0000 (15:35 -0600)] 
string/test-str*cmp: remove stupid_[strcmp, strncmp, wcscmp, wcsncmp].

These implementations just add to test duration. Since we have
simple_* implementations we already have a safe reference
implementation.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 years agolinux: Fix missing __convert_scm_timestamps (BZ #28860)
Adhemerval Zanella [Thu, 3 Feb 2022 19:52:52 +0000 (16:52 -0300)] 
linux: Fix missing __convert_scm_timestamps (BZ #28860)

Commit 948ce73b31 made recvmsg/recvmmsg to always call
__convert_scm_timestamps for 64 bit time_t symbol, so adjust it to
always build it for __TIMESIZE != 64.

It fixes build for architecture with 32 bit time_t support when
configured with minimum kernel of 5.1.

2 years agolinux: __get_nprocs_sched: do not feed CPU_COUNT_S with garbage [BZ #28850]
Gleb Fotengauer-Malinovskiy [Tue, 1 Feb 2022 22:39:02 +0000 (22:39 +0000)] 
linux: __get_nprocs_sched: do not feed CPU_COUNT_S with garbage [BZ #28850]

Pass the actual number of bytes returned by the kernel.

Fixes: 33099d72e41c ("linux: Simplify get_nprocs")
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2 years agoposix: Fix tst-spawn6 terminal handling (BZ #28853)
Adhemerval Zanella [Wed, 2 Feb 2022 21:31:59 +0000 (18:31 -0300)] 
posix: Fix tst-spawn6 terminal handling (BZ #28853)

The test changes the current foreground process group, which might
break testing depending of how the make check is issued.  For instance:

  nohup make -j1 test t=posix/tst-spawn6 | less

Will set 'make' and 'less' to be in the foreground process group in
the current session.  When tst-spawn6 new child takes over it becomes
the foreground process and 'less' is stopped and backgrounded which
interrupts the 'make check' command.

To fix it a pseudo-terminal is allocated, the test starts in new
session (so there is no controlling terminal associated), and the
pseudo-terminal is set as the controlling one (similar to what
login_tty does).

Checked on x86_64-linux-gnu.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 years agoRegenerate configure
Andreas Schwab [Thu, 3 Feb 2022 08:35:03 +0000 (09:35 +0100)] 
Regenerate configure