aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-06Add PT_AARCH64_MEMTAG_MTE from Linux 5.18 to elf.hJoseph Myers
Linux 5.18 defines a new AArch64 ELF segment type PT_AARCH64_MEMTAG_MTE; add it to elf.h. Tested with build-many-glibcs.py for aarch64-linux-gnu.
2022-06-05grep: egrep -> grep -E, fgrep -> grep -FSam James
Newer versions of GNU grep (after grep 3.7, not inclusive) will warn on 'egrep' and 'fgrep' invocations. Convert usages within the tree to their expanded non-aliased counterparts to avoid irritating warnings during ./configure and the test suite. Signed-off-by: Sam James <sam@gentoo.org> Reviewed-by: Fangrui Song <maskray@google.com>
2022-06-03string.h: Fix boolean spelling in commentsH.J. Lu
2022-06-02elf: Add #include <errno.h> for use of E* constants.Carlos O'Donell
In __strerror_r we use errno constants and must include errno.h. Tested on x86_64 and i686 without regression.
2022-06-02elf: Add #include <sys/param.h> for MAX usage.Carlos O'Donell
In _dl_audit_pltenter we use MAX and so need to include param.h. Tested on x86_64 and i686 without regression.
2022-06-02linux: Add process_mreleaseAdhemerval Zanella
Added in Linux 5.15 (884a7e5964e06ed93c7771c0d7cf19c09a8946f1), the new syscalls allows a caller to free the memory of a dying target process. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-06-02linux: Add process_madviseAdhemerval Zanella
It was added on Linux 5.10 (ecb8ac8b1f146915aa6b96449b66dd48984caacc) with the same functionality as madvise but using a pidfd of the target process. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-06-02linux: Set tst-pidfd-consts unsupported for kernels headers older than 5.10Adhemerval Zanella
Instead of fail trying to build the compare source file. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Matheus Castanho <msc@linux.ibm.com> Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
2022-06-02testrun.sh: Support passing strace and valgrind argumentsFlorian Weimer
This is a bit of a hack, but it works quite well in practice. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-06-02Linux: Adjust struct rseq definition to current kernel versionFlorian Weimer
This definition is only used as a fallback with old kernel headers. The change follows kernel commit bfdf4e6208051ed7165b2e92035b4bf11 ("rseq: Remove broken uapi field layout on 32-bit little endian"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-06-01iconv: Use 64 bit stat for gconv_parseconfdir (BZ# 29213)Adhemerval Zanella
The issue is only when used within libc.so (iconvconfig already builds with _TIME_SIZE=64). This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01catgets: Use 64 bit stat for __open_catalog (BZ# 29211)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01inet: Use 64 bit stat for ruserpass (BZ# 29210)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01socket: Use 64 bit stat for isfdtype (BZ# 29209)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01posix: Use 64 bit stat for fpathconf (_PC_ASYNC_IO) (BZ# 29208)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01posix: Use 64 bit stat for posix_fallocate fallback (BZ# 29207)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01misc: Use 64 bit stat for getusershell (BZ# 29203)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01misc: Use 64 bit stat for daemon (BZ# 29203)Adhemerval Zanella
This is a missing spot initially from 52a5fe70a2c77935. Checked on i686-linux-gnu.
2022-06-01linux: use statx for fstat if neither newfstatat nor fstatat64 is presentWANG Xuerui
LoongArch is going to be the first architecture supported by Linux that has neither fstat* nor newfstatat [1], instead exclusively relying on statx. So in fstatat64's implementation, we need to also enable statx usage if neither fstatat64 nor newfstatat is present, to prepare for this new case of kernel ABI. [1]: https://lore.kernel.org/all/20220518092619.1269111-1-chenhuacai@loongson.cn/ Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-06-01Add MADV_DONTNEED_LOCKED from Linux 5.18 to bits/mman-linux.hJoseph Myers
Linux 5.18 adds a constant MADV_DONTNEED_LOCKED (defined in multiple header files, but with the same value on all architectures). Add this constant to bits/mman-linux.h. Tested for x86_64.
2022-06-01Add HWCAP2_MTE3 from Linux 5.18 to AArch64 bits/hwcap.hJoseph Myers
Linux 5.18 defines a new AArch64 HWCAP value HWCAP2_MTE3; add it to glibc's sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h. Tested with build-many-glibcs.py for aarch64-linux-gnu.
2022-06-01i686: Use generic sincosf implementation for SSE2 versionAdhemerval Zanella
The generic implementation shows slight better performance (gcc 11.2.1 on a Ryzen 9 5900X): * s_sincosf-sse2.S: "sincosf": { "workload-random": { "duration": 3.89961e+09, "iterations": 9.5472e+07, "reciprocal-throughput": 40.8429, "latency": 40.8483, "max-throughput": 2.4484e+07, "min-throughput": 2.44808e+07 } } * generic s_cossinf.c: "sincosf": { "workload-random": { "duration": 3.71953e+09, "iterations": 1.48512e+08, "reciprocal-throughput": 25.0515, "latency": 25.0391, "max-throughput": 3.99177e+07, "min-throughput": 3.99375e+07 } } Checked on i686-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-06-01benchtests: Add workload name for sincosfAdhemerval Zanella
So it can show both reciprocal-throughput and latency. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-06-01i686: Use generic sinf implementation for SSE2 versionAdhemerval Zanella
Performance seems to be similar (gcc 11.2.1 on a Ryzen 9 5900X), the generic algorithm shows slight better performance for the 'workload-huge.wrf' input set. * s_sinf-sse2.S: "sinf": { "": { "duration": 3.72405e+09, "iterations": 2.38374e+08, "max": 63.973, "min": 11.211, "mean": 15.6227 }, "workload-random.wrf": { "duration": 3.76923e+09, "iterations": 8.4e+07, "reciprocal-throughput": 17.6355, "latency": 72.108, "max-throughput": 5.67037e+07, "min-throughput": 1.38681e+07 }, "workload-huge.wrf": { "duration": 3.76943e+09, "iterations": 6e+07, "reciprocal-throughput": 29.3493, "latency": 96.2985, "max-throughput": 3.40724e+07, "min-throughput": 1.03844e+07 } } * generic s_sinf.c: "sinf": { "": { "duration": 3.70989e+09, "iterations": 2.18025e+08, "max": 69.782, "min": 11.1, "mean": 17.0159 }, "workload-random.wrf": { "duration": 3.77213e+09, "iterations": 9.6e+07, "reciprocal-throughput": 17.5402, "latency": 61.0459, "max-throughput": 5.70119e+07, "min-throughput": 1.63811e+07 }, "workload-huge.wrf": { "duration": 3.81576e+09, "iterations": 5.6e+07, "reciprocal-throughput": 38.2111, "latency": 98.0659, "max-throughput": 2.61704e+07, "min-throughput": 1.01972e+07 } } Checked on i686-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-06-01i686: Use generic cosf implementation for SSE2 versionAdhemerval Zanella
Performance seems to be similar (gcc 11.2.1 on a Ryzen 9 5900X): * s_cosf-sse2.S: "cosf": { "workload-random": { "duration": 3.74987e+09, "iterations": 9.616e+07, "reciprocal-throughput": 15.8141, "latency": 62.1782, "max-throughput": 6.32346e+07, "min-throughput": 1.60828e+07 } } * generic s_cosf.c: "cosf": { "workload-random": { "duration": 3.87298e+09, "iterations": 1.00968e+08, "reciprocal-throughput": 18.3448, "latency": 58.3722, "max-throughput": 5.45113e+07, "min-throughput": 1.71314e+07 } } Checked on i686-linux-gnu.
2022-06-01benchtests: Add workload name for cosfAdhemerval Zanella
So it can show both reciprocal-throughput and latency. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-06-01x86_64: Optimize sincos where sin/cos is optimized (bug 29193)Andreas Schwab
The compiler may substitute calls to sin or cos with calls to sincos, thus we should have the same optimized implementations for sincos. The optimized implementations may produce results that differ, that also makes sure that the sincos call aggrees with the sin and cos calls.
2022-05-31manual: fix reference to source fileAndreas Schwab
2022-05-31Add SOL_SMC from Linux 5.18 to bits/socket.hJoseph Myers
Linux 5.18 adds a constant SOL_SMC to the getsockopt / setsockopt levels; add this constant to bits/socket.h. Tested for x86_64.
2022-05-30elf: Remove _dl_skip_argsAdhemerval Zanella
Now that no architecture uses it anymore. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30x86_64: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30sparc: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked on sparc64-linux-gnu and sparcv9-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30sh: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30s390: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked on s390x-linux-gnu and s390-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30riscv: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30nios2: Remove _dl_skip_args usage (BZ# 29187)Adhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30mips: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30microblaze: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30m68k: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30ia64: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. The startup code is changed to read the _dl_argc and _dl_argv values, and envp is calculated from argc and argv. Checked on ia64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30i686: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Checked on i686-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-05-30hppa: Remove _dl_skip_args usage (BZ# 29165)Adhemerval Zanella
Different than other architectures, hppa creates an unrelated stack frame where ld.so argc/argv adjustments done by ad43cac44a6860eaefc is not done on the argc/argv saved/restore by _dl_start_user. Instead load _dl_argc and _dl_argv directlty instead of adjust them using _dl_skip_args value. Checked on hppa-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30csky: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. It makes the fixup_stack branch ununsed. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30arc: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. So there is no need to adjust the argc or argv. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30arm: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. It makes the _fixup_stack branch ununsed. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-30alpha: Remove _dl_skip_args usageAdhemerval Zanella
Since ad43cac44a the generic code already shuffles the argv/envp/auxv on the stack to remove the ld.so own arguments and thus _dl_skip_args is always 0. It makes the fixup_stack branch ununsed. Checked with qemu-user that arguments are correctly passed on both constructors and main program. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-05-27benchtests: Improve benchtests for strstr, memmem, and memchrNoah Goldstein
1. Use json_ctx for output to help standardize format across all benchtests. 2. Add some additional tests to strstr and memchr expanding alignments and adding more small values. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-05-27dlsym: Make RTLD_NEXT prefer default version definition [BZ #14932]Fangrui Song
When the first object providing foo defines both foo@v1 and foo@@v2, dlsym(RTLD_NEXT, "foo") returns foo@v1 while dlsym(RTLD_DEFAULT, "foo") returns foo@@v2. The issue is that RTLD_DEFAULT uses the DL_LOOKUP_RETURN_NEWEST flag while RTLD_NEXT doesn't. Fix the RTLD_NEXT branch to use DL_LOOKUP_RETURN_NEWEST. Note: the new behavior matches FreeBSD rtld. Future sanitizers will not need to add versioned interceptors like https://reviews.llvm.org/D96348 Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-05-26x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOTH.J. Lu
According to x86-64 psABI, r_addend should be ignored for R_X86_64_GLOB_DAT and R_X86_64_JUMP_SLOT. Since linkers always set their r_addends to 0, we can ignore their r_addends. Reviewed-by: Fangrui Song <maskray@google.com>
2022-05-26x86_64: Implement evex512 version of strlen, strnlen, wcslen and wcsnlenSunil K Pandey
This patch implements following evex512 version of string functions. Perf gain for evex512 version is up to 50% as compared to evex, depending on length and alignment. Placeholder function, not used by any processor at the moment. - String length function using 512 bit vectors. - String N length using 512 bit vectors. - Wide string length using 512 bit vectors. - Wide string N length using 512 bit vectors. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>