about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* 2017-09-01 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov2017-09-012-16/+28
| | | | | * stdlib/tst-atexit-common.c (do_test): Test support for at least 32 atexit handlers.
* math/math.h (HUGE_VAL): Improve commentary.Zack Weinberg2017-09-012-2/+11
|
* Move all old ChangeLogs to a top-level ChangeLog.old directory.Zack Weinberg2017-09-0137-0/+0
|
* linux: Implement tmpfile with O_TMPFILE (BZ#21530)Adhemerval Zanella2017-09-016-10/+92
| | | | | | | | | | | | | | | | | | | | | | This patch adds O_TMPFILE support to tmpfile on Linux. This is similar to the previous suggestion by Andreas Schwab [1] with the difference the file descriptor creation is parameterized to compartmentalize Linux only open flags (O_TMPFILE) on sysdeps. Checked on x86_64-linux-gnu. Adhemerval Zanella <adhemerval.zanella@linaro.org> Andreas Schwab <schwab@suse.de> [BZ #21530] * include/stdio.h (__gen_tempfd): New function. * stdio-common/Makefile (routines): Add gentempfd. * stdio-common/gentempfd.c: New file. * sysdeps/unix/sysv/linux/gentempfd.c: Likewise. * stdio-common/tmpfile.c (tmpfile): First try to use a system specific unnamed file first. [1] https://sourceware.org/ml/libc-alpha/2017-06/msg01293.html
* Remove obsolete notes at top level of source tree.Zack Weinberg2017-09-016-337/+0
| | | | | * BUGS, CONFORMANCE, NAMESPACE, WUR-REPORT: Deleted. * README.pretty-printers, README.tunables: Move to manual/.
* getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922]Florian Weimer2017-09-015-45/+205
| | | | | | The old code uses errno as the primary indicator for success or failure. This is wrong because errno is only set for specific combinations of the status return value and the h_errno variable.
* getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922]Florian Weimer2017-09-012-0/+14
|
* support_chroot_create: Add support for /etc/hosts, /etc/host.confFlorian Weimer2017-09-013-12/+41
|
* getaddrinfo: In gaih_inet, use h_errno for certain status values onlyFlorian Weimer2017-09-012-1/+9
| | | | | h_errno is not set for NSS_STATUS_SUCCESS, so its value might not be accurate at this point.
* getaddrinfo: Properly set errno for NSS function lookup failureFlorian Weimer2017-09-012-6/+15
|
* getaddrinfo: Use &h_errno has the h_errno pointerFlorian Weimer2017-09-012-28/+24
| | | | | | This simplifies the code because it is not necessary to propagate the temporary h_errno value to the thread-local variable. It also increases compatibility with NSS modules which update only one of the two places.
* getaddrinfo: Use &errno has the errno pointerFlorian Weimer2017-09-012-13/+16
| | | | | Similar code in nss/getXXbyYY_r.c is already using &errno as the argument.
* ILP32 math changesSteve Ellcey2017-08-319-12/+110
| | | | | | | | | | | | | | | | | | | | | | * sysdeps/aarch64/fpu/s_llrint.c (OREG_SIZE): New macro. * sysdeps/aarch64/fpu/s_llround.c (OREG_SIZE): Likewise. * sysdeps/aarch64/fpu/s_llrintf.c (OREGS, IREGS): Remove. (IREG_SIZE, OREG_SIZE): New macros. * sysdeps/aarch64/fpu/s_llroundf.c: (OREGS, IREGS): Remove. (IREG_SIZE, OREG_SIZE): New macros. * sysdeps/aarch64/fpu/s_lrintf.c (IREGS): Remove. (IREG_SIZE): New macro. * sysdeps/aarch64/fpu/s_lroundf.c (IREGS): Remove. (IREG_SIZE): New macro. * sysdeps/aarch64/fpu/s_lrint.c (get-rounding-mode.h, stdint.h): New includes. (IREG_SIZE, OREG_SIZE): Initialize if not already set. (OREGS, IREGS): Set based on IREG_SIZE and OREG_SIZE. (__CONCATX): Handle exceptions correctly on large values that may set FE_INVALID. * sysdeps/aarch64/fpu/s_lround.c (IREG_SIZE, OREG_SIZE): Initialize if not already set. (OREGS, IREGS): Set based on IREG_SIZE and OREG_SIZE.
* Remove NO_CANCELLATION macroAdhemerval Zanella2017-08-3121-30/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NO_CANCELLATION macro is used currently on generic headers to define non cancellable syscalls and on Linux fcntl to implement the non cancellable variation. Former should be single-handled by not-cancel.h header and former could be simplified build both cancellable and non cancellable for default objects and alias the non-cancellable to default one for rtld ones (since Linux already support cancellation as default). This patch thus removes the NO_CANCELLATION macro and its usage. The generic non cancellable fcntl is route to internal fcntl. Checked on x86_64-linux-gnu and i686-linux-gnu. Also checked with a build again major ABIs. * sysdeps/generic/not-cancel.h (NO_CANCELLATION): Remove macro. * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (NO_CANCELLATION): Likewise * sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (NO_CANCELLATION): Likewise. * sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Add hidden prototype. * sysdeps/unix/sysv/linux/fcntl.c (__fcntl_nocancel): Define only for !IS_IN (rtld) and remove NO_CANCELLATION usage.
* Change argument type passed to ifunc resolversSteve Ellcey2017-08-312-1/+6
| | | | | * sysdeps/aarch64/dl-irel.h: (elf_ifunc_invoke): Change argument type in resolver call.
* libc-symbols.h: Remove definition of internal_functionFlorian Weimer2017-08-312-7/+4
|
* stdlib: Remove internal_function attributeFlorian Weimer2017-08-312-3/+6
|
* stdio-common: Remove internal_function attributeFlorian Weimer2017-08-313-5/+8
|
* posix: Remove internal_function attributeFlorian Weimer2017-08-3118-261/+198
|
* nptl: Remove internal_function attributeFlorian Weimer2017-08-319-32/+34
|
* io: Remove internal_function attributeFlorian Weimer2017-08-313-27/+19
|
* inet: Remove internal_function attributeFlorian Weimer2017-08-319-15/+20
|
* Simplify NAN definitions.Joseph Myers2017-08-316-127/+16
| | | | | | | | | | | | | | | | | | | | Similar to my patches for HUGE_VAL and INFINITY. this patch eliminates the bits/nan.h headers. __builtin_nanf ("") is used to define NAN for GCC 3.3 and later; the fallback is (0.0f / 0.0f), which is a constant expression for a quiet NaN of type float, but raises a spurious "invalid" exception outside static initializers, which seems the best that can be done purely in standard C. Again, if anyone actually uses a compiler with its own incompatible extension for producing a constant quiet NaN, we can add compiler conditionals. Tested for x86_64. * math/math.h [__USE_ISOC99] (NAN): Define directly here. Do not include <bits/nan.h>. * math/Makefile (headers): Remove bits/nan.h. * bits/nan.h: Remove. * sysdeps/ieee754/bits/nan.h: Likewise. * sysdeps/mips/bits/nan.h: Likewise.
* Simplify INFINITY definitions.Joseph Myers2017-08-315-64/+13
| | | | | | | | | | | | | | | | Similar to my patch for HUGE_VAL, this patch eliminates the bits/inf.h headers and just unconditionally uses the same definitions as the sysdeps/ieee754 version did (__builtin_inff () for GCC >= 3.3, otherwise HUGE_VALF), directly in math.h, so removing an unnecessary level of indirection. Tested for x86_64. * math/math.h [__USE_ISOC99] (INFINITY): Define directly here. Do not include <bits/inf.h>. * math/Makefile (headers): Remove bits/inf.h. * bits/inf.h: Remove. * sysdeps/ieee754/bits/inf.h: Likewise.
* Simplify HUGE_VAL definitions.Joseph Myers2017-08-3114-446/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are various bits/huge_val*.h headers to define HUGE_VAL and related macros. All of them use __builtin_huge_val etc. for GCC 3.3 and later. Then there are various fallbacks, such as using a large hex float constant for GCC 2.96 and later, or using unions (with or without compound literals) to construct the bytes of an infinity, with this last being the reason for having architecture-specific files. Supporting TS 18661-3 _FloatN / _FloatNx types that have the same format as other supported types will mean adding more such macros; needing to add more headers for them doesn't seem very desirable. The fallbacks based on bytes of the representation of an infinity do not meet the standard requirements for a constant expression. At least one of them is also wrong: sysdeps/sh/bits/huge_val.h is producing a mixed-endian representation which does not match what GCC does. This patch eliminates all those headers, defining the macros directly in math.h. For GCC 3.3 and later, the built-in functions are used as now. For other compilers, a large constant 1e10000 (with appropriate suffix) is used. This is like the fallback for GCC 2.96 and later, but without using hex floats (which have no apparent advantage here). It is unambiguously valid standard C for all floating-point formats with infinities, which covers all formats supported by glibc or likely to be supported by glibc in future (C90 DR#025 said that if a floating-point format represents infinities, all real values lie within the range of representable values, so the constraints for constant expressions are not violated), but may generate compiler warnings and wouldn't handle the TS 18661-1 FENV_ROUND pragma correctly. If someone is actually using a compiler with glibc that does not claim to be GCC 3.3 or later, but which has a better way to define the HUGE_VAL macros, we can always add compiler conditionals in with alternative definitions. I intend to make similar changes for INF and NAN. The SNAN macros already just use __builtin_nans etc. with no fallback for compilers not claiming to be GCC 3.3 or later. Tested for x86_64. * math/math.h: Do not include bits/huge_val.h, bits/huge_valf.h, bits/huge_vall.h or bits/huge_val_flt128.h. (HUGE_VAL): Define directly here. [__USE_ISOC99] (HUGE_VALF): Likewise. [__USE_ISOC99] (HUGE_VALL): Likewise. [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F128): Likewise. * math/Makefile (headers): Remove bits/huge_val.h, bits/huge_valf.h, bits/huge_vall.h and bits/huge_val_flt128.h. * bits/huge_val.h: Remove. * bits/huge_val_flt128.h: Likewise. * bits/huge_valf.h: Likewise. * bits/huge_vall.h: Likewise. * sysdeps/ia64/bits/huge_vall.h: Likewise. * sysdeps/ieee754/bits/huge_val.h: Likewise. * sysdeps/ieee754/bits/huge_valf.h: Likewise. * sysdeps/m68k/m680x0/bits/huge_vall.h: Likewise. * sysdeps/sh/bits/huge_val.h: Likewise. * sysdeps/sparc/bits/huge_vall.h: Likewise. * sysdeps/x86/bits/huge_vall.h: Likewise.
* elf: Remove internal_function attributeFlorian Weimer2017-08-3144-139/+130
|
* gmon: Remove internal_function attributeFlorian Weimer2017-08-314-10/+16
|
* dlfcn: Remove internal_function attributeFlorian Weimer2017-08-314-9/+9
|
* resolv: Remove internal_function attributeFlorian Weimer2017-08-317-25/+21
|
* dirent: Remove internal_function attributeFlorian Weimer2017-08-317-15/+18
|
* Linux getcwd: Remove internal_function attributeFlorian Weimer2017-08-312-2/+8
|
* time: Remove the internal_function attributeFlorian Weimer2017-08-314-8/+12
|
* iconv, intl, locale, wcsmbs: Remove internal_functionFlorian Weimer2017-08-3134-157/+119
| | | | Also adjust parts of the time subdirectory.
* aio: Remove internal_function function attributeFlorian Weimer2017-08-317-24/+24
|
* misc: Remove internal_function function attributeFlorian Weimer2017-08-314-8/+9
|
* NSS: Remove internal_function function attributeFlorian Weimer2017-08-319-25/+23
|
* malloc: Remove the internal_function attributeFlorian Weimer2017-08-316-26/+23
|
* sunrpc: Remove internal_function attributeFlorian Weimer2017-08-3114-50/+42
|
* malloc: Resolve compilation failure in NDEBUG modeFlorian Weimer2017-08-312-18/+12
| | | | In _int_free, the locked variable is not used if NDEBUG is defined.
* Place $(elf-objpfx)sofini.os last [BZ #22051]H.J. Lu2017-08-312-1/+12
| | | | | | | | | | Since sofini.os terminates .eh_frame section, it should be placed last. [BZ #22051] * Makerules (build-module-helper-objlist): Filter out $(elf-objpfx)sofini.os. (build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is needed.
* libio: Assume _LIBC, weak_alias, errno, (__set_)errno &c are definedFlorian Weimer2017-08-3148-751/+166
| | | | Do not define _POSIX_SOURCE.
* malloc: Change top_check return type to voidFlorian Weimer2017-08-313-15/+20
| | | | | | After commit ec2c1fcefb200c6cb7e09553f3c6af8815013d83, (malloc: Abort on heap corruption, without a backtrace), the function always returns 0.
* Fix decimal point and thousands separator in es_CU locale to agree with CLDR.Mike FABIAN2017-08-312-4/+12
| | | | | | | [BZ #15332] * locales/es_CU (LC_MONETARY): use “,” for mon_decimal_point and “.” for mon_thousands_sep (to agree with CLDR) * locales/es_CU (LC_NUMERIC): Likewise.
* Remove redundant data in li_BE which is identical to the data in li_NLAkhilesh Kumar2017-08-312-36/+6
| | | | | [BZ #22044] * locales/li_BE (LC_TIME): copy "li_NL".
* Fix mcontext_t sigcontext namespace (bug 21457).Joseph Myers2017-08-3029-96/+369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completes the ucontext.h namespace fixes by fixing issues related to the use of struct sigcontext as mcontext_t, and inclusion of <bits/sigcontext.h> even when struct sigcontext is not so used. Inclusion of <bits/sigcontext.h> by <sys/ucontext.h> is removed; the way to get the sigcontext structure is by including <signal.h> (in a context where __USE_MISC is defined); the sysdeps/generic version of sys/ucontext.h keeps the inclusion by necessity, with a comment about how this is not namespace-clean, but the only configuration that used it, MicroBlaze, gets its own version of the header in this patch. Where mcontext_t was typedefed to struct sigcontext, the contents of struct sigcontext are inserted (with appropriate namespace handling to prefix fields with __ when __USE_MISC is not defined); review should check that this has been done correctly in each case, whether the definition of struct sigcontext comes from glibc headers or from the Linux kernel. This changes C++ name mangling on affected architectures (which do not include x86_64/x86). Tested for x86_64, and with build-many-glibcs.py. 2017-08-14 Joseph Myers <joseph@codesourcery.com> [BZ #21457] * sysdeps/arm/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/generic/sys/ucontext.h: Add comment about use of struct sigcontext and namespace requirements. * sysdeps/i386/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/m68k/sys/ucontext.h: Likewise. * sysdeps/mips/sys/ucontext.h: Likewise. Include <bits/types.h>. * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (oEXTENSION): Use __glibc_reserved1 instead of __reserved. * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym: Use mcontext_t instead of struct sigcontext. * sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/ia64/makecontext.c (__makecontext): Use mcontext_t instead of struct sigcontext. * sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym: Use mcontext_t instead of struct sigcontext. * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): New macro. (struct __ia64_fpreg_mcontext): New type. (mcontext_t): Define structure contents rather than using struct sigcontext. (_SC_GR0_OFFSET): Use mcontext_t instead of struct sigcontext. (uc_sigmask): Define using __ctx. (uc_stack): Likewise. * sysdeps/unix/sysv/linux/ia64/sys/procfs.h: Include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h: New file. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Do not include <bits/sigcontext.h>. Include <bits/types.h>. * conform/Makefile (test-xfail-XPG42/signal.h/conform): Remove. (test-xfail-XPG42/sys/wait.h/conform): Likewise. (test-xfail-XPG42/ucontext.h/conform): Likewise. (test-xfail-UNIX98/signal.h/conform): Likewise. (test-xfail-UNIX98/sys/wait.h/conform): Likewise. (test-xfail-UNIX98/ucontext.h/conform): Likewise. (test-xfail-XOPEN2K/signal.h/conform): Likewise. (test-xfail-XOPEN2K/sys/wait.h/conform): Likewise. (test-xfail-XOPEN2K/ucontext.h/conform): Likewise. (test-xfail-POSIX2008/signal.h/conform): Likewise. (test-xfail-POSIX2008/sys/wait.h/conform): Likewise. (test-xfail-XOPEN2K8/signal.h/conform): Likewise. (test-xfail-XOPEN2K8/sys/wait.h/conform): Likewise.
* dynarray: Set errno on overflow-induced allocation failureFlorian Weimer2017-08-304-3/+49
| | | | | This allows the caller to return directly on such an error, with an appropriate errno value.
* malloc: Remove corrupt arena flagFlorian Weimer2017-08-303-31/+10
| | | | | This is no longer needed because we now abort immediately once heap corruption is detected.
* malloc: Remove check_action variable [BZ #21754]Florian Weimer2017-08-306-188/+65
| | | | | | | | | | | Clean up calls to malloc_printerr and trim its argument list. This also removes a few bits of work done before calling malloc_printerr (such as unlocking operations). The tunable/environment variable still enables the lightweight additional malloc checking, but mallopt (M_CHECK_ACTION) no longer has any effect.
* aarch64: Fix tst-makecontext3 in ILP32 mode.Steve Ellcey2017-08-302-5/+10
| | | | | * sysdeps/unix/sysv/linux/aarch64/makecontext.c (__makecontext): Use pointer to uint64_t instead of long int for sp.
* malloc: Abort on heap corruption, without a backtrace [BZ #21754]Florian Weimer2017-08-305-51/+37
| | | | | The stack trace printing caused deadlocks and has been itself been targeted by code execution exploits.