aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-02-27Fix posix/bug-regex5.c test case, adapt to iso14651_t1_common upateMike FABIAN2-2/+9
This test case tests how many collating elements are defined in da_DK.ISO-8859-1 locale. The da_DK locale source defines 4: collating-element <A-A> from "<U0041><U0041>" collating-element <A-a> from "<U0041><U0061>" collating-element <a-A> from "<U0061><U0041>" collating-element <a-a> from "<U0061><U0061>" The new iso14651_t1_common file defines more collating elements, two of them are in the ISO-8859-1 range: collating-element <U004C_00B7> from "<U004C><U00B7>" % decomposition of LATIN CAPITAL LETTER L WITH MIDDLE DOT collating-element <U006C_00B7> from "<U006C><U00B7>" % decomposition of LATIN SMALL LETTER L WITH MIDDLE DOT So the total count is now 6 instead of 4. * posix/bug-regex5.c: Fix test case because with the new iso14651_t1_common file, the da_DK locale now has 6 collating elements in the ISO-8859-1 range instead of 4 with the old iso14651_t1_common file.
2018-02-27Collation order of @-. and space has changed in new iso14651_t1_common file, ↵Mike FABIAN5-12/+23
adapt test files * localedata/da_DK.ISO-8859-1.in: In the new iso14651_t1_common file downloaded from ISO, the collation order of @-. and space has changed. Therefore, this test file needed to be adapted. * localedata/fr_CA.UTF-8.in: Likewise. * localedata/fr_FR.UTF-8.in: Likewise. * localedata/uk_UA.UTF-8.in: Likewise.
2018-02-27Collation order of ȥ has changed in new iso14651_t1_common file, adapt test ↵Mike FABIAN3-4/+10
files * localedata/cs_CZ.UTF-8.in: adapt this test file to the collation order of ȥ in the new iso14651_t1_common file. * localedata/pl_PL.UTF-8.in: Likewise.
2018-02-27Add sections for various scripts to the iso14651_t1_common fileMike FABIAN2-9/+73
* localedata/locales/iso14651_t1_common: Add sections for various scripts to the iso14651_t1_common file.
2018-02-27iso14651_t1_common: make the fourth level the codepoint for characters which ↵Mike FABIAN2-457/+463
are ignorable on all 4 levels Entries for characters which have “IGNORE” on all 4 levels like: <U0001> IGNORE;IGNORE;IGNORE;IGNORE % START OF HEADING (in ISO 6429) are changed into: <U0001> IGNORE;IGNORE;IGNORE;<U0001> % START OF HEADING (in ISO 6429) i.e. putting the code point of the character into the fourth level instead of “IGNORE”. Without that change, all such characters would compare equal which would make a wcscoll test case fail. It is better to have a clearly defined sort order even for characters like this so it is good to use the code point as a tie-break. * localedata/locales/iso14651_t1_common: Use the code point of a character in the fourth collation level instead of IGNORE for all entries which have IGNORE on all 4 levels.
2018-02-27Add convenience symbols like <AFTER-A>, <BEFORE-A> to iso14651_t1_commonMike FABIAN2-0/+126
* localedata/locales/iso14651_t1_common: Add some convenient collation symbols like <AFTER-A>, <BEFORE-A> to make tailoring easier using rules similar to those in CLDR.
2018-02-27Fixing syntax errors after updating the iso14651_t1_common fileMike FABIAN2-4/+32817
* localedata/locales/iso14651_t1_common: The new version of this file downloaded from ISO contained several syntax errors which are fixed by this patch.
2018-02-27iso14651_t1_common: <U\([0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]\)> → <U000\1>Mike FABIAN2-13294/+13299
* localedata/locales/iso14651_t1_common: replace all <U.....> with <U000.....> because glibc understands only 4 digit or 8 digit
2018-02-27Necessary changes after updating the iso14651_t1_common fileMike FABIAN2-8/+21
* localedata/locales/iso14651_t1_common: Necessary changes to make the file downloaded from ISO usable by glibc.
2018-02-27Update iso14651_t1_common file to ISO14651_2016_TABLE1_en.txt [BZ #14095]Mike FABIAN2-9494/+52577
[BZ #14095] - Review / update collation data from Unicode / ISO 14651 File downloaded from: http://standards.iso.org/iso-iec/14651/ed-4/ISO14651_2016_TABLE1_en.txt Updating this file alone is not enough, there are problems in the new file which need to be fixed and the collation rules for many locales need to be adapted. This is done by the following patches. This update also fixes the problem that many characters are treated as identical when sorting because they were not yet in the old iso14651_t1_common file, see: https://bugzilla.redhat.com/show_bug.cgi?id=1336308 - Infinite (∞) and empty set (∅) are treated as if they were the same character by sort and uniq [BZ #14095] * localedata/locales/iso14651_t1_common: Update file to latest version from ISO (ISO14651_2016_TABLE1_en.txt).
2018-02-27hurd: fix timer_routines.c buildSamuel Thibault1-1/+1
* sysdeps/pthread/timer_routines.c: Include <timer_routines.h> instead of <internaltypes.h>.
2018-02-27hurd: fix gai_misc buildSamuel Thibault2-0/+68
* sysdeps/mach/hurd/gai_misc.h: New file.
2018-02-27hurd: fix timer_routines.c buildSamuel Thibault2-0/+4
* sysdeps/pthread/timer_routines.c: [!defined DELAYTIMER_MAX] (DELAYTIMER_MAX): Define to INT_MAX.
2018-02-27Move NPTL-specific code to NPTL-specific headerSamuel Thibault3-26/+59
* sysdeps/pthread/timer_routines.c: Include <timer_routines.h> instead of <nptl/pthreadP.h> (thread_attr_compare): Move function to... * sysdeps/nptl/timer_routines.h: ... new header.
2018-02-26Fix another -Os strcoll build issue.Joseph Myers2-0/+15
While there are now clean -Os build and test results on x86_64 (given my patch <https://sourceware.org/ml/libc-alpha/2018-02/msg00602.html>, pending review), testing with -Os with build-many-glibcs.py shows the build is still failing with -Os everywhere except for x86_64, x86 and s390x. There are a variety of different build failures, but the most common seem to be in strcoll / wcscoll, similar to existing such cases where DIAG_* are used to disable -Wmaybe-uninitialized. There are various different failures even within those functions. This patch fixes one particular case that seems quite common, where the warning appears at the declarations of seq1 and seq2. Tested with build-many-glibcs.py that this fixes the -Os build for aarch64-linux-gnu with GCC 7. * string/strcoll_l.c: Include <libc-diag.h>. (STRCOLL): Ignore -Wmaybe-uninitialized for -Os around declarations of seq1 and seq2.
2018-02-26Use libc_hidden_* for atoi (bug 15105).Joseph Myers3-0/+9
Continuing the fixes for localplt test failures with -Os arising from functions not being inlined in that case, this patch fixes such failures for atoi by using libc_hidden_proto and libc_hidden_def. Tested for x86_64 (both that it removes this particular localplt failure for -Os, and that the testsuite continues to pass without -Os). [BZ #15105] * stdlib/atoi.c (atoi): Use libc_hidden_def. * include/stdlib.h [!_ISOMAC] (atoi): Use libc_hidden_proto.
2018-02-26linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]Dmitry V. Levin2-0/+73
Tested with strace. * sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (__ptrace_request): Add PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS, PTRACE_GETVRREGS, PTRACE_SETVRREGS, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, PTRACE_GETREGS64, PTRACE_SETREGS64, PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG, PTRACE_GETVSRREGS, PTRACE_SETVSRREGS, and PTRACE_SINGLEBLOCK.
2018-02-26powerpc: Undefine Linux ptrace macros that conflict with __ptrace_requestTulio Magno Quites Machado Filho2-0/+48
Linux ptrace headers define macros whose tokens conflict with the constants of enum __ptrace_request causing build errors when asm/ptrace.h or linux/ptrace.h are included before sys/ptrace.h. * sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Undefine Linux macros used in __ptrace_request. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
2018-02-26Fix a typo in ChangeLog (bit_cpu_BIT -> bit_cpu_IBT)H.J. Lu1-1/+1
2018-02-23Update ChangeLog for BZ 22884 - riscv fmax/fminDJ Delorie1-0/+1
2018-02-23Define GEN_AS_CONST_HEADERS when generating header files [BZ #22792]H.J. Lu4-3/+26
Glibc build generates header files to define constants from special .sym files. If a .sym file includes the same header file which it generates, it leads to circular dependency which may lead to build hang on a many-core machine. Define GEN_AS_CONST_HEADERS when generating header files to avoid circular dependency. <tcb-offsets.h> is needed for i686 and it isn't needed for x86-64 at least since glibc 2.23. Tested on i686 and x86-64. [BZ #22792] * Makerules ($(common-objpfx)%.h): Pass -DGEN_AS_CONST_HEADERS to $(CC). * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Include <tcb-offsets.h> only if GEN_AS_CONST_HEADERS isn't defined. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't include <tcb-offsets.h>.
2018-02-23Use libc_hidden_* for tolower, toupper (bug 15105).Joseph Myers3-0/+13
Continuing the fixes for localplt test failures with -Os arising from functions not being inlined in that case, this patch fixes such failures for tolower and toupper by using libc_hidden_proto and libc_hidden_def. Tested for x86_64 (both that it removes this particular localplt failure for -Os, and that the testsuite continues to pass without -Os). 2018-02-22 Joseph Myers <joseph@codesourcery.com> [BZ #15105] * ctype/ctype.c (tolower): Use libc_hidden_def. (toupper): Likewise. * include/ctype.h [!_ISOMAC] (tolower): Use libc_hidden_proto. [!_ISOMAC] (toupper): Likewise.
2018-02-23Remove --quiet argument when installing localesMike FABIAN2-1/+6
Using this argument hides problems. I would like to see when something fails. * localedata/Makefile: Remove --quiet argument when installing locales
2018-02-23Use / instead of - in d_fmt for pt_BR and pt_PT [BZ #17438]Mike FABIAN3-2/+9
[BZ #17438] * localedata/locales/pt_BR (LC_TIME): use / instead of - in d_fmt. * localedata/locales/pt_PT (LC_TIME): likewise
2018-02-23Use “copy "es_BO"” in LC_TIME of es_CU, es_CL, and es_ECMike FABIAN4-108/+10
LC_TIME in these 4 locales is identical, using “copy "es_BO"” makes that more obvious. [BZ #22646] * localedata/locales/es_CL (LC_TIME): copy "es_BO". * localedata/locales/es_CU (LC_TIME): copy "es_BO". * localedata/locales/es_EC (LC_TIME): copy "es_BO".
2018-02-22Update sparc ulpsAdhemerval Zanella2-0/+4
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2018-02-22Refactor atfork handlersAdhemerval Zanella7-315/+127
Current implementation (sysdeps/nptl/fork.c) replicates the atfork handlers list backward to invoke the child handlers after fork/clone syscall. The internal atfork handlers is implemented as a single-linked list so a lock-free algorithm can be used, trading fork mulithread call performance for some code complexity and dynamic stack allocation (since the backwards list should not fail). This patch refactor it to use a dynarary instead of a linked list. It simplifies the external variables need to be exported and also the internal atfork handler member definition. The downside is a serialization of fork call in multithread, since to operate on the dynarray the internal lock should be used. However as noted by Florian, it already acquires external locks for malloc and libio so it is already hitting some lock contention. Besides, posix_spawn should be faster and more scalable to run external programs in multithread environments. Checked on x86_64-linux-gnu. * nptl/Makefile (routines): Remove unregister-atfork. * nptl/register-atfork.c (fork_handler_pool): Remove variable. (fork_handler_alloc): Remove function. (fork_handlers, fork_handler_init): New variables. (__fork_lock): Rename to atfork_lock. (__register_atfork, __unregister_atfork, libc_freeres_fn): Rewrite to use a dynamic array to add/remove atfork handlers. * sysdeps/nptl/fork.c (__libc_fork): Likewise. * sysdeps/nptl/fork.h (__fork_lock, __fork_handlers, __linkin_atfork): Remove declaration. (fork_handler): Remove next, refcntr, and need_signal member. (__run_fork_handler_type): New enum. (__run_fork_handlers): New prototype. * sysdeps/nptl/libc-lockP.h (__libc_atfork): Remove declaration.
2018-02-22Rename nptl-signals.h to internal-signals.hAdhemerval Zanella6-15/+30
This patch renames the nptl-signals.h header to internal-signals.h. On Linux the definitions and functions are not only NPTL related, but used for other POSIX definitions as well (for instance SIGTIMER for posix times, SIGSETXID for id functions, and signal block/restore helpers) and since generic functions will be places and used in generic implementation it makes more sense to decouple it from NPTL. Checked on x86_64-linux-gnu. * sysdeps/nptl/nptl-signals.h: Move to ... * sysdeps/generic/internal-signals.h: ... here. Adjust internal comments. * sysdeps/unix/sysv/linux/internal-signals.h: Add include guards. (__nptl_is_internal_signal): Rename to __is_internal_signal. (__nptl_clear_internal_signals): Rename to __clear_internal_signals. * sysdeps/unix/sysv/linux/raise.c: Adjust nptl-signal.h to include-signals.h rename. * nptl/pthreadP.h: Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Call __is_internal_signal instead of __nptl_is_internal_signal.
2018-02-22RISC-V: fmax/fmin: Handle signalling NaNs correctly.Andrew Waterman5-8/+43
RISC-V's fmax(sNAN,4) returns 4 but glibc expects it to return qNAN. * sysdeps/riscv/rvd/s_fmax.c (__fmax): Handle sNaNs correctly. * sysdeps/riscv/rvd/s_fmin.c (__fmin): Likewise. * sysdeps/riscv/rvf/s_fmaxf.c (__fmaxf): Likewise. * sysdeps/riscv/rvf/s_fminf.c (__fminf): Likewise.
2018-02-22RISC-V: Do not initialize $gp in TLS macros.DJ Delorie2-17/+7
RISC-V TLS doesn't require GP to be initialized, and doing so breaks TLS in a shared object.
2018-02-22aarch64/strcmp: fix misaligned loop jump targetSiddhesh Poyarekar2-1/+6
I accidentally set the loop jump back label as misaligned8 instead of do_misaligned. The typo is harmless but it's always nice to not have to unnecessarily execute those two instructions. * sysdeps/aarch64/strcmp.S (do_misaligned): Jump back to do_misaligned, not misaligned8.
2018-02-22IFUNC for Cavium ThunderX2Steve Ellcey7-10/+73
* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add memcpy_thunderx2. * sysdeps/aarch64/multiarch/ifunc-impl-list.c (MAX_IFUNC): Increment to 4. (__libc_ifunc_impl_list): Add __memcpy_thunderx2. * sysdeps/aarch64/multiarch/memcpy.c (libc_ifunc): Add IS_THUNDERX2 and IS_THUNDERX2PA checks. * sysdeps/aarch64/multiarch/memcpy_thunderx.S (USE_THUNDERX2): Use macro to set name appropriately. (memcpy): Use USE_THUNDERX2 macro to modify prefetches. * sysdeps/aarch64/multiarch/memcpy_thunderx2.S: New file. * sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_THUNDERX2PA): New macro. (IS_THUNDERX2): New macro.
2018-02-22Add [BZ #16335] annotation to ChangeLog entry.Rical Jasan1-0/+1
Commit 6a3962c4a408e8cbc305d2433711196107374e89 unwittingly fixed a bug, so update the ChangeLog entry accordingly.
2018-02-22S390: Regenerate ULPs.Stefan Liebler2-6/+10
After regenerating ULPs from scratch in commit 8e7196c8759287a3e4c882e3c7cf32ddc322df8a, I've missed to test it with multiple gcc versions. Hence, here is a further update. ChangeLog: * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
2018-02-21hurd: Add sysdep-cancel.hSamuel Thibault2-0/+10
2018-02-21Remove miscellaneous debris from libio.Zack Weinberg20-236/+54
This patch eliminates a number of #if 0 and #ifdef TODO blocks, macros that are never used, macros that provide portability to substrates that lack basic things like EINVAL and off_t, and other such debris. I preserved IO_DEBUG and CHECK_FILE, even though as far as I can tell IO_DEBUG is never defined and therefore CHECK_FILE never does anything, because it seems like we might actually want to turn it _on_. Installed stripped libraries and executables are unchanged, except, again, that the line number of an assertion changes (this time it's somewhere in fileops.c). * libio/libio.h (_IO_pos_BAD, _IO_pos_0, _IO_pos_adjust): Define here, unconditionally. * libio/iolibio.h (_IO_pos_BAD): Don't define here. * libio/libioP.h: Remove #if 0 blocks. (_IO_pos_BAD, _IO_pos_0, _IO_pos_adjust): Don't define here. (_IO_va_start, COERCE_FILE, MAYBE_SET_EINVAL): Don't define. (CHECK_FILE): Don't use MAYBE_SET_EINVAL or COERCE_FILE. Fix style. * libio/clearerr.c, libio/fputc.c, libio/getchar.c: Assume weak_alias is always defined. * libio/fileops.c, libio/genops.c, libio/oldfileops.c * libio/oldpclose.c, libio/pclose.c, libio/wfileops.c: Remove #if 0 and #ifdef TODO blocks. Assume text_set_element is always defined. * libio/iofdopen.c, libio/iogetdelim.c, libio/oldiofdopen.c Use __set_errno (EINVAL) instead of MAYBE_SET_EINVAL. * libio/tst-mmap-eofsync.c: Make #if 1 block unconditional.
2018-02-21Remove _IO_file_flags define.Zack Weinberg22-122/+99
This entirely mechanical (except for some indentation fixups) patch replaces all uses of _IO_file_flags with _flags and removes the #define. Installed stripped libraries and executables are unchanged by this patch. * libio/libio.h (_IO_file_flags): Remove macro. All uses changed to _flags.
2018-02-21Remove legacy configuration knobs from libio.Zack Weinberg11-50/+24
This patch eliminates the "compatibility defines" _IO_UNIFIED_JUMPTABLES (always defined to 1, used in a number of #ifs which are therefore always false), _STDIO_USES_IOSTREAM (unused), __HAVE_COLUMN (unused), _IO_BE (replaced with __glibc_unlikely), and yet another redundant definition of EOF. Installed stripped libraries are unchanged by this patch. * libio/libio.h (_IO_UNIFIED_JUMPTABLES, _STDIO_USES_IOSTREAM) (__HAVE_COLUMN, _IO_BE): Don't define. (_IO_peekc_unlocked, _IO_getwc_unlocked, _IO_putwc_unlocked) (_IO_fwide_maybe_incompatible): Use __glibc_unlikely. * libio/libioP.h (EOF): Don't define. * libio/iofdopen.c, libio/iofopen.c, libio/iopopen.c * libio/iovdprintf.c, libio/oldiofdopen.c, libio/oldiofopen.c * libio/oldiopopen.c, debug/vdprintf_chk.c: Remove #if block testing _IO_UNIFIED_JUMPTABLES.
2018-02-21Mechanically remove _IO_ name aliases for types and constants.Zack Weinberg128-971/+937
This patch mechanically removes all remaining uses, and the definitions, of the following libio name aliases: name replaced with ---- ------------- _IO_FILE FILE _IO_fpos_t __fpos_t _IO_fpos64_t __fpos64_t _IO_size_t size_t _IO_ssize_t ssize_t or __ssize_t _IO_off_t off_t _IO_off64_t off64_t _IO_pid_t pid_t _IO_uid_t uid_t _IO_wint_t wint_t _IO_va_list va_list or __gnuc_va_list _IO_BUFSIZ BUFSIZ _IO_cookie_io_functions_t cookie_io_functions_t __io_read_fn cookie_read_function_t __io_write_fn cookie_write_function_t __io_seek_fn cookie_seek_function_t __io_close_fn cookie_close_function_t I used __fpos_t and __fpos64_t instead of fpos_t and fpos64_t because the definitions of fpos_t and fpos64_t depend on the largefile mode. I used __ssize_t and __gnuc_va_list in a handful of headers where namespace cleanliness might be relevant even though they're internal-use-only. In all other cases, I used the public-namespace name. There are a tiny handful of places where I left a use of 'struct _IO_FILE' alone, because it was being used together with 'struct _IO_FILE_plus' or 'struct _IO_FILE_complete' in the same arithmetic expression. Because this patch was almost entirely done with search and replace, I may have introduced indentation botches. I did proofread the diff, but I may have missed something. The ChangeLog below calls out all of the places where this was not a pure search-and-replace change. Installed stripped libraries and executables are unchanged by this patch, except that some assertions in vfscanf.c change line numbers. * libio/libio.h (_IO_FILE): Delete; all uses changed to FILE. (_IO_fpos_t): Delete; all uses changed to __fpos_t. (_IO_fpos64_t): Delete; all uses changed to __fpos64_t. (_IO_size_t): Delete; all uses changed to size_t. (_IO_ssize_t): Delete; all uses changed to ssize_t or __ssize_t. (_IO_off_t): Delete; all uses changed to off_t. (_IO_off64_t): Delete; all uses changed to off64_t. (_IO_pid_t): Delete; all uses changed to pid_t. (_IO_uid_t): Delete; all uses changed to uid_t. (_IO_wint_t): Delete; all uses changed to wint_t. (_IO_va_list): Delete; all uses changed to va_list or __gnuc_va_list. (_IO_BUFSIZ): Delete; all uses changed to BUFSIZ. (_IO_cookie_io_functions_t): Delete; all uses changed to cookie_io_functions_t. (__io_read_fn): Delete; all uses changed to cookie_read_function_t. (__io_write_fn): Delete; all uses changed to cookie_write_function_t. (__io_seek_fn): Delete; all uses changed to cookie_seek_function_t. (__io_close_fn): Delete: all uses changed to cookie_close_function_t. * libio/iofopncook.c: Remove unnecessary forward declarations. * libio/iolibio.h: Correct outdated commentary. * malloc/malloc.c (__malloc_stats): Remove unnecessary casts. * stdio-common/fxprintf.c (__fxprintf_nocancel): Remove unnecessary casts. * stdio-common/getline.c: Use _IO_getdelim directly. Don't redefine ssize_t. * stdio-common/printf_fp.c, stdio_common/printf_fphex.c * stdio-common/printf_size.c: Don't redefine size_t or FILE. Remove outdated comments. * stdio-common/vfscanf.c: Don't redefine va_list.
2018-02-21Remove vestiges of external build support from libio headers.Zack Weinberg4-43/+12
As requested by Adhemerval, this patch removes some preprocessor conditionals from the libio headers that were only relevant when building libio outside glibc. Installed stripped libraries and executables are unchanged by this patch. * libio/iolibio.h, libio/libioP.h: Remove extern "C". * libio/libio.h: Remove __BEGIN_DECLS and __END_DECLS. Remove preprocessor conditionals on _LIBC and __USE_GNU, which are always true, and __cplusplus, which is always false.
2018-02-21Fix -Os putc_unlocked, fputc_unlocked linknamespace, localplt issues (bug ↵Joseph Myers5-3/+28
15105, bug 19463). Continuing the fixes for linknamespace and localplt test failures with -Os that arise from functions not being inlined in that case, this patch fixes such failures for putc_unlocked and fputc_unlocked. libc_hidden_* are used for both functions, while namespace issues are addressed by making putc_unlocked a weak alias of hidden __putc_unlocked, which is called in the one place where namespace issues arise (and defined as an inline function in include/stdio.h). Tested for x86_64 (both without -Os to make sure that case continues to work, and with -Os to make sure all the relevant linknamespace and localplt test failures are resolved). This completes fixing the -Os linknamespace failures (at least for x86_64); localplt failures remain after this patch. 2018-02-19 Joseph Myers <joseph@codesourcery.com> [BZ #15105] [BZ #19463] * libio/fputc_u.c (fputc_unlocked): Use libc_hidden_def. * libio/putc_u.c (putc_unlocked): Rename to __putc_unlocked and define as weak alias of __putc_unlocked. Use libc_hidden_weak. * include/stdio.h [!_ISOMAC] (fputc_unlocked): Use libc_hidden_proto. [!_ISOMAC] (putc_unlocked): Likewise. [!_ISOMAC] (__putc_unlocked): Declare as hidden function, and define inline if [__USE_EXTERN_INLINES]. * misc/syslog.c (__vsyslog_chk): Call __putc_unlocked instead of putc_unlocked.
2018-02-21Fix -Os getc_unlocked linknamespace, localplt issues (bug 15105, bug 19463).Joseph Myers5-8/+28
Continuing the fixes for linknamespace and localplt test failures with -Os that arise from functions not being inlined in that case, this patch fixes such failures for getc_unlocked. __getc_unlocked already exists; this patch makes it explicitly hidden, calls it where needed for namespace reasons, adds an inline function for it when inline functions are used and adds libc_hidden_proto / libc_hidden_weak for getc_unlocked. Tested for x86_64 (both without -Os to make sure that case continues to work, and with -Os to make sure all the relevant linknamespace and localplt test failures are resolved). Because of other such failures that remain after this patch, neither of the bugs can yet be closed. [BZ #15105] [BZ #19463] * libio/getc_u.c (getc_unlocked): Use libc_hidden_weak. * include/stdio.h [!_ISOMAC] (__getc_unlocked): Use attribute_hidden, and define inline if [__USE_EXTERN_INLINES]. [!_ISOMAC] (getc_unlocked): Use libc_hidden_proto. * misc/getttyent.c (__getttyent): Call __getc_unlocked instead of getc_unlocked. * time/tzfile.c (__tzfile_read): Likewise.
2018-02-21Add missing “reorder-end” in LC_COLLATE of et_EE [BZ #22517]Mike FABIAN2-0/+7
[BZ #22517] * localedata/locales/et_EE (LC_COLLATE): add missing “reorder-end”
2018-02-21Fix a typo in a comment.Rical Jasan2-1/+5
* io/fcntl.h: Fix a typo in a comment.
2018-02-21manual: Update _DEFAULT_SOURCE. [BZ #22862]Rical Jasan3-8/+22
The description of the interplay between feature test macros and compiler options in the description of _DEFAULT_SOURCE is a little confusing, and dated, so clarify the situation, and don't assume a specific value for _DEFAULT_SOURCE. Also, _DEFAULT_SOURCE is supposed to be defined if none of the C/POSIX feature test macros are defined, but the condition was lacking a test for _ISOC11_SOURCE, so that is also addressed. [BZ #22862] * include/features.h: Add _ISOC11_SOURCE to test for whether to define _DEFAULT_SOURCE. * manual/creature.texi (_DEFAULT_SOURCE): Improve documentation.
2018-02-21ldconfig: Sync temporary files to disk before renaming them [BZ #20890]Florian Weimer2-3/+15
If the system crashes before the file data has been written to disk, the file system recovery upon the next mount may restore a partially rewritten temporary file under the non-temporary (final) name (after the rename operation).
2018-02-21elf: Remove ad-hoc restrictions on dlopen callers [BZ #22787]Florian Weimer9-148/+22
This looks like a post-exploitation hardening measure: If an attacker is able to redirect execution flow, they could use that to load a DSO which contains additional code (or perhaps make the stack executable). However, the checks are not in the correct place to be effective: If they are performed before the critical operation, an attacker with sufficient control over execution flow could simply jump directly to the code which performs the operation, bypassing the check. The check would have to be executed unconditionally after the operation and terminate the process in case a caller violation was detected. Furthermore, in _dl_check_caller, there was a fallback reading global writable data (GL(dl_rtld_map).l_map_start and GL(dl_rtld_map).l_text_end), which could conceivably be targeted by an attacker to disable the check, too. Other critical functions (such as system) remain completely unprotected, so the value of these additional checks does not appear that large. Therefore this commit removes this functionality.
2018-02-21hurd: fix buildSamuel Thibault2-0/+6
* sysdeps/mach/hurd/dl-sysdep.c (_dl_random): New variable.
2018-02-20manual: Update the _ISOC99_SOURCE description.Rical Jasan2-4/+8
The current description refers to ISO C99 not being widely adopted, which it is believed to be now. * manual/creature.texi (_ISOC99_SOURCE): Update the dated description.
2018-02-20manual: Document missing feature test macros.Rical Jasan2-2/+46
Several feature test macros are documented in features.h but absent in the manual, and some documented macros accept undocumented values. This commit updates the manual to mention all the accepted macros, along with any values that hold special meaning. * manual/creature.texi (_POSIX_C_SOURCE): Document special values of 199606L, 200112L, and 200809L. (_XOPEN_SOURCE): Document special values of 600 and 700. (_ISOC11_SOURCE): Document macro. (_ATFILE_SOURCE): Likewise. (_FORTIFY_SOURCE): Likewise.