about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* x86: Add CPU Vendor ID detection support for Zhaoxin processorsmayshao2020-04-302-0/+55
| | | | | To recognize Zhaoxin CPU Vendor ID, add a new architecture type arch_kind_zhaoxin for Vendor Zhaoxin detection.
* Update translationsSiddhesh Poyarekar2020-04-301-32/+32
| | | | Incorporate updates from translationproject.org.
* Add C wrappers for process_vm_readv/process_vm_writev [BZ #25810]H.J. Lu2020-04-294-3/+66
| | | | | | Since the the U marker can only be applied to 2 unsigned long arguments in syscalls.list files, add a C wrapper for process_vm_readv and process_vm_writev syscals which have more than 2 unsigned long arguments.
* generic/typesizes.h: Add support for 32-bit arches with 64-bit typesAlistair Francis2020-04-291-10/+23
| | | | | | | | | Update the default typesizes.h to match the new kernel sizes for 32-bit architectures with a 64-bit time_t and friends. This follows the sizes used for RV32 which is a y2038 safe architecture added after Linux 5.1. Reviewed-by: Vineet Gupta <vgupta@synopsys.com> Tested-by: Vineet Gupta <vgupta@synopsys.com>
* semctl: Remove the sem-pad.h fileAlistair Francis2020-04-2911-117/+141
| | | | | | | Remove the sem-pad.h file and instead have architectures override the struct semid_ds via the bits/types/struct_semid_ds.h file. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* bits/sem.h: Split out struct semid_dsAlistair Francis2020-04-293-23/+45
| | | | | | | Split out the struct semid_ds into it's own file. This will allow us to have architectures specify their own version. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Mark unsigned long arguments with U in more syscalls [BZ #25810]H.J. Lu2020-04-292-18/+18
| | | | | | | Mark unsigned long arguments in mmap, read, recv, recvfrom, send, sendto, write, ioperm, sendfile64, setxattr, lsetxattr, fsetxattr, getxattr, lgetxattr, fgetxattr, listxattr, llistxattr and flistxattr with U in syscalls.list files.
* elf: Add initial flag argument to __libc_early_initFlorian Weimer2020-04-296-12/+31
| | | | | | | | | | | The rseq initialization should happen only for the libc in the base namespace (in the dynamic case) or the statically linked libc. The __libc_multiple_libcs flag does not quite cover this case at present, so this commit introduces a flag argument to __libc_early_init, indicating whether the libc being libc is the primary one (of the main program). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Add SYSCALL_ULONG_ARG_[12] to pass long to syscall [BZ #25810]H.J. Lu2020-04-296-30/+159
| | | | | | | | | | | | | | | | | | | X32 has 32-bit long and pointer with 64-bit off_t. Since x32 psABI requires that pointers passed in registers must be zero-extended to 64bit, x32 can share many syscall interfaces with LP64. When a LP64 syscall with long and unsigned long int arguments is used for x32, these arguments must be properly extended to 64-bit. Otherwise if the upper 32 bits of the register have undefined value, such a syscall will be rejected by kernel. For syscalls implemented in assembly codes, 'U' is added to syscall signature key letters for unsigned long, which is zero-extended to 64-bit types. SYSCALL_ULONG_ARG_1 and SYSCALL_ULONG_ARG_2 are passed to syscall-template.S for the first and the second unsigned long int arguments if PSEUDOS_HAVE_ULONG_INDICES is defined. They are used by x32 to zero-extend 32-bit arguments to 64 bits. Tested on i386, x86-64 and x32 as well as with build-many-glibcs.py.
* Makeconfig: Use $(error ...) to output error messageSimon Marchi2020-04-291-1/+1
| | | | | | | | | | | | | | | | | | Being not familiar with the glibc repository, I typed "make" inside some subdirectory that has a Makefile, and was met with: $ make ../Makeconfig:42: *** missing separator. Stop. At Makeconfig:42, we have: objdir must be defined by the build-directory Makefile. Change that to use $(error ...), which I guess was the original intention. The result is: $ make ../Makeconfig:42: *** objdir must be defined by the build-directory Makefile. Stop.
* manual: Fix typos in the fexecve descriptionFlorian Weimer2020-04-291-1/+1
| | | | Reported by Michael Kerrisk.
* misc: Remove sstk from the autogenerated system call listFlorian Weimer2020-04-283-2/+5
| | | | | | | | | | This change should not have an effect because the system call was never defined. Also add the misssing attribute_compat_text_section attribute to the sstk function (a minor optimization). Also update the NEWS file to document the change. Fixes commit 9cc93ba0973ad04ee26c515a1552afb85e73c6ba ("misc: Turn sstk into a compat symbol").
* Remove unused floating-point configuration from gmp-impl.h.Joseph Myers2020-04-282-52/+0
| | | | | | | | | | | | | | | This patch removes the IEEE_DOUBLE_BIG_ENDIAN and IEEE_DOUBLE_MIXED_ENDIAN macros from gmp-impl.h and gmp-mparam.h, and the ieee_double_extract union from gmp-impl.h. The macros were used only in defining the union, which was used nowhere in glibc. As GMP's gmp-impl.h is over 5000 lines, the file in glibc is so far from the GMP version that it doesn't seem to make sense to keep things there that are not relevant in glibc. (I expect there is plenty more in the header after this patch that is also not relevant in glibc and can be cleaned up later.) Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch.
* support: Implement <support/xthread.h> key create/deleteMathieu Desnoyers2020-04-274-0/+56
| | | | | Expose xpthread_key_create and xpthread_key_delete wrappers for tests.
* nptl/tst-setuid1-static: Improve isolation from system objectsFlorian Weimer2020-04-271-0/+5
| | | | | Static dlopen needs an LD_LIBRARY_PATH setting to avoid loading system libraries.
* Increase the timeout of locale/tst-localedef-path-normSzabolcs Nagy2020-04-271-0/+1
| | | | | | | | | On the current AArch64 buildbot the default 20s timeout is not enough to run this test, it seems make test t=locale/tst-localedef-path-norm takes about 25s, so i increased the timeout to 30s.
* Use 2020 as copyright year.Carlos O'Donell2020-04-273-3/+3
| | | | | Use the year 2020 for files added by commit: 92954ffa5a5662fbfde14febd7e5dcc358c85470
* misc: Turn sstk into a compat symbolFlorian Weimer2020-04-271-7/+4
| | | | | | It is not implemented anywhere. There is an osf_sstk system call on alpha, but it is not used to implement sstk, and the system call is not implemented on Linux, either.
* manual: Document the fexecve functionFlorian Weimer2020-04-271-0/+13
|
* nptl: Start new threads with all signals blocked [BZ #25098]Florian Weimer2020-04-272-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | New threads inherit the signal mask from the current thread. This means that signal handlers can run on the newly created thread immediately after the kernel has created the userspace thread, even before glibc has initialized the TCB. Consequently, new threads can observe uninitialized ctype data, among other things. To address this, block all signals before starting the thread, and pass the original signal mask to the start routine wrapper. On the new thread, first perform all thread initialization, and then unblock signals. The cost of doing this is two rt_sigprocmask system calls on the old thread, and one rt_sigprocmask system call on the new thread. (If there was a way to clone a new thread with a signals disabled, this could be brought down to one system call each.) The thread descriptor increases in size, too, and sigset_t is fairly large. This increase could be brought down by reusing space the in the descriptor which is not needed before running user code, or by switching to an internal sigset_t definition which only covers the signals supported by the kernel definition. (Part of the thread descriptor size increase is already offset by reduced stack usage in the thread start wrapper routine after this commit.) Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* localedef: Add verbose messages for failure paths.Carlos O'Donell2020-04-2611-75/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During testing of localedef running in a minimal container there were several error cases which were hard to diagnose since they appeared as strerror (errno) values printed by the higher level functions. This change adds three new verbose messages for potential failure paths. The new messages give the user the opportunity to use -v and display additional information about why localedef might be failing. I found these messages useful myself while writing a localedef container test for --no-hard-links. Since the changes cleanup the code that handle codeset normalization we add tst-localedef-path-norm which contains many sub-tests to verify the correct expected normalization of codeset strings both when installing to default paths (the only time normalization is enabled) and installing to absolute paths. During the refactoring I created at least one buffer-overflow which valgrind caught, but these tests did not catch because the exec in the container had a very clean heap with zero-initialized memory. However, between valgrind and the tests the results are clean. The new tst-localedef-path-norm passes without regression on x86_64. Change-Id: I28b9f680711ff00252a2cb15625b774cc58ecb9d
* Remove most gmp-mparam.h headers.Joseph Myers2020-04-245-146/+0
| | | | | | | | | | | | | | Most gmp-mparam.h headers in glibc define various macros to the same values they would be defined to by the generic version of that header, plus macros IEEE_DOUBLE_BIG_ENDIAN or IEEE_DOUBLE_MIXED_ENDIAN related to the representation of double. The latter macros are in turn only used in gmp-impl.h to define union ieee_double_extract, which is not used in glibc. Thus all of these headers, except for the generic one and those that define _LONG_LONG_LIMB for ILP32 configurations with 64-bit registers, are redundant, and this patch removes them. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch.
* elf: Implement __libc_early_initFlorian Weimer2020-04-2413-10/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is defined in libc.so, and the dynamic loader calls right after relocation has been finished, before any ELF constructors or the preinit function is invoked. It is also used in the static build for initializing parts of the static libc. To locate __libc_early_init, a direct symbol lookup function is used, _dl_lookup_direct. It does not search the entire symbol scope and consults merely a single link map. This function could also be used to implement lookups in the vDSO (as an optimization). A per-namespace variable (libc_map) is added for locating libc.so, to avoid repeated traversals of the search scope. It is similar to GL(dl_initfirst). An alternative would have been to thread a context argument from _dl_open down to _dl_map_object_from_fd (where libc.so is identified). This could have avoided the global variable, but the change would be larger as a result. It would not have been possible to use this to replace GL(dl_initfirst) because that global variable is used to pass the function pointer past the stack switch from dl_main to the main program. Replacing that requires adding a new argument to _dl_init, which in turn needs changes to the architecture-specific libc.so startup code written in assembler. __libc_early_init should not be used to replace _dl_var_init (as it exists today on some architectures). Instead, _dl_lookup_direct should be used to look up a new variable symbol in libc.so, and that should then be initialized from the dynamic loader, immediately after the object has been loaded in _dl_map_object_from_fd (before relocation is run). This way, more IFUNC resolvers which depend on these variables will work. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* elf: Introduce <elf_machine_sym_no_match.h>Florian Weimer2020-04-244-23/+79
| | | | | | | | | | | MIPS needs to ignore certain existing symbols during symbol lookup. The old scheme uses the ELF_MACHINE_SYM_NO_MATCH macro, with an inline function, within its own header, with a sysdeps override for MIPS. This allows re-use of the function from another file (without having to include <dl-machine.h> or providing the default definition for ELF_MACHINE_SYM_NO_MATCH). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Add a syscall test for [BZ #25810]H.J. Lu2020-04-222-1/+168
| | | | | | | Add a test to pass 64-bit long arguments to syscall with undefined upper 32 bits on x32. Tested on i386, x86-64 and x32 as well as with build-many-glibcs.py.
* elf: Support lld-style link map for librtld.mapFangrui Song2020-04-211-1/+2
| | | | | | | | | | | | | GNU ld and gold's -Map include a line like: path/to/build/libc_pic.a(check_fds.os) lld -Map does not have the archive member list, but we can still derive the members from the following output VMA LMA Size Align Out In Symbol ... 1a1c0 1a1c0 e2 16 path/to/build/libc_pic.a(check_fds.os):(.text)
* signal: Only handle on NSIG signals on signal functions (BZ #25657)Adhemerval Zanella2020-04-218-94/+246
| | | | | | | | | | | | | | | The upper bits of the sigset_t s not fully initialized in the signal mask calls that return information from kernel (sigprocmask, sigpending, and pthread_sigmask), since the exported sigset_t size (1024 bits) is larger than Linux support one (64 or 128 bits). It might make sigisemptyset/sigorset/sigandset fail if the mask is filled prior the call. This patch changes the internal signal function to handle up to supported Linux signal number (_NSIG), the remaining bits are untouched. Checked on x86_64-linux-gnu and i686-linux-gnu.
* linux: Use pthread_sigmask on sigprocmaskAdhemerval Zanella2020-04-214-15/+27
| | | | | | | With pthread_sigmask on libc.so, it allows implement sigprocmask on top of pthread_sigmask. Checked on x86_64-linux-gnu.
* ia64: Remove sigprocmask/sigblock objects from libpthreadAdhemerval Zanella2020-04-212-4/+3
| | | | | | | | | | | | | It is required because __libc_unwind_longjmp (used on thread cancellation) calls __sigprocmask. Replace with a direct call. They are required because __libc_unwind_longjmp (used for thread cancellation) calls __sigprocmask. Replace this with a direct call. The sigblock function is not exported and is not used internally, so it can be removed. Checked on cross build for ia64-linux-gnu.
* nptl: Move pthread_sigmask implementation to libcAdhemerval Zanella2020-04-2161-34/+77
| | | | | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> A new symbol version is added on libc to force loading failure instead of lazy binding one for newly binaries with old loaders. Checked with a build against all affected ABIs.
* Bug 25819: Update to Unicode 13.0.0Mike FABIAN2020-04-2115-1439/+3838
| | | | | | | | | Unicode 13.0.0 Support: Character encoding, character type info, and transliteration tables are all updated to Unicode 13.0.0, using the generator scripts contributed by Mike FABIAN (Red Hat). Total added characters in newly generated CHARMAP: 5930 Total added characters in newly generated WIDTH: 5536
* ARC: Update syscall-names.list for ARC specific syscallsVineet Gupta2020-04-201-0/+3
|
* Revert "x86_64: Add SSE sfp-exceptions"Adhemerval Zanella2020-04-202-60/+1
| | | | | | | | | | | The __sfp_handle_exceptions is not fully correct regarding raising exceptions, since there is no direct way to raise only FP_EX_OVERFLOW nor FP_EX_UNDERFLOW for SSE mode. Both libgcc and feraiseexcept rely on x87 mode to accomplish it. This reverts commit 460ee50de054396cc9791ff4cfdc2f5029fb923d. Checked on x86_64.
* provide y2038 safe socket constants for default/asm-generic ABIVineet Gupta2020-04-191-2/+14
| | | | | | | These will be used by upcoming RV32 and ARC ports and any future ports. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
* x86_64: Add SSE sfp-exceptionsAdhemerval Zanella2020-04-172-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | The exported x86_64 fenv.h functions operate on both i387 and SSE (since they should work on both float, double, and long double) while the internal libc_fe* set either SSE (float, double, and float128) or i387 (long double). The libgcc __sfp_handle_exceptions (used on float128 implementation), however, will set either SEE or i387 exception depending of the exception to raise. This broke the internal assumption of float128 where only SSE operations will be used. This patch reimplements the libgcc __sfp_handle_exceptions to use only SSE operations and sets libgcc to use it instead of its own implementation. And I think we should fix libgcc in a similar manner, since checking on config/i386/64/sfp-machine.h it already only supports SSE rounding mode and x86_64 ABI also expectes float128 to use SSE registers [1] (although it is not clear on how future implementation might implement it). Checked on x86_64-linux-gnu. [1] https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
* Remove __NO_MATH_INLINESAdhemerval Zanella2020-04-176-26/+3
| | | | | | With fenvinline.h removal the flag is not used anymore. Checked on x86_64-linux-gnu.
* i686: Add INTERNAL_SYSCALL_NCS 6 argument supportAdhemerval Zanella2020-04-171-30/+49
| | | | | | | | It is required for i686 BZ#12683 support when building with -Os or -fno-omit-frame-pointer on some gcc versions. It is not used on current code. Check on i686-linux-gnu.
* Reset converter state after second wchar_t output (Bug 25734)Carlos O'Donell2020-04-153-4/+176
| | | | | | | | | | | | | An input BIG5-HKSCS character may be converted into at most 2 wchar_t characters. After outputting the second whcar_t character (which was saved in the converter state) we must reset the state. If we fail to reset the state we will be stuck continually copying that character to the output even if we have further input to consider. We add a new test case that covers the 4 BIG5-HKSCS characters that may become 2 wchar_t characters. Reviewed-by: Tom Honermann <tom@honermann.net>
* Fix typo in posix/tst-fnmatch.input (Bug 25790)Carlos O'Donell2020-04-151-1/+1
| | | | Reported-by: Michael Builov <mbuilov@gmail.com>
* Linux: Remove <sys/sysctl.h> and the sysctl functionFlorian Weimer2020-04-1514-277/+51
| | | | | | | | | | | | | | | Linux 5.5 remove the system call in commit 61a47c1ad3a4dc6882f01ebdc88138ac62d0df03 ("Linux: Remove <sys/sysctl.h>"). Therefore, the compat function is just a stub that sets ENOSYS. Due to SHLIB_COMPAT, new ports will not add the sysctl function anymore automatically. x32 already lacks the sysctl function, so an empty sysctl.c file is used to suppress it. Otherwise, a new compat symbol would be added. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* posix: Add wait4 test caseAlistair Francis2020-04-142-1/+211
| | | | Add a wait4 test case based on the waitid test case.
* linux: wait4: Fix incorrect return value comparisonAlistair Francis2020-04-141-10/+9
| | | | | | | | | | Patch 600f00b "linux: Use long time_t for wait4/getrusage" introduced two bugs: - The usage32 struct was set if the wait4 syscall had an error. - For 32-bit systems the usage struct was set even if it was specified as NULL. This patch fixes the two issues.
* hurd: add mach_print functionSamuel Thibault2020-04-142-0/+4
| | | | | * mach/Versions (GLIBC_2.32): Add mach_print. * sysdeps/mach/hurd/i386/libc.abilist (GLIBC_2.32): Add mach_print.
* x32: Properly pass long to syscall [BZ #25810]H.J. Lu2020-04-132-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X32 has 32-bit long and pointer with 64-bit off_t. Since x32 psABI requires that pointers passed in registers must be zero-extended to 64bit, x32 can share many syscall interfaces with LP64. When a LP64 syscall with long and unsigned long arguments is used for x32, these arguments must be properly extended to 64-bit. Otherwise if the upper 32 bits of the register have undefined value, such a syscall will be rejected by kernel. Enforce zero-extension for pointers and array system call arguments. For integer types, extend to int64_t (the full register) using a regular cast, resulting in zero or sign extension based on the signedness of the original type. For void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); we now generate 0: 41 f7 c1 ff 0f 00 00 test $0xfff,%r9d 7: 75 1f jne 28 <__mmap64+0x28> 9: 48 63 d2 movslq %edx,%rdx c: 89 f6 mov %esi,%esi e: 4d 63 c0 movslq %r8d,%r8 11: 4c 63 d1 movslq %ecx,%r10 14: b8 09 00 00 40 mov $0x40000009,%eax 19: 0f 05 syscall That is 1. addr is unchanged. 2. length is zero-extend to 64 bits. 3. prot is sign-extend to 64 bits. 4. flags is sign-extend to 64 bits. 5. fd is sign-extend to 64 bits. 6. offset is unchanged. For int arguments, since kernel uses only the lower 32 bits and ignores the upper 32 bits in 64-bit registers, these work correctly. Tested on x86-64 and x32. There are no code changes on x86-64.
* Add GRND_INSECURE from Linux 5.6 to sys/random.hJoseph Myers2020-04-092-0/+4
| | | | | | | | | | This patch adds the GRND_INSECURE constant from Linux 5.6 to glibc's sys/random.h. This is also added to the documentation. The constant acts as a no-op for the Hurd implementation (as that doesn't check whether the flags are known), which is semantically fine, while older Linux kernels reject unknown flags with an EINVAL error. Tested for x86_64.
* Update kernel version to 5.6 in tst-mman-consts.py.Joseph Myers2020-04-091-1/+1
| | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.6. (There are no new constants covered by this test in 5.6 that need any other header changes.) Tested with build-many-glibcs.py.
* Update mips libm-test-ulpsAdhemerval Zanella2020-04-082-54/+56
|
* Update alpha libm-test-ulpsAdhemerval Zanella2020-04-081-27/+28
|
* Update ia64 libm-test-ulpsAdhemerval Zanella2020-04-081-15/+17
|
* Update sparc libm-test-ulpsAdhemerval Zanella2020-04-081-27/+28
|