about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* s390x: Update math: redirect roundeven functionStefan Liebler2021-06-293-1/+3
| | | | | | | | | | | | | After recent commit 447954a206837b5f153869cfeeeab44631c3fac9 "math: redirect roundeven function", building on s390x fails with: Error: symbol `__roundevenl' is already defined Similar to aarch64/riscv fix, this patch redirects target specific functions for s390x: commit 3213ed770cbc5821920d16caa93c85e92dd7b9f6 "Update math: redirect roundeven function"
* posix: Add _Fork [BZ #4737]Adhemerval Zanella2021-06-2842-17/+451
| | | | | | | | | | | | | | | | | | | | | | | | | Austin Group issue 62 [1] dropped the async-signal-safe requirement for fork and provided a async-signal-safe _Fork replacement that does not run the atfork handlers. It will be included in the next POSIX standard. It allow to close a long standing issue to make fork AS-safe (BZ#4737). As indicated on the bug, besides the internal lock for the atfork handlers itself; there is no guarantee that the handlers itself will not introduce more AS-safe issues. The idea is synchronize fork with the required internal locks to allow children in multithread processes to use mostly of standard function (even though POSIX states only AS-safe function should be used). On signal handles, _Fork should be used intead and only AS-safe functions should be used. For testing, the new tst-_Fork only check basic usage. I also added a new tst-mallocfork3 which uses the same strategy to check for deadlock of tst-mallocfork2 but using threads instead of subprocesses (and it does deadlock if it replaces _Fork with fork). [1] https://austingroupbugs.net/view.php?id=62
* nptl: Add glibc.pthread.stack_cache_size tunableFlorian Weimer2021-06-286-4/+32
| | | | | | | The valgrind/helgrind test suite needs a way to make stack dealloction more prompt, and this feature seems to be generally useful. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* nptl: Export libthread_db-used symbols under GLIBC_PRIVATEFlorian Weimer2021-06-284-8/+71
| | | | | | | This allows distributions to strip debugging information from libc.so.6 without impacting the debugging experience. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Rename nptl_version to __nptl_versionFlorian Weimer2021-06-282-2/+2
| | | | | | | This prepares it for exporting as a dynamic symbol. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl_db: Clean up main/rtld variable handlingFlorian Weimer2021-06-282-10/+5
| | | | | | | | | | | Most symbols are now in libc.so.6. The "main" (exempted from coverage checks) status is therefore not necessary. Use DB_MAIN_VARIABLE for the remaining separate symbol, __nptl_initial_report_events. DB_RTLD_VARIABLE is now unused, so remove it. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* arm: align stack in clone [BZ 28020]Szabolcs Nagy2021-06-281-0/+2
| | | | | | | The arm PCS requires 8 byte aligned stack at function entry. Previously unaligned stack could crash the clone child. Fixes bug 28020.
* Linux: Cleanups after librt moveFlorian Weimer2021-06-2820-150/+44
| | | | | | | | | | | | librt.so is no longer installed for PTHREAD_IN_LIBC, and tests are not linked against it. $(librt) is introduced globally for shared tests that need to be linked for both PTHREAD_IN_LIBC and !PTHREAD_IN_LIBC. GLIBC_PRIVATE symbols that were needed during the transition are removed again. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Linux: Move timer_settime, __timer_settime64 from librt to libcFlorian Weimer2021-06-2884-212/+245
| | | | | | | | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. The way the ABI intransition is implemented is changed with this commit: the implementation is now consolidated in one file with a TIMER_T_WAS_INT_COMPAT check. The shared librt is now empty, so this commit adds a placeholder symbol at the base version, GLIBC_2.2, and potentially at the GLIBC_2.3.3 version as well (the leftover from the int/timer_t ABI transition). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move timer_gettime, __timer_gettime64 from librt to libcFlorian Weimer2021-06-2879-119/+153
| | | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. The way the ABI intransition is implemented is changed with this commit: the implementation is now consolidated in one file with a TIMER_T_WAS_INT_COMPAT check. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move timer_getoverrun from librt to libcFlorian Weimer2021-06-2879-95/+107
| | | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. The way the ABI intransition is implemented is changed with this commit: the implementation is now consolidated in one file with a TIMER_T_WAS_INT_COMPAT check. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move timer_create, timer_delete from librt to libcFlorian Weimer2021-06-2890-242/+276
| | | | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. timer_create and timer_delete are tied together via the int/timer_t compatibility code. The way the ABI intransition is implemented is changed with this commit: the implementation is now consolidated in one file with a TIMER_T_WAS_INT_COMPAT check. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Define TIMER_T_WAS_INT_COMPAT in kernel-posix-timers.hFlorian Weimer2021-06-288-0/+138
| | | | | | | | | This is almost equivalent to __WORDSIZE == 64 && OTHER_SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_3_3), except that this expression is true for mips64/n64 targets as well, even though those did not undergo the timer_t transition. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Install shared objects under their ABI namesFlorian Weimer2021-06-284-54/+15
| | | | | | | | | | | | | Previously, the installed objects were named like libc-2.33.so, and the ABI soname libc.so.6 was just a symbolic link. The Makefile targets to install these symbolic links are no longer needed after this, so they are removed with this commit. The more general $(make-link) command (which invokes scripts/rellns-sh) is retained because other symbolic links are still needed. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@rehdat.com>
* elf: Generalize name-based DSO recognition in ldconfigFlorian Weimer2021-06-284-4/+72
| | | | | | | | | This introduces <dl-is_dso.h> and the _dl_is_dso function. A test ensures that the official names of libc.so, ld.so, and their versioned names are recognized. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Makerules: Remove lib-version, $(subdir-version)Florian Weimer2021-06-281-22/+4
| | | | | | | | Also clarify that the "versioned" term refers to the soname, not the glibc version (which also ends up in the installed file name). Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl_db: Install libthread_db under a regular implementation nameFlorian Weimer2021-06-281-2/+0
| | | | | | | | | | | Currently, the name is always libthread_db-1.0.so. It does not change with the glibc version, like the other libraries. GDB hard-codes libthread_db.so.1 (the soname), so this change does not affect loading libthread_db. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* iconvconfig: Fix multiple issuesSiddhesh Poyarekar2021-06-282-16/+10
| | | | | | | | | | | | | | | | | | | | | It was noticed on big-endian systems that msgfmt would fail with the following error: msgfmt: gconv_builtin.c:70: __gconv_get_builtin_trans: Assertion `cnt < sizeof (map) / sizeof (map[0])' failed. Aborted (core dumped) This is only seen on installed systems because it was due to a corrupted gconv-modules.cache. iconvconfig had the following issues (it was specifically freeing fulldir that caused this issue, but other cleanups are also needed) that this patch fixes. - Add prefix only if dir starts with '/' - Use asprintf instead of mempcpy so that the directory string is NULL terminated - Make a copy of the directory reference in new_module so that fulldir can be freed within the same scope in handle_dir. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* wordexp: handle overflow in positional parameter number (bug 28011)Andreas Schwab2021-06-272-1/+2
| | | | Use strtoul instead of atoi so that overflow can be detected.
* Update math: redirect roundeven functionH.J. Lu2021-06-275-2/+5
| | | | | Redirect target specific roundeven functions for aarch64, ldbl-128ibm and riscv.
* Use GCC builtins for roundeven functions if desired.Shen-Ta Hsieh2021-06-276-0/+22
| | | | | | | | | | | | | This patch is using the corresponding GCC builtin for roundevenf, roundeven and roundevenl if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. These builtin functions is supported since GCC 10. The code of the generic implementation is not changed. Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* x86_64: roundeven with sse4.1 supportShen-Ta Hsieh2021-06-277-2/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the sse4.1 hardware floating point roundeven. Here is some benchmark results on my systems: =AMD Ryzen 9 3900X 12-Core Processor= * benchmark result before this commit | | roundeven | roundevenf | |------------|--------------|--------------| | duration | 3.75587e+09 | 3.75114e+09 | | iterations | 3.93053e+08 | 4.35402e+08 | | max | 52.592 | 58.71 | | min | 7.98 | 7.22 | | mean | 9.55563 | 8.61535 | * benchmark result after this commit | | roundeven | roundevenf | |------------|---------------|--------------| | duration | 3.73815e+09 | 3.73738e+09 | | iterations | 5.82692e+08 | 5.91498e+08 | | max | 56.468 | 51.642 | | min | 6.27 | 6.156 | | mean | 6.41532 | 6.3185 | =Intel(R) Pentium(R) CPU D1508 @ 2.20GHz= * benchmark result before this commit | | roundeven | roundevenf | |------------|--------------|--------------| | duration | 2.18208e+09 | 2.18258e+09 | | iterations | 2.39932e+08 | 2.46924e+08 | | max | 96.378 | 98.035 | | min | 6.776 | 5.94 | | mean | 9.09456 | 8.83907 | * benchmark result after this commit | | roundeven | roundevenf | |------------|--------------|--------------| | duration | 2.17415e+09 | 2.17005e+09 | | iterations | 3.56193e+08 | 4.09824e+08 | | max | 51.693 | 97.192 | | min | 5.926 | 5.093 | | mean | 6.10385 | 5.29507 | Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* math: redirect roundeven functionShen-Ta Hsieh2021-06-276-2/+10
| | | | | | | This patch redirect roundeven function for futhermore changes. Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Linux: Move timer helper routines from librt to libcFlorian Weimer2021-06-257-50/+64
| | | | | | | | | | | | This adds several temporary GLIBC_PRIVATE exports. The symbol names are changed so that they all start with __timer_. It is now possible to invoke the fork handler directly, so pthread_atfork is no longer necessary. The associated error cannot happen anymore, and cancellation handling can be removed from the helper thread routine. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_unlink from librt to libcFlorian Weimer2021-06-2566-34/+100
| | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. A placeholder symbol is needed on some architectures for the GLIBC_2.3.4 version. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_send, mq_timedsend, __mq_timedsend_time64 to libcFlorian Weimer2021-06-2568-99/+196
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_receive, mq_timedreceive, __mq_timedreceive_time64 to libcFlorian Weimer2021-06-2568-97/+200
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_open, __mq_open_2 from librt to libcFlorian Weimer2021-06-2566-64/+178
| | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. A placeholder symbol is required to keep the GLIBC_2.7 version. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_notify from librt to libcFlorian Weimer2021-06-2568-68/+101
| | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. An explicit call from fork into the mq_notify implementation replaces the previous use of pthread_atfork. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_getattr from librt to libcFlorian Weimer2021-06-2565-33/+75
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_setattr from librt to libcFlorian Weimer2021-06-2567-34/+108
| | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. To introduce the proper symbol versioning, the implementation of the system call wrapper us moved to a C file. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_close from librt to libcFlorian Weimer2021-06-2565-32/+79
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move lio_listio, lio_listio64 from librt to libcFlorian Weimer2021-06-2566-105/+248
| | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Placeholder symbols are needed on some architectures, to keep the GLIBC_2.1 and GLIBC_2.4 symbol versions around. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* rt: Rework lio_listio implementationFlorian Weimer2021-06-255-259/+287
| | | | | | | | Move the common code into rt/lio_listio-common.c and include the file in both rt/lio_listio.c and rt/lio_listio64.c. The common code automatically defines both public symbols for __WORDSIZE == 64. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_write, aio_write64 into libcFlorian Weimer2021-06-2568-79/+181
| | | | | | | | | | | Both symbols have to be moved at the same time because they are intertwined for __WORDSIZE == 64. The treatment of this case is also changed to match more closely how the other files suppress the declaration of the *64 identifier. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_suspend, aio_suspend64, __aio_suspend_time64 to libcFlorian Weimer2021-06-2567-90/+197
| | | | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. There is a minor oddity here: This is generic code shared with Hurd, and Hurd does not have time64 support. This is why the versioned_symbol export for __aio_suspend_time64 is restricted to the PTHREAD_IN_LIBC code. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_return, aio_return64 into libcFlorian Weimer2021-06-2565-64/+147
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_read, aio_read64 into libcFlorian Weimer2021-06-2568-78/+180
| | | | | | | | | | | Both symbols have to be moved at the same time because they are intertwined for __WORDSIZE == 64. The treatment of this case is also changed to match more closely how the other files suppress the declaration of the *64 identifier. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_fsync, aio_fsync64 into libcFlorian Weimer2021-06-2565-67/+147
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_error, aio_error64 into libcFlorian Weimer2021-06-2565-67/+150
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_cancel, aio_cancel64 into libcFlorian Weimer2021-06-2572-103/+284
| | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. A version placeholder symbol is needed on alpha and sparc because of the additional symbols formerly at version GLIBC_2.3. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>:
* Linux: Move aio_init from librt into libcFlorian Weimer2021-06-2573-93/+222
| | | | | | | | | This commit also moves the aio_misc and aio_sigquue helper, so GLIBC_PRIVATE exports need to be added. The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* support: Fix xclone build failures on ia64 and hppaFlorian Weimer2021-06-251-4/+3
|
* elf: Disable most of TLS modid gaps processing [BZ #27135]Florian Weimer2021-06-253-6/+15
| | | | | | | | | | | | | Revert "elf: Fix DTV gap reuse logic [BZ #27135]" This reverts commit 572bd547d57a39b6cf0ea072545dc4048921f4c3. It turns out that the _dl_next_tls_modid in _dl_map_object_from_fd keeps returning the same modid over and over again if there is a gap and more than TLS-using module is loaded in one dlopen call. This corrupts TLS data structures. The bug is still present after a revert, but empirically it is much more difficult to trigger (because it involves a dlopen failure).
* elf: Fix glibc-hwcaps priorities with cache flags mismatches [BZ #27046]Florian Weimer2021-06-251-64/+60
| | | | | | | | | | | | | | | | | | | | If lib->flags (in the cache) did not match GLRO (dl_correct_cache_id), searching for further glibc-hwcaps entries did not happen, and it was possible that the best glibc-hwcaps was not found. By accident, this causes a test failure for elf/tst-glibc-hwcaps-prepend-cache on armv7l. This commit changes the cache lookup logic to continue searching if (a) no match has been found, (b) a named glibc-hwcaps match has been found(), or (c) non-glibc-hwcaps match has been found and the entry flags and cache default flags do not match. _DL_CACHE_DEFAULT_ID is used instead of GLRO (dl_correct_cache_id) because the latter is only written once on i386 if loading of libc.so.5 libraries is selected, so GLRO (dl_correct_cache_id) should probably removed in a future change. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* * NEWS: Clarify _TIME_BITS change.Paul Eggert2021-06-241-1/+3
|
* x86: Remove unnecessary overflow check from wcsnlen-sse4_1.SNoah Goldstein2021-06-241-7/+0
| | | | | | | | | | | | | | | | | | | | | No bug. The way wcsnlen will check if near the end of maxlen is the following macro: mov %r11, %rsi; \ subq %rax, %rsi; \ andq $-64, %rax; \ testq $-64, %rsi; \ je L(strnlen_ret) Which words independently of s + maxlen overflowing. So the second overflow check is unnecissary for correctness and just extra overhead in the common no overflow case. test-strlen.c, test-wcslen.c, test-strnlen.c and test-wcsnlen.c are all passing Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* String: Add three more overflow tests cases to test-strnlen.cNoah Goldstein2021-06-241-0/+4
| | | | | | | | No bug. Just seem like relevant cases given that strnlen will use s + maxlen in many implementations. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Consolidate pthread_atforkAdhemerval Zanella2021-06-249-75/+18
| | | | | | | | | | | | The pthread_atfork is similar between Linux and Hurd, only the compat version bits differs. The generic version is place at sysdeps/pthread with a common name. It also fixes an issue with Hurd license, where the static-only object did not use LGPL + exception. Checked on x86_64-linux-gnu, i686-linux-gnu, and with a build for i686-gnu.
* posix: Do not clobber errno by atfork handlersAdhemerval Zanella2021-06-241-0/+6
| | | | Checked on x86_64-linux-gnu.