about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "hurd: Fix mach installed headers test"Samuel Thibault2018-04-205-8/+4
| | | | | This reverts commit d4379e0216d01fd1395b1f3b37255e3486760135: the proper headers are actually already getting installed.
* Drop fpregset unused symbol expositionSamuel Thibault2018-04-206-5/+11
| | | | | | | | | * sysdeps/arm/sys/ucontext.h: Remove fpregset struct name, unused and non-compliant. * sysdeps/i386/sys/ucontext.h: Likewise. * sysdeps/m68k/sys/ucontext.h: Likewise. * sysdeps/mips/sys/ucontext.h: Likewise. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Likewise.
* hurd: Fix hurd installed headers testSamuel Thibault2018-04-204-1/+11
| | | | | | | * sysdeps/hurd/include/hurd.h [!_ISOMAC]: Do not declare libc hidden prototypes. * sysdeps/hurd/include/hurd/fd.h [!_ISOMAC]: Likewise. * sysdeps/hurd/include/hurd/signal.h [!_ISOMAC]: Likewise.
* hurd: Add missing RLIM_SAVED_MAX/CURSamuel Thibault2018-04-192-0/+5
| | | | * bits/resource.h (RLIM_SAVED_MAX, RLIM_SAVED_CUR): New macros.
* hurd: Fix termios.h symbolsSamuel Thibault2018-04-192-3/+13
| | | | | | | * bits/termios.h [__USE_XOPEN || __USE_XOPEN2K8] (IXANY): Define. [__USE_XOPEN && !__USE_XOPEN2K] (IUCLC, OLCUC): Define. [__USE_XOPEN] (OFDEL): New macro. [__USE_XOPEN && !__USE_XOPEN2K] (XCASE): New macro.
* hurd: remove non-standard siginfo symbolSamuel Thibault2018-04-192-1/+3
| | | | | * bits/types/siginfo_t.h: Remove siginfo struct name, unused and non-compliant.
* hurd: fix sigevent's sigev_notify_attributes field typeSamuel Thibault2018-04-192-2/+23
| | | | | | * sysdeps/pthread/bits/types/sigevent_t.h: New file, based on the generic version but include <bits/pthreadtypes.h> to make struct sigevent's sigev_notify_attributes field a pthread_attr_t*.
* Update sysdeps/nios2/libm-test-ulpsChung-Lin Tang2018-04-192-8/+20
|
* hurd: Avoid exposing all <sched.h> symbols from sys/types.hSamuel Thibault2018-04-196-12/+39
| | | | | | | | | | * bits/sched.h: Include <bits/types/struct_sched_param.h> and move struct sched_param definition to it. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * bits/types/struct_sched_param.h: New file. * sysdeps/htl/bits/types/struct___pthread_attr.h: Include <bits/types/struct_sched_param.h> instead of <sched.h>. * posix/Makefile (headers): Add bits/types/struct_sched_param.h.
* Fix mips64n32 getdents aliasAdhemerval Zanella2018-04-192-0/+5
| | | | | | | Fix commit 298d0e3 for mips64n32, checked on a mips64n32-linux-gnu build. * sysdeps/unix/sysv/linux/mips/mips64/getdents64.c (__getdents64): Only alias to __getdents for _DIRENT_MATCHES_DIRENT64.
* hurd: Fix symbols expositionSamuel Thibault2018-04-195-3/+13
| | | | | | | | | * bits/in.h [!__USE_MISC]: Do not define struct ip_opts. * conform/data/netinet/in.h-data: Allow sin_ and sin6_ prefix. * sysdeps/gnu/bits/msq.h (struct msqid_ds): Use __wait_queue struct instead of wait_queue. * sysdeps/gnu/bits/shm.h (struct shmid_ds): Use __vm_area_struct instead of vm_area_struct.
* Consolidate Linux getdents{64} implementationAdhemerval Zanella2018-04-1919-450/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates Linux getdents{64} implementation on just the default sysdeps/unix/sysv/linux/getdents{64}{_r}.c ones. Although this symbol is used only internally, the non-LFS version still need to be build due the non-LFS getdirentries which requires its semantic. The non-LFS default implementation now uses the wordsize-32 as base which uses getdents64 syscall plus adjustment for overflow (it allows to use the same code for architectures that does not support non-LFS getdents syscall). It has two main differences to wordsize-32 one: - DIRENT_SET_DP_INO is added to handle alpha requirement to zero the padding. - alloca is removed by allocating a bounded temporary buffer (it increases stack usage by roughly 276 bytes). The default implementation handle the Linux requirements: * getdents is only built for _DIRENT_MATCHES_DIRENT64 being 0. * getdents64 is always built and aliased to getdents for ABIs that define _DIRENT_MATCHES_DIRENT64 to 1. * A compat symbol is added for getdents64 for ABI that used to export the old non-LFS version. Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/alpha/getdents.c: Add comments with alpha requirements. (_DIRENT_MATCHES_DIRENT64): Undef * sysdeps/unix/sysv/linux/alpha/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/arm/getdents64.c: Remove file. * sysdeps/unix/sysv/linux/generic/getdents.c: Likewise. * sysdeps/unix/sysv/linux/generic/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c: Likewise. * sysdeps/unix/sysv/linux/getdents.c: Simplify implementation by use getdents64 syscalls as base. * sysdeps/unix/sysv/linux/getdents64.c: Likewise and add compatibility symbol if required. * sysdeps/unix/sysv/linux/hppa/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/i386/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/getdents.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c (__get_clockfreq_via_proc_openprom): Use __getdents64. * sysdeps/unix/sysv/linux/mips/mips64/getdents64.c: New file.
* Disable lock elision for mutex pretty printer tests.Stefan Liebler2018-04-192-0/+7
| | | | | | | | | | | | | | | | | | | | | If e.g. the testcase nptl/test-mutex-printers is run with enabled lock-elision, it fails on s390x with: Error: Response does not match the expected pattern. Command: print *mutex Expected pattern: pthread_mutex_t Response: No symbol "mutex" in current context. (gdb) See https://www.sourceware.org/ml/libc-alpha/2018-03/msg00583.html for more details. In fact the mutex pretty printer tests rely on looking at the internal details of the lock, thus we disable it by setting up the GLIB_TUNABLES environment variable inside gdb. ChangeLog: * scripts/test_printers_common.py (init_test): Disable lock elision.
* Use volatile global counters in test-tgmath.c.Stefan Liebler2018-04-192-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | If build with -Os on s390x, the test-tgmath fails with: float functions not called often enough (-10000) Within compile_testf(), the counter (count_float) is saved before the complex functions are called. Afterwards the saved counter differs to the current-counter. But the tests with the complex functions do not increment count_float! Instead count_float is saved to a register before calling totalorder and totalordermag which both increment count_float. The compiler is allowed to do that as totalorderf and totalordermagf is declared with __attribute__ ((__const__)) in math/bits/mathcalls.h. Thus this patch adjusts the global counters to be volatile. Then count_float is saved after totalordermag. ChangeLog: * math/test-tgmath.c (count_double, count_float, count_ldouble, count_cdouble, count_cfloat, count_cldouble): Use volatile int.
* hurd: Update struct statfs according to struct statvfsSamuel Thibault2018-04-192-8/+10
| | | | | | | * sysdeps/mach/hurd/bits/statfs.h (struct statfs): Make f_bsize, f_namemax, f_frsize, and f_flag fields unsigned long int instead of unsigned int. (struct statfs64): Likewise.
* hurd: Fix standard compliance of some statvfs fieldsSamuel Thibault2018-04-192-8/+12
| | | | | | | | | | | | Standards require that the f_bsize, f_frsize, f_flag and f_namemax fields be unsigned long. They used to be only unsigned on hurd, which happens to be compatible with unsigned long on the only existing, 32bit, port. We can thus merely fix the type. * sysdeps/mach/hurd/bits/statvfs.h (struct statvfs): Make f_bsize, f_namemax, f_frsize, and f_flag fields unsigned long int instead of unsigned int. (struct statvfs64): Likewise.
* hurd: xfail some structure fields ABI incompatibility with standardsSamuel Thibault2018-04-198-12/+38
| | | | | | | | | | | | | | | * sysdeps/mach/hurd/i386/Makefile [$(subdir) = conform] (conformtest-xfail-conds): Add i386-gnu. * conform/data/fcntl.h-data (flock.l_type, flock.l_whence): XFAIL for i386-gnu. * conform/data/sys/ipc.h-data (ipc_perm.uid, ipc_perm.gid, ipc_perm.cuid, ipc_perm.cgid): Likewise. * conform/data/sys/msg.h-data (msqid_ds.msg_lspid, msqid_ds.msg_lrpid): Likewise. * conform/data/sys/shm.h-data (shmid_ds.shm_lpid, shmid_ds.shm_cpid): Likewise. * conform/data/sys/stat.h-data (stat.st_dev): Likewise. * conform/data/sys/statvfs.h-data (statvfs.f_fsid): Likewise.
* hurd: Fix mach installed headers testSamuel Thibault2018-04-195-0/+13
| | | | | | | | * include/lock-intern.h [!_ISOMAC]: Do not declare libc hidden prototypes. * include/mach.h [!_ISOMAC]: Likewise. * include/mach/mig_support.h [!_ISOMAC]: Likewise. * include/mach_error.h [!_ISOMAC]: Likewise.
* Revert "Fix sched_param"Samuel Thibault2018-04-199-66/+17
| | | | | This reverts commit 783c4820303fb6b031d401564f8089ecaf154b62 which accidentaly flew out.
* conform sys/un.h: Allow sun_ prefix, not only sun_lenSamuel Thibault2018-04-182-3/+3
| | | | * conform/data/sys/un.h-data: Allow sun_ prefix.
* Fix sched_paramSamuel Thibault2018-04-189-17/+66
|
* Make build-many-glibcs.py build GCC for powerpcspe with --enable-obsolete.Joseph Myers2018-04-182-2/+8
| | | | | | | | | | | | | | | The powerpcspe GCC port has been obsoleted in GCC 8 for not having had the removal of code for non-SPE processors completed. This patch accordingly arranges for build-many-glibcs.py to configure GCC with --enable-obsolete for affected configurations. This is temporary; either the port gets cleaned up and unobsoleted in GCC and the configure option can be removed, or the port gets removed in GCC and we should remove the corresponding glibc support. Tested with build-many-glibcs.py for the affected configurations. * scripts/build-many-glibcs.py (Context.add_all_configs): Use --enable-obsolete for powerpc-linux-gnuspe.
* hurd: Fix spurious installation of headers defining hidden prototypesSamuel Thibault2018-04-185-0/+4
| | | | | | | * sysdeps/mach/include/lock-intern.h: Move to include/. * sysdeps/mach/include/mach.h: Move to include/. * sysdeps/mach/include/mach/mig_support.h: Move to include/mach/. * sysdeps/mach/include/mach_error.h: Move to include/.
* hurd: fix conformity test for sys/un.hSamuel Thibault2018-04-182-0/+6
| | | | | | | sun_len is used by BSD systems, and conformant. * conform/data/sys/un.h-data (struct sockaddr_un): Allow sun_len member.
* arm: Remove ununsed ARM code in optimized implementationAdhemerval Zanella2018-04-165-86/+8
| | | | | | | | | | | | | | | | | This patch removes the ununsed ARM code path for armv6t2 memchr and strlen and armv7 memch and strcmp. In all implementation, the ARM code is not used in any possible build (unless glibc is explicit build with the non-documented NO_THUMB compiler flag) and for armv7 the resulting code either produces wrong results (memchr) and throw build error (strcmp). Checked on arm-linux-gnueabihf built targeting both armv6 and armv7. * sysdeps/arm/armv6t2/memchr.S (memchr): Remove ARM code path. * sysdeps/arm/armv6t2/strlen.S (memchr): Likewise. * sysdeps/arm/armv7/multiarch/memchr_neon.S (memchr): Likewise. * sysdeps/arm/armv7/strcmp.S (strcmp): Likewise.
* Add aliases to recognize normalized charset names (bug 19527)Andreas Schwab2018-04-162-0/+7
|
* Improves __ieee754_exp(x) performance by 18-37% when |x| < 1.0397Patrick McGehearty2018-04-153-7/+216
| | | | | | | | | | | | | | | | | | | | | | Adds a fast path to e_exp.c when |x| < 1.03972053527832. When values are tested in isolation, reduction in execution time is: aarch 30%, sparc 18%, x86 37%. When comparing benchtests/bench.out which includes values outside that range, the gains are: aarch 8%, sparc 5%, x86 9%. make check is clean (no increase in ulp for any math test). Testing 20M values for each rounding mode in that range shows approximately one in 200 values is off by 1 ulp. No value tested for exp(x) changed by 2 or more ulp. No observed change in performance or accuracy for x outside fast path range. These changes will be active for all platforms that don't provide their own exp() routines. They will also be active for ieee754 versions of ccos, ccosh, cosh, csin, csinh, sinh, exp10, gamma, and erf.
* Update kernel version in syscall-names.list to 4.16.DJ Delorie2018-04-122-2/+7
| | | | | | | | | | | | Linux 4.16 does not add any new syscalls; this patch updates the version number in syscall-names.list to reflect that it's still current for 4.16. Tested for x86_64 (compilation with build-many-glibcs.py, using Linux 4.16). * sysdeps/unix/sysv/linux/syscall-names.list: Update kernel version to 4.16.
* S390: Fix struct sigaction for 31bit in kernel_sigaction.h.Stefan Liebler2018-04-122-6/+16
| | | | | | | | | | | | | | | | | | | The recent commit b4a5d26d8835d972995f0a0a2f805a8845bafa0b "linux: Consolidate sigaction implementation" changed the definition of struct sigaction for s390 (31bit). Unfortunately the order of the fields were wrong. This leads to blocking testcases e.g. nptl/tst-sem11. A thread which blocks due to sem_wait() is cancelled via pthread_cancel() and the signal-handler sigcancel_handler (see <glibc-src>/nptl/nptl-init.c is called. But it just returns as the siginfo_t argument is not setup by the kernel. Then the main-thread is blocking due to pthread_join(). The flag SA_SIGINFO is set in sa_flags in struct sigaction and is copied to the "kernel_sigaction.h" struct by the sigaction() call, but due to the wrong ordering of the struct fields, the kernel does not recognize it.
* resolv: Fully initialize struct mmsghdr in send_dg [BZ #23037]Florian Weimer2018-04-092-19/+27
|
* Consolidate Linux readdir{64}{_r} implementationAdhemerval Zanella2018-04-0621-80/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates Linux readdir{64}{_r} implementation on just the default sysdeps/unix/sysv/linux/readdir{64}{_r}.c ones. The default implementation handle the Linux requirements: * readdir{_r} is only built for _DIRENT_MATCHES_DIRENT64 being 0. * readdir64{_r} is always built and aliased to readdir{_r} for ABI that define _DIRENT_MATCHES_DIRENT64. * A compat symbol is added for readdir64{_r} for ABI that used to export the old non-LFS version. Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and powerpc64le-linux-gnu. * sysdeps/posix/readdir.c (__READDIR, __GETDENTS, DIRENTY_TYPE, __READDIR_ALIAS): Undefine after usage. * sysdeps/posix/readdir_r.c (__READDIR_R, __GETDENTS, DIRENT_TYPE, __READDIR_R_ALIAS): Likewise. * sysdeps/unix/sysv/linux/arm/readdir64.c: Remove file. * sysdeps/unix/sysv/linux/arm/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/m68k/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Likewise. * sysdeps/unix/sysv/linux/readdir.c: New file. * sysdeps/unix/sysv/linux/readdir_r.c: Likewise. * sysdeps/unix/sysv/linux/readdir64.c: Add compat symbol if required. * sysdeps/unix/sysv/linux/readdir64_r.c: Likewise.
* Update i386 libm-test-ulps.Adhemerval Zanella2018-04-062-4/+14
| | | | | | | | Updated ulps after recent commit "[PATCH 1/7] sin/cos slow paths: avoid slow paths for small inputs" (19a8b9a300f2f1f0012aff0f2b70b09430f50d9e). * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Update.
* Fix missing @ before texinfo commandAndreas Schwab2018-04-062-1/+5
|
* Update SPARC libm-test-ulps.Adhemerval Zanella2018-04-052-0/+8
| | | | * sysdeps/sparc/fpu/libm-test-ulps: Update.
* Update ARM libm-test-ulps.Adhemerval Zanella2018-04-052-0/+10
| | | | * sysdeps/arm/libm-test-ulps: Update.
* linux: Consolidate sigaction implementationAdhemerval Zanella2018-04-0522-585/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all Linux sigaction implementations on the default sysdeps/unix/sysv/linux/sigaction.c. The idea is remove redundant code and simplify new ports addition by following the current generic Linux User API (UAPI). The UAPI for new ports defines a generic extensible sigaction struct as: struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; #ifdef SA_RESTORER void (*sa_restorer) (void); #endif sigset_t sa_mask; }; Where SA_RESTORER is just placed for compatibility reasons (news ports should not add it). A similar definition is used on generic kernel_sigaction.h. The user exported sigaction definition is not changed, so for most architectures it requires an adjustment to kernel expected one for the syscall. The main changes are: - All architectures now define and use a kernel_sigaction struct meant for the syscall, even for the architectures where the user sigaction has the same layout of the kernel expected one (s390-64 and ia64). Although it requires more work for these architectures, it simplifies the generic implementation. Also, sigaction is hardly a hotspot where micro optimization would play an important role. - The generic kernel_sigaction definition is now aligned with expected UAPI one for newer ports, where SA_RESTORER and sa_restorer are not expected to be defined. This means adding kernel_sigaction for current architectures that does define it (m68k, nios2, powerpc, s390, sh, sparc, and tile) and which rely on previous generic definition. - Remove old MIPS usage of sa_restorer. This was removed since 2.6.27 (2957c9e61ee9c - "[MIPS] IRIX: Goodbye and thanks for all the fish"). - The remaining arch-specific sigaction.c are to handle ABI idiosyncrasies (like SPARC kernel ABI for rt_sigaction that requires an additional stub argument). So for new ports the generic implementation should work if its uses Linux UAPI. If SA_RESTORER is still required (due some architecture limitation), it should define its own kernel_sigaction.h, define it and include generic header (assuming it still uses the default generic kernel layout). Checked on x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabihf, aarch64-linux-gnu, sparc64-linux-gnu, sparcv9-linux-gnu, powerpc-linux-gnu, powerpc64-linux-gnu, ia64-linux-gnu and alpha-linux-gnu. I also checked the build on all remaining affected ABIs. * sysdeps/unix/sysv/linux/aarch64/sigaction.c: Use default Linux version as base implementation. * sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h: Add include guards, remove unrequired definitions and update comments. * sysdeps/unix/sysv/linux/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/mips/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h: New file. * sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel_sigaction: Likewise. * sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sh/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/tile/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/ia64/sigaction.c: Remove file. * sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sigaction.c: Add STUB, SET_SA_RESTORER, and RESET_SA_RESTORER hooks.
* S390: Regenerate ULPs.Stefan Liebler2018-04-052-0/+10
| | | | | | | | | | Updated ulps after recent commit "[PATCH 1/7] sin/cos slow paths: avoid slow paths for small inputs" (19a8b9a300f2f1f0012aff0f2b70b09430f50d9e). ChangeLog: * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
* manual: Various fixes to the mbstouwcs example, and mbrtowc updateFlorian Weimer2018-04-053-43/+88
| | | | | | | | | | | | | | | | | | | | | | | The example did not work because the null byte was not converted, and mbrtowc was called with a zero-length input string. This results in a (size_t) -2 return value, so the function always returns NULL. The size computation for the heap allocation of the result was incorrect because it did not deal with integer overflow. Error checking was missing, and the allocated memory was not freed on error paths. All error returns now set errno. (Note that there is an assumption that free does not clobber errno.) The slightly unportable comparision against (size_t) -2 to catch both (size_t) -1 and (size_t) -2 return values is gone as well. A null wide character needs to be stored in the result explicitly, to terminate it. The description in the manual is updated to deal with these finer points. The (size_t) -2 behavior (consuming the input bytes) matches what is specified in ISO C11.
* manual: Move mbstouwcs to an example C fileFlorian Weimer2018-04-053-22/+34
|
* Revert "hurd: Avoid PLTs for longjmp & siglongjmp"Samuel Thibault2018-04-054-9/+0
| | | | This reverts commit e5f9508a32426b7c3948dc741d84355071ed9539.
* hurd: Avoid PLT for dirfdSamuel Thibault2018-04-055-0/+8
| | | | | | | * include/dirent.h (dirfd): Add hidden proto. * dirent/dirfd.c (dirfd): Add hidden def. * sysdeps/mach/hurd/dirfd.c (dirfd): Add hidden def. * sysdeps/posix/dirfd.c (dirfd): Add hidden def.
* hurd: Avoid PLTs for longjmp & siglongjmpSamuel Thibault2018-04-044-0/+12
| | | | | | * include/setjmp.h (longjmp, siglongjmp): Add hidden protos. * setjmp/longjmp.c (longjmp, siglongjmp): Add hidden defs. * sysdeps/s390/longjmp.c (longjmp, siglongjmp): Add hidden defs.
* powerpc: Update sin, cos and sincos ULPsTulio Magno Quites Machado Filho2018-04-042-0/+11
| | | | | | | * sysdeps/powerpc/fpu/libm-test-ulps: Increase double-precision sin, cos and sincos to 1 ULP. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* elf: Correct absolute (SHN_ABS) symbol run-time calculation [BZ #19818]Maciej W. Rozycki2018-04-047-3/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not relocate absolute symbols by the base address. Such symbols have SHN_ABS as the section index and their value is not supposed to be affected by relocation as per the ELF gABI[1]: "SHN_ABS The symbol has an absolute value that will not change because of relocation." The reason for our non-conformance here seems to be an old SysV linker bug causing symbols like _DYNAMIC to be incorrectly emitted as absolute symbols[2]. However in a previous discussion it was pointed that this is seriously flawed by preventing the lone purpose of the existence of absolute symbols from being used[3]: "On the contrary, the only interpretation that makes sense to me is that it will not change because of relocation at link time or at load time. Absolute symbols, from the days of the earliest linking loaders, have been used to represent addresses that are outside the address space of the module (e.g., memory-mapped addresses or kernel gateway pages). They've even been used to represent true symbolic constants (e.g., system entry point numbers, sizes, version numbers). There's no other way to represent a true absolute symbol, while the meaning you seek is easily represented by giving the symbol a non-negative st_shndx value." and we ought to stop supporting our current broken interpretation. Update processing for dladdr(3) and dladdr1(3) so that SHN_ABS symbols are ignored, because under the corrected interpretation they do not represent addresses within a mapped file and therefore are not supposed to be considered. References: [1] "System V Application Binary Interface - DRAFT - 19 October 2010", The SCO Group, Section "Symbol Table", <http://www.sco.com/developers/gabi/2012-12-31/ch4.symtab.html> [2] Alan Modra, "Absolute symbols" <https://sourceware.org/ml/binutils/2012-05/msg00019.html> [3] Cary Coutant, "Re: Absolute symbols" <https://sourceware.org/ml/binutils/2012-05/msg00020.html> [BZ #19818] * sysdeps/generic/ldsodefs.h (SYMBOL_ADDRESS): Handle SHN_ABS symbols. * elf/dl-addr.c (determine_info): Ignore SHN_ABS symbols. * elf/tst-absolute-sym.c: New file. * elf/tst-absolute-sym-lib.c: New file. * elf/tst-absolute-sym-lib.lds: New file. * elf/Makefile (tests): Add `tst-absolute-sym'. (modules-names): Add `tst-absolute-sym-lib'. (LDLIBS-tst-absolute-sym-lib.so): New variable. ($(objpfx)tst-absolute-sym-lib.so): New dependency. ($(objpfx)tst-absolute-sym): New dependency.
* elf: Unify symbol address run-time calculation [BZ #19818]Maciej W. Rozycki2018-04-0427-50/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap symbol address run-time calculation into a macro and use it throughout, replacing inline calculations. There are a couple of variants, most of them different in a functionally insignificant way. Most calculations are right following RESOLVE_MAP, at which point either the map or the symbol returned can be checked for validity as the macro sets either both or neither. In some places both the symbol and the map has to be checked however. My initial implementation therefore always checked both, however that resulted in code larger by as much as 0.3%, as many places know from elsewhere that no check is needed. I have decided the size growth was unacceptable. Having looked closer I realized that it's the map that is the culprit. Therefore I have modified LOOKUP_VALUE_ADDRESS to accept an additional boolean argument telling it to access the map without checking it for validity. This in turn has brought quite nice results, with new code actually being smaller for i686, and MIPS o32, n32 and little-endian n64 targets, unchanged in size for x86-64 and, unusually, marginally larger for big-endian MIPS n64, as follows: i686: text data bss dec hex filename 152255 4052 192 156499 26353 ld-2.27.9000-base.so 152159 4052 192 156403 262f3 ld-2.27.9000-elf-symbol-value.so MIPS/o32/el: text data bss dec hex filename 142906 4396 260 147562 2406a ld-2.27.9000-base.so 142890 4396 260 147546 2405a ld-2.27.9000-elf-symbol-value.so MIPS/n32/el: text data bss dec hex filename 142267 4404 260 146931 23df3 ld-2.27.9000-base.so 142171 4404 260 146835 23d93 ld-2.27.9000-elf-symbol-value.so MIPS/n64/el: text data bss dec hex filename 149835 7376 408 157619 267b3 ld-2.27.9000-base.so 149787 7376 408 157571 26783 ld-2.27.9000-elf-symbol-value.so MIPS/o32/eb: text data bss dec hex filename 142870 4396 260 147526 24046 ld-2.27.9000-base.so 142854 4396 260 147510 24036 ld-2.27.9000-elf-symbol-value.so MIPS/n32/eb: text data bss dec hex filename 142019 4404 260 146683 23cfb ld-2.27.9000-base.so 141923 4404 260 146587 23c9b ld-2.27.9000-elf-symbol-value.so MIPS/n64/eb: text data bss dec hex filename 149763 7376 408 157547 2676b ld-2.27.9000-base.so 149779 7376 408 157563 2677b ld-2.27.9000-elf-symbol-value.so x86-64: text data bss dec hex filename 148462 6452 400 155314 25eb2 ld-2.27.9000-base.so 148462 6452 400 155314 25eb2 ld-2.27.9000-elf-symbol-value.so [BZ #19818] * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Add `set' parameter. (SYMBOL_ADDRESS): New macro. [!ELF_FUNCTION_PTR_IS_SPECIAL] (DL_SYMBOL_ADDRESS): Use SYMBOL_ADDRESS for symbol address calculation. * elf/dl-runtime.c (_dl_fixup): Likewise. (_dl_profile_fixup): Likewise. * elf/dl-symaddr.c (_dl_symbol_address): Likewise. * elf/rtld.c (dl_main): Likewise. * sysdeps/aarch64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/alpha/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/arm/dl-machine.h (elf_machine_rel): Likewise. (elf_machine_rela): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. (elf_machine_rela): Likewise. * sysdeps/ia64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/microblaze/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/mips/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Likewise. (elf_machine_reloc): Likewise. (elf_machine_got_rel): Likewise. * sysdeps/mips/dl-trampoline.c (__dl_runtime_resolve): Likewise. * sysdeps/nios2/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/riscv/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/tile/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Make sysdeps/generic/internal-signals.h less stubby.Zack Weinberg2018-04-042-3/+20
| | | | | | | | | | | | | | | Three of the functions defined by internal-signals.h were not actually fulfilling their contracts when the sysdeps/generic version of that file was used. Also, the Linux version included several more headers than the generic version, which is the root cause of a build failure on Hurd (already addressed in another way, but I think it is proper to make the headers match). * sysdeps/generic/internal-signals.h: Include signal.h, sigsetops.h, and stdbool.h. (__libc_signal_block_all): Actually block all signals. (__libc_signal_block_app): Likewise. (__libc_signal_restore_set): Actually restore the signal mask.
* inet: Actually build and run tst-deadlineFlorian Weimer2018-04-042-2/+9
|
* hurd: Fix typoSamuel Thibault2018-04-041-1/+1
| | | | * sysdeps/mach/hurd/if_index.c (__if_nametoindex): Fix typo in IFNAMSIZ.
* hurd: fix buildSamuel Thibault2018-04-043-0/+4
| | | | | * signal/sigaddset.c: Include <sigsetopts.h>. * signal/sigdelset.c: Likewise.
* hurd: Add missing symbolsSamuel Thibault2018-04-043-0/+5
| | | | | | * sysdeps/mach/hurd/i386/exc2signal.c (_hurd_exception2signal): Add hidden def. * mach/spin-lock.c (__mutex_unlock): Add hidden def.