about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Implement <unwind-link.h> for dynamically loading the libgcc_s unwinderFlorian Weimer2021-03-0120-18/+600
| | | | | | | | | | This will be used to consolidate the libgcc_s access for backtrace and pthread_cancel. Unlike the existing backtrace implementations, it provides some hardening based on pointer mangling. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Correct buffer end pointer in IO_wdefault_doallocate (BZ #26874)Martin Sebor2021-03-011-4/+3
| | | | | | | | | | | | | An experimental build of GCC 11 with an enhanced -Warray-bounds reports a bug in IO_wdefault_doallocate where the function forms an invalid past-the-end pointer to an allocated wchar_t buffer by failingf to consider the scaling by sizeof (wchar_t). The fix path below corrects this problem. It keeps the buffer size the same as opposed to increasing it according to what other code like it does. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* aarch64: update ulps.Szabolcs Nagy2021-03-011-15/+17
| | | | | For new test cases in commit 5a051454a9b50c27984bbc499ee1297de48e2dc8
* Add inputs that generate larger error boundsPaul Zimmermann2021-02-2719-24/+3086
| | | | (Using values from https://members.loria.fr/PZimmermann/papers/accuracy.pdf)
* Reduce the statically linked startup code [BZ #23323]Florian Weimer2021-02-2563-315/+276
| | | | | | | | | | | | | | | | | | | It turns out the startup code in csu/elf-init.c has a perfect pair of ROP gadgets (see Marco-Gisbert and Ripoll-Ripoll, "return-to-csu: A New Method to Bypass 64-bit Linux ASLR"). These functions are not needed in dynamically-linked binaries because DT_INIT/DT_INIT_ARRAY are already processed by the dynamic linker. However, the dynamic linker skipped the main program for some reason. For maximum backwards compatibility, this is not changed, and instead, the main map is consulted from __libc_start_main if the init function argument is a NULL pointer. For statically linked binaries, the old approach based on linker symbols is still used because there is nothing else available. A new symbol version __libc_start_main@@GLIBC_2.34 is introduced because new binaries running on an old libc would not run their ELF constructors, leading to difficult-to-debug issues.
* posix: Falling back to non wide mode in case of encoding error [BZ #14185]Adhemerval Zanella2021-02-232-104/+58
| | | | | | | | | | | | | | | | Gnulib has added the proposed fix with aed23714d60 (done in 2005), but recently with a glibc merge with 67306f6 (done in 2020 with sync back) it has fallback to old semantic to return -1 on in case of failure. From gnulib developer feedback it was an oversight. Although the full fix for BZ #14185 would require to rewrite fnmatch implementation to use mbrtowc instead of mbsrtowcs on the full input, this mitigate the issue and it has been used by gnulib for a long time. This patch also removes the alloca usage on the string convertion to wide characters before calling the internal function. Checked on x86_64-linux-gnu.
* nptl: Move elision implementations into libcFlorian Weimer2021-02-2346-646/+185
| | | | | | | | | | | | | | | | | | The elision interfaces are closely aligned between the targets that implement them, so declare them in the generic <lowlevellock.h> file. Empty .c stubs are provided, so that fewer makefile updates under sysdeps are needed. Also simplify initialization via __libc_early_init. The symbols __lll_clocklock_elision, __lll_lock_elision, __lll_trylock_elision, __lll_unlock_elision, __pthread_force_elision move into libc. For the time being, non-hidden references are used from libpthread to access them, but once that part of libpthread is moved into libc, hidden symbols will be used again. (Hidden references seem desirable to reduce the likelihood of transactions aborts.)
* NEWS: Add missing bug closuresSamuel Thibault2021-02-231-5/+6
|
* added rt to malloc/Depend [BZ #27132]Paul Zimmermann2021-02-231-0/+1
| | | | | This avoids a failure when a new glibc version is compiled with an older system librt. Patch proposed by Florian Weimer.
* x86: Use x86/nptl/pthreaddef.hH.J. Lu2021-02-222-48/+7
| | | | | | | 1. Move sysdeps/i386/nptl/pthreaddef.h to sysdeps/x86/nptl/pthreaddef.h. 2. Remove sysdeps/x86_64/nptl/pthreaddef.h. Reviewed-by: DJ Delorie <dj@redhat.com>
* nptl: Move futex-internal into libcFlorian Weimer2021-02-224-7/+7
| | | | | | | | This moves __futex_abstimed_wait64 and __futex_abstimed_wait_cancelable64 and exports these functions as GLIBC_PRIVATE. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move lowlevellock into libc [BZ #15648]Florian Weimer2021-02-226-36/+9
| | | | | | And export __lll_lock_wait and __lll_lock_wait_private as GLIBC_PRIVATE. This should eliminate the need for the previous riscv kludge.
* nptl: Move futex-internal.c into main nptl directoryFlorian Weimer2021-02-223-2/+4
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Reformat VersionsFlorian Weimer2021-02-221-188/+279
| | | | | | One symbol per line, lexicographically ordered. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Split libpthread-routines into one routine per lineFlorian Weimer2021-02-221-86/+152
| | | | | | | And sort the lines lexicographically. This will make it easier to review patches which move symbols from libpthread to libc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Remove unused variables for raw cache sizes from cacheinfo.hFlorian Weimer2021-02-221-12/+0
|
* Use Linux 5.11 in build-many-glibcs.py.Joseph Myers2021-02-221-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 5.11. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* <bits/platform/x86.h>: Correct x86_cpu_TBMH.J. Lu2021-02-221-1/+1
| | | | x86_cpu_TBM should be x86_cpu_index_80000001_ecx + 21.
* x86_64/clone.S: Upate commentsH.J. Lu2021-02-221-6/+8
|
* i386/clone.S: Remove redundant EBX loadH.J. Lu2021-02-221-6/+0
| | | | | | | | | | | | | There is no neeed for call L(here) L(here): popl %ebx addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx before movl %eax, %ebx
* aarch64: Remove the unused __read_tp symbolSzabolcs Nagy2021-02-223-51/+0
| | | | | | | | This was likely a mistake in the original aarch64 port copied over from arm: on aarch64 tpidr_el0 register is always available. The __read_tp symbol is visible with static linking, but it's not part of the public ABI so it should be safe to remove.
* build-many-glibcs.py: Use make -O for more consistent log outputFlorian Weimer2021-02-221-1/+1
| | | | | | | | The -O option avoids interleaving (e.g.) compiler error messages with other build messages, and makes attribution of messages to commands easier. According to my tests, the impact on build time is within the noise.
* configure: Replace obsolete AC_TRY_LINK with AC_LINK_IFELSENaohiro Tamura2021-02-211-1/+2
| | | | | | This patch replaces obsolete AC_TRY_LINK with AC_LINK_IFELSE. It has been confirmed that GNU 'autoconf' 2.69 doesn't change the 'configure' file and suppressed obsolete warning.
* configure: Remove obsolete AC_CHECK_TOOL_PREFIXNaohiro Tamura2021-02-212-2/+0
| | | | | | | | | | | | | This patch removes obsolete AC_CHECK_TOOL_PREFIX. It has been confirmed that AC_CHECK_TOOL_PREFIX is defined as NOP in GNU 'autoconf' 2.69 [1], so we can safely remove it. The 'configure' file has been deleted one blank line by the 'autoconf' 2.69 command . [1] autoconf-2.69/share/autoconf/autoconf/programs.m4 181 # AC_CHECK_TOOL_PREFIX 182 # -------------------- 183 AU_DEFUN([AC_CHECK_TOOL_PREFIX])
* configure: Replace obsoleted AC_HELP_STRING with AS_HELP_STRINGNaohiro Tamura2021-02-211-30/+30
| | | | | | | | This patch replaces obsoleted AC_HELP_STRING with AS_HELP_STRING. As of Glibc 2.33, INSTALL says "GNU 'autoconf' 2.69 (exactly)" is required. So we can safely replace obsoleted macro without worrying about older autoconf. This change doesn't affect the contents of "configure" file.
* Update syscall lists for Linux 5.11.Joseph Myers2021-02-1926-2/+28
| | | | | | | | Linux 5.11 has one new syscall, epoll_pwait2. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
* Correct hppa EFD_NONBLOCK, IN_NONBLOCK, SFD_NONBLOCK and TFD_NONBLOCK defines.John David Anglin2021-02-194-4/+4
|
* string: Work around GCC PR 98512 in rawmemchrFlorian Weimer2021-02-191-11/+15
|
* tst: time: Provide Y2038 tests for mktime (tst-mktime4.c)Lukasz Majewski2021-02-162-1/+110
| | | | | | | | | | | | | This change adds new test to assess mktime's functionality. To be more specific - following use cases are checked: - Pass struct tm as epoch time - Pass struct tm as value just before Y2038 threshold (returned value shall be 0x7FFFFFFF) - Pass struct tm as the first value after Y2038 threshold (expected value - 0x80000000) Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* tst: Provide test for difftimeLukasz Majewski2021-02-162-1/+57
| | | | | | | | | | | This change adds new test to assess difftime's functionality by adding some arbitrary offsets to current time_t value (read via time). If 64 bit time_t is supported, the same procedure is applied around the threshold of Y2038 time overflow. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* tst: Provide test for ctimeLukasz Majewski2021-02-162-1/+57
| | | | | | | | | | | This change adds new test to assess ctime's functionality. To be more specific - following use cases are checked: - Pass time_t value as 0 to check if epoch time is converted - Pass time_t as max value for 32 bit systems - Pass time_t as the first value after Y2038 threshold Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* tst: Provide test for sched_rr_get_intervalLukasz Majewski2021-02-162-1/+46
| | | | | | | | | | | | This change adds new test to assess sched_rr_get_interval's functionality. To be more specific - following use cases are checked: - If the read interval is correct - If the proper ABI is used - to check if adjacent data is not overwritten Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* S390: Add new hwcap values.Stefan Liebler2021-02-163-3/+8
| | | | The new hwcap values indicate support for arch14 architecture.
* aarch64: Fix sys/ptrace.h if linux headers are includedSzabolcs Nagy2021-02-151-0/+34
| | | | | | If the linux asm/ptrace.h is included before sys/ptrace.h that breaks the newly added declarations there, so undef the names that may be defined as macros in the linux header.
* elf: Do not copy vDSO soname when setting up link mapFlorian Weimer2021-02-121-12/+5
| | | | | | | | | | | | The kernel does not put the vDSO at special addresses, so writev can write the name directly. Also remove the incorrect comment about not setting l_name. Andy Lutomirski confirmed in <https://lore.kernel.org/linux-api/442A16C0-AE5A-4A44-B261-FE6F817EAF3C@amacapital.net/> that this copy is not necessary. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Remove the extra space between "# endif"H.J. Lu2021-02-121-1/+1
| | | | | | | | | | Remove the extra space between "# endif" left over from commit f380868f6dcfdeae8d449d556298d9c41012ed8d Author: H.J. Lu <hjl.tools@gmail.com> Date: Thu Dec 24 15:43:34 2020 -0800 Remove _ISOMAC check from <cpu-features.h>
* hurd: Fix fstatfs build failureAdhemerval Zanella2021-02-111-1/+1
| | | | | | | It was added by 1bfbaf7130 where it added a libc_hidden_proto for __fstatfs but it didn't update the Hurd version as well. Checked with a build for i686-gnu.
* linux: Remove stat-check.cAdhemerval Zanella2021-02-113-30/+13
| | | | | | | The check is moved to LFS fstatat implementation (since it is the code that actually implements the syscall). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Remove overflow.hAdhemerval Zanella2021-02-111-69/+0
| | | | | | The header is not used anywhere. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Consolidate internal_statvfsAdhemerval Zanella2021-02-119-37/+56
| | | | | | | | | | | Remove the internal_statvfs64.c and open code the implementation on internal_statvfs.c. The alpha is now unrequired, the generic implementation also handles it. Also, remove unused includes on internal_statvfs.c, and remove unused arguments on __internal_statvfs{64}. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Consolidate statvfs implementationsAdhemerval Zanella2021-02-117-48/+26
| | | | | | | | | There is no need to handle ENOSYS on fstatfs64 call, required only for alpha (where is already fallbacks to fstatfs). Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Consolidate fstatvfs implementationsAdhemerval Zanella2021-02-117-46/+25
| | | | | | | | | | | There is no need to handle ENOSYS on fstatfs64 call, required only for alpha (where is already fallbacks to fstatfs). The wordsize internal_statvfs64.c is removed, since how the LFS support is provided by fstatvfs64.c (used on 64-bit architectures as well). Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Consolidate statfs implementationsAdhemerval Zanella2021-02-119-81/+125
| | | | | | | | | | | | | | | | | | | | | | | | The __NR_statfs64 syscall is supported on all architectures but aarch64, mips64, riscv64, and x86_64. And newer ABIs also uses the new statfs64 interface (where the struct size is used as second argument). So the default implementation now uses: 1. __NR_statfs64 for non-LFS call and handle overflow directly There is no need to handle __NR_statfs since all architectures that only support are LFS only. 2. __NR_statfs if defined or __NR_statfs64 otherwise for LFS call. Alpha is the only outlier, since it is a 64-bit architecture which provides non-LFS interface and only provides __NR_statfs64 on newer kernels (v5.1+). Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Consolidate fstatfs implementationsAdhemerval Zanella2021-02-1110-77/+129
| | | | | | | | | | | | | | | | | | | | | | | | The __NR_fstatfs64 syscall is supported on all architectures but aarch64, mips64, riscv64, and x86_64. And newer ABIs also uses the new fstatfs64 interface (where the struct size is used as first argument). So the default implementation now uses: 1. __NR_fstatfs64 for non-LFS call and handle overflow directly There is no need to handle __NR_fstatfs since all architectures that only support are LFS only. 2. __NR_fstatfs if defined or __NR_fstatfs64 otherwise for LFS call. Alpha is the only outlier, it is a 64-bit architecture which provides non-LFS interface and only provides __NR_fstatfs64 on newer kernels (5.1+). Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Set LFS statfs as defaultAdhemerval Zanella2021-02-112-11/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently glibc has three different struct statfs{64} definitions: 1. Non-LFS support where non-LFS and LFS struct have different size: alpha, arm, hppa, i686, m68k, microblaze, mips (all abis), powerpc32, s390, sh4, and sparc. 2. Non-LFS support where non-LFS and LFS struct have the same size: csky and nios2. 3. Only LFS support (where both struct have the same size): arc, ia64, powerpc64 (including LE), riscv (both 32 and 64 bits), s390x, sparc64, and x86 (including x32). The STATFS_IS_STATFS64/__STATFS_MATCHES_STATFS64 does not tell apart between 1. and 2. since for both the only difference is the struct size (for 2. both non-LFS and LFS uses the same syscall, where for 1. the old non-LFS is used for [f]statfs). This patch move the generic statfs.h for both csky and nios2, and make the default definitions for newer ABIs to assume that only LFS will be support (so there is no need to keep no-LFS and LFS struct statfs with the same size, it will be implicit). This patch does not change the code generation. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Set default kernel_stat.h to LFSAdhemerval Zanella2021-02-1115-200/+231
| | | | | | | | | | | | | | The XSTAT_IS_XSTAT64 and STAT_IS_KERNEL_STAT flags are now set to 1 and STATFS_IS_STATFS64 is set to __STATFS_MATCHES_STATFS64. This makes the default ABI for newer ports to provide only LFS calls. A copy of non-LFS support is provided to 32-bit ABIS with non-LFS support (arm, csky, i386, m68k, nios2, s390, and sh). Is also allows to remove the 64-bit ports, which already uses the default values. This patch does not change the code generation. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Fix STATFS_IS_STATFS64 definitionAdhemerval Zanella2021-02-118-8/+36
| | | | | | | | | | | | | | | aarch64, arc, ia64, mips64, powerpc64, riscv32, riscv64, s390x, sparc64, and x86_64 defines STATFS_IS_STATFS64 to 0, but all of them alias statfs to statfs64 and the struct statfs has the same and layout of struct statfs64. The correct definition will be used on the [f]statfs[64] consolidation. This patch does not change code generation since the symbols are implemented using the auto-generation syscall for all the aforementioned ABIs. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* tunables: Disallow negative values for some tunablesSiddhesh Poyarekar2021-02-102-1/+7
| | | | | | | | The glibc.malloc.mmap_max tunable as well as al of the INT_32 tunables don't have use for negative values, so pin the hardcoded limits in the non-negative range of INT. There's no real benefit in any of those use cases for the extended range of unsigned, so I have avoided added a new type to keep things simple.
* x86: Use SIZE_MAX instead of (long int)-1 for tunable range valueSiddhesh Poyarekar2021-02-101-5/+5
| | | | | The tunable types are SIZE_T, so set the ranges to the correct maximum value, i.e. SIZE_MAX.
* tunables: Simplify TUNABLE_SET interfaceSiddhesh Poyarekar2021-02-106-127/+75
| | | | | | | | | | | | | | | The TUNABLE_SET interface took a primitive C type argument, which resulted in inconsistent type conversions internally due to incorrect dereferencing of types, especialy on 32-bit architectures. This change simplifies the TUNABLE setting logic along with the interfaces. Now all numeric tunable values are stored as signed numbers in tunable_num_t, which is intmax_t. All calls to set tunables cast the input value to its primitive type and then to tunable_num_t for storage. This relies on gcc-specific (although I suspect other compilers woul also do the same) unsigned to signed integer conversion semantics, i.e. the bit pattern is conserved. The reverse conversion is guaranteed by the standard.