]> sourceware.org Git - glibc.git/log
glibc.git
8 years agoMark internal unistd functions hidden in ld.so hjl/pr19122
H.J. Lu [Wed, 14 Oct 2015 22:21:55 +0000 (15:21 -0700)]
Mark internal unistd functions hidden in ld.so

Since internal unistd functions are only used internally in ld.so and
libc.so, they can be made hidden.  Some functions can't be hidden in
ld.so on Hurd since they will be preempted by the ones in libc.so after
bootstrap.

[BZ #19122]
* include/unistd.h [IS_IN (rtld)]: Include <dl-unistd.h>.
* sysdeps/generic/dl-unistd.h: New file.
* sysdeps/mach/hurd/dl-unistd.h: Likewise.

8 years agoMark ld.so internal mmap functions hidden in ld.so
H.J. Lu [Wed, 14 Oct 2015 22:14:15 +0000 (15:14 -0700)]
Mark ld.so internal mmap functions hidden in ld.so

Since ld.so internal mmap functions are only used internally in ld.so,
they can be made hidden.  Don't hide __mmap on Hurd, since __mmap in
ld.so will be preempted by the one in libc.so after bootstrap.

 [BZ #19122]
 * include/sys/mman.h [IS_IN (rtld)]: Include <dl-mman.h>.
 * sysdeps/generic/dl-mman.h: New file.
 * sysdeps/mach/hurd/dl-mman.h: Likewise.

8 years agoConvert 113 more function definitions to prototype style (files with assertions).
Joseph Myers [Tue, 20 Oct 2015 11:54:09 +0000 (11:54 +0000)]
Convert 113 more function definitions to prototype style (files with assertions).

This mostly automatically-generated patch converts 113 function
definitions in glibc from old-style K&R to prototype-style.  Following
my other recent such patches, this one deals with the case of function
definitions in files that either contain assertions or where grep
suggested they might contain assertions - and thus where it isn't
possible to use a simple object code comparison as a sanity check on
the correctness of the patch, because line numbers are changed.

A few such automatically-generated changes needed to be supplemented
by manual changes for the result to compile.  openat64 had a prototype
declaration with "..." but an old-style definition in
sysdeps/unix/sysv/linux/dl-openat64.c, and "..." needed adding to the
generated prototype in the definition (I've filed
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68024> for diagnosing
such cases in GCC; the old state was undefined behavior not requiring
a diagnostic, but one seems a good idea).  In addition, as Florian has
noted regparm attribute mismatches between declaration and definition
are only diagnosed for prototype definitions, and five functions
needed internal_function added to their definitions (in the case of
__pthread_mutex_cond_lock, via the macro definition of
__pthread_mutex_lock) to compile on i386.

After this patch is in, remaining old-style definitions are probably
most readily fixed manually before we can turn on
-Wold-style-definition for all builds.

Tested for x86_64 and x86 (testsuite).

* crypt/md5-crypt.c (__md5_crypt_r): Convert to prototype-style
function definition.
* crypt/sha256-crypt.c (__sha256_crypt_r): Likewise.
* crypt/sha512-crypt.c (__sha512_crypt_r): Likewise.
* debug/backtracesyms.c (__backtrace_symbols): Likewise.
* elf/dl-minimal.c (_itoa): Likewise.
* hurd/hurdmalloc.c (malloc): Likewise.
(free): Likewise.
(realloc): Likewise.
* inet/inet6_option.c (inet6_option_space): Likewise.
(inet6_option_init): Likewise.
(inet6_option_append): Likewise.
(inet6_option_alloc): Likewise.
(inet6_option_next): Likewise.
(inet6_option_find): Likewise.
* io/ftw.c (FTW_NAME): Likewise.
(NFTW_NAME): Likewise.
(NFTW_NEW_NAME): Likewise.
(NFTW_OLD_NAME): Likewise.
* libio/iofwide.c (_IO_fwide): Likewise.
* libio/strops.c (_IO_str_init_static_internal): Likewise.
(_IO_str_init_static): Likewise.
(_IO_str_init_readonly): Likewise.
(_IO_str_overflow): Likewise.
(_IO_str_underflow): Likewise.
(_IO_str_count): Likewise.
(_IO_str_seekoff): Likewise.
(_IO_str_pbackfail): Likewise.
(_IO_str_finish): Likewise.
* libio/wstrops.c (_IO_wstr_init_static): Likewise.
(_IO_wstr_overflow): Likewise.
(_IO_wstr_underflow): Likewise.
(_IO_wstr_count): Likewise.
(_IO_wstr_seekoff): Likewise.
(_IO_wstr_pbackfail): Likewise.
(_IO_wstr_finish): Likewise.
* locale/programs/localedef.c (normalize_codeset): Likewise.
* locale/programs/locarchive.c (add_locale_to_archive): Likewise.
(add_locales_to_archive): Likewise.
(delete_locales_from_archive): Likewise.
* malloc/malloc.c (__libc_mallinfo): Likewise.
* math/gen-auto-libm-tests.c (init_fp_formats): Likewise.
* misc/tsearch.c (__tfind): Likewise.
* nptl/pthread_attr_destroy.c (__pthread_attr_destroy): Likewise.
* nptl/pthread_attr_getdetachstate.c
(__pthread_attr_getdetachstate): Likewise.
* nptl/pthread_attr_getguardsize.c (pthread_attr_getguardsize):
Likewise.
* nptl/pthread_attr_getinheritsched.c
(__pthread_attr_getinheritsched): Likewise.
* nptl/pthread_attr_getschedparam.c
(__pthread_attr_getschedparam): Likewise.
* nptl/pthread_attr_getschedpolicy.c
(__pthread_attr_getschedpolicy): Likewise.
* nptl/pthread_attr_getscope.c (__pthread_attr_getscope):
Likewise.
* nptl/pthread_attr_getstack.c (__pthread_attr_getstack):
Likewise.
* nptl/pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr):
Likewise.
* nptl/pthread_attr_getstacksize.c (__pthread_attr_getstacksize):
Likewise.
* nptl/pthread_attr_init.c (__pthread_attr_init_2_1): Likewise.
(__pthread_attr_init_2_0): Likewise.
* nptl/pthread_attr_setdetachstate.c
(__pthread_attr_setdetachstate): Likewise.
* nptl/pthread_attr_setguardsize.c (pthread_attr_setguardsize):
Likewise.
* nptl/pthread_attr_setinheritsched.c
(__pthread_attr_setinheritsched): Likewise.
* nptl/pthread_attr_setschedparam.c
(__pthread_attr_setschedparam): Likewise.
* nptl/pthread_attr_setschedpolicy.c
(__pthread_attr_setschedpolicy): Likewise.
* nptl/pthread_attr_setscope.c (__pthread_attr_setscope):
Likewise.
* nptl/pthread_attr_setstack.c (__pthread_attr_setstack):
Likewise.
* nptl/pthread_attr_setstackaddr.c (__pthread_attr_setstackaddr):
Likewise.
* nptl/pthread_attr_setstacksize.c (__pthread_attr_setstacksize):
Likewise.
* nptl/pthread_condattr_setclock.c (pthread_condattr_setclock):
Likewise.
* nptl/pthread_create.c (__find_in_stack_list): Likewise.
* nptl/pthread_getattr_np.c (pthread_getattr_np): Likewise.
* nptl/pthread_mutex_cond_lock.c (__pthread_mutex_lock): Define to
use internal_function.
* nptl/pthread_mutex_init.c (__pthread_mutex_init): Convert to
prototype-style function definition.
* nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Likewise.
(__pthread_mutex_cond_lock_adjust): Likewise.  Use
internal_function.
* nptl/pthread_mutex_timedlock.c (pthread_mutex_timedlock):
Convert to prototype-style function definition.
* nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock):
Likewise.
* nptl/pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
Likewise.
(__pthread_mutex_unlock): Likewise.
* nptl_db/td_ta_clear_event.c (td_ta_clear_event): Likewise.
* nptl_db/td_ta_set_event.c (td_ta_set_event): Likewise.
* nptl_db/td_thr_clear_event.c (td_thr_clear_event): Likewise.
* nptl_db/td_thr_event_enable.c (td_thr_event_enable): Likewise.
* nptl_db/td_thr_set_event.c (td_thr_set_event): Likewise.
* nss/makedb.c (process_input): Likewise.
* posix/fnmatch.c (__strchrnul): Likewise.
(__wcschrnul): Likewise.
(fnmatch): Likewise.
* posix/fnmatch_loop.c (FCT): Likewise.
* posix/glob.c (globfree): Likewise.
(__glob_pattern_type): Likewise.
(__glob_pattern_p): Likewise.
* posix/regcomp.c (re_compile_pattern): Likewise.
(re_set_syntax): Likewise.
(re_compile_fastmap): Likewise.
(regcomp): Likewise.
(regerror): Likewise.
(regfree): Likewise.
* posix/regexec.c (regexec): Likewise.
(re_match): Likewise.
(re_search): Likewise.
(re_match_2): Likewise.
(re_search_2): Likewise.
(re_search_stub): Likewise.  Use internal_function
(re_copy_regs): Likewise.
(re_set_registers): Convert to prototype-style function
definition.
(prune_impossible_nodes): Likewise.  Use internal_function.
* resolv/inet_net_pton.c (inet_net_pton): Convert to
prototype-style function definition.
(inet_net_pton_ipv4): Likewise.
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Likewise.
* sysdeps/pthread/aio_cancel.c (aio_cancel): Likewise.
* sysdeps/pthread/aio_suspend.c (aio_suspend): Likewise.
* sysdeps/pthread/timer_delete.c (timer_delete): Likewise.
* sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise.
Make variadic.
* time/strptime_l.c (localtime_r): Convert to prototype-style
function definition.
* wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Likewise.
* wcsmbs/mbsrtowcs_l.c (__mbsrtowcs_l): Likewise.
* wcsmbs/wcsnrtombs.c (__wcsnrtombs): Likewise.
* wcsmbs/wcsrtombs.c (__wcsrtombs): Likewise.

8 years agoConvert 29 more function definitions to prototype style (multiple parameters in one...
Joseph Myers [Tue, 20 Oct 2015 11:52:27 +0000 (11:52 +0000)]
Convert 29 more function definitions to prototype style (multiple parameters in one K&R parameter declaration).

This automatically-generated patch converts 29 function definitions in
glibc (including one in an example in the manual) from old-style K&R
to prototype-style.  Following my other recent such patches, this one
deals with the case of function definitions where one K&R parameter
declaration declares multiple parameters, as in:

void
foo (a, b)
     int a, *b;
{
}

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* crypt/crypt.c (_ufc_doit_r): Convert to prototype-style function
definition.
(_ufc_doit_r): Likewise.
* crypt/crypt_util.c (_ufc_copymem): Likewise.
(_ufc_output_conversion_r): Likewise.
* inet/inet_mkadr.c (__inet_makeaddr): Likewise.
* inet/rcmd.c (rcmd_af): Likewise.
(rcmd): Likewise.
(ruserok_af): Likewise.
(ruserok): Likewise.
(ruserok2_sa): Likewise.
(ruserok_sa): Likewise.
(iruserok_af): Likewise.
(iruserok): Likewise.
(__ivaliduser): Likewise.
(__validuser2_sa): Likewise.
* inet/rexec.c (rexec_af): Likewise.
(rexec): Likewise.
* inet/ruserpass.c (ruserpass): Likewise.
* locale/programs/xmalloc.c (xcalloc): Likewise.
* manual/examples/timeval_subtract.c (timeval_subtract): Likewise.
* math/w_drem.c (__drem): Likewise.
* math/w_dremf.c (__dremf): Likewise.
* math/w_dreml.c (__dreml): Likewise.
* misc/daemon.c (daemon): Likewise.
* resolv/res_debug.c (p_fqnname): Likewise.
* stdlib/div.c (div): Likewise.
* string/memcmp.c (memcmp_bytes): Likewise.
* sunrpc/pmap_rmt.c (pmap_rmtcall): Likewise.
* sunrpc/svc_udp.c (svcudp_bufcreate): Likewise.

8 years agoConvert 24 more function definitions to prototype style (array parameters).
Joseph Myers [Tue, 20 Oct 2015 11:51:03 +0000 (11:51 +0000)]
Convert 24 more function definitions to prototype style (array parameters).

This automatically-generated patch converts 24 function definitions in
glibc from old-style K&R to prototype-style.  Following my other
recent such patches, this one deals with the case of functions with
array parameters.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* crypt/cert.c (main): Convert to prototype-style function
definition.
* io/pipe.c (__pipe): Likewise.
* io/pipe2.c (__pipe2): Likewise.
* misc/futimesat.c (futimesat): Likewise.
* misc/utimes.c (__utimes): Likewise.
* posix/execve.c (__execve): Likewise.
* posix/execvp.c (execvp): Likewise.
* posix/execvpe.c (__execvpe): Likewise.
* posix/fexecve.c (fexecve): Likewise.
* socket/socketpair.c (socketpair): Likewise.
* stdlib/drand48-iter.c (__drand48_iterate): Likewise.
* stdlib/erand48.c (erand48): Likewise.
* stdlib/erand48_r.c (__erand48_r): Likewise.
* stdlib/jrand48.c (jrand48): Likewise.
* stdlib/jrand48_r.c (__jrand48_r): Likewise.
* stdlib/lcong48.c (lcong48): Likewise.
* stdlib/lcong48_r.c (__lcong48_r): Likewise.
* stdlib/nrand48.c (nrand48): Likewise.
* stdlib/nrand48_r.c (__nrand48_r): Likewise.
* stdlib/seed48.c (seed48): Likewise.
* stdlib/seed48_r.c (__seed48_r): Likewise.
* sysdeps/mach/hurd/execve.c (__execve): Likewise.
* sysdeps/mach/hurd/utimes.c (__utimes): Likewise.
* sysdeps/unix/sysv/linux/fexecve.c (fexecve): Likewise.

8 years agoRemove gnu_unique_object configure test.
Joseph Myers [Mon, 19 Oct 2015 22:34:20 +0000 (22:34 +0000)]
Remove gnu_unique_object configure test.

There is a configure test for assembler support for the
gnu_unique_object symbol type.  This support was added in binutils
2.20, so is present in all versions supported for building glibc.

Thus, I think the configure test can be removed; this patch does so.
Now, there is a caveat that the gas NEWS entry refers to this as a
feature for GNU/Linux targets.  But the condition is use of
ELFOSABI_GNU or ELFOSABI_NONE.  ELFOSABI_GNU covers Hurd as well as
GNU/Linux (as was the case with the older ELFOSABI_LINUX name), and
ELFOSABI_NONE means this is effectively OS-independent.  Furthermore,
I think a correct binutils port for any glibc target ought to support
this feature for use with glibc; glibc supports this as an
OS-independent feature (the configure test is only about glibc
testcases).

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

* configure.ac (libc_cv_asm_unique_object): Remove configure test.
* configure: Regenerated.
* config.h.in (HAVE_ASM_UNIQUE_OBJECT): Remove #undef.
* elf/tst-unique1.c (do_test) [HAVE_ASM_UNIQUE_OBJECT]: Make code
unconditional.
* elf/tst-unique1mod1.c [HAVE_ASM_UNIQUE_OBJECT]: Likewise.
* elf/tst-unique1mod2.c [HAVE_ASM_UNIQUE_OBJECT]: Likewise.
* elf/tst-unique2.c (do_test) [HAVE_ASM_UNIQUE_OBJECT]: Likewise.
(do_test) [!HAVE_ASM_UNIQUE_OBJECT]: Remove conditional code.
* elf/tst-unique2mod1.c [HAVE_ASM_UNIQUE_OBJECT]: Make code
unconditional.
* elf/tst-unique2mod2.c [HAVE_ASM_UNIQUE_OBJECT]: Likewise.

8 years agoDo not use -Wno-strict-prototypes.
Joseph Myers [Mon, 19 Oct 2015 21:24:50 +0000 (21:24 +0000)]
Do not use -Wno-strict-prototypes.

Two glibc makefiles use -Wno-strict-prototypes.  I don't know if this
was needed before my recent conversion of many function definitions to
prototype style, but it's not needed now; this patch removes it.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* posix/Makefile (CFLAGS-regex.c): Remove variable.
* resolv/Makefile (+cflags): Do not use -Wno-strict-prototypes.

8 years agoConvert 69 more function definitions to prototype style (line wrap cases).
Joseph Myers [Mon, 19 Oct 2015 21:23:47 +0000 (21:23 +0000)]
Convert 69 more function definitions to prototype style (line wrap cases).

This automatically-generated patch converts 69 function definitions in
glibc from old-style K&R to prototype-style.

This patch, covering both sysdeps and non-sysdeps files, deals with
cases where the prototype needed to be wrapped over more than one
line.  Otherwise, exclusions and caveats are as for
<https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> and
<https://sourceware.org/ml/libc-alpha/2015-10/msg00599.html>.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* crypt/crypt-entry.c (__crypt_r): Convert to prototype-style
function definition.
* crypt/crypt_util.c (__encrypt_r): Likewise.
* libio/genops.c (_IO_no_init): Likewise.
* libio/iofopncook.c (_IO_fopencookie): Likewise.
(_IO_old_fopencookie): Likewise.
* libio/iofwrite_u.c (fwrite_unlocked): Likewise.
* libio/iogetline.c (_IO_getline): Likewise.
(_IO_getline_info): Likewise.
* libio/iogetwline.c (_IO_getwline): Likewise.
(_IO_getwline_info): Likewise.
* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
* libio/vswprintf.c (_IO_vswprintf): Likewise.
* locale/programs/simple-hash.c (insert_entry_2): Likewise.
(find_entry): Likewise.
(iterate_table): Likewise.
(lookup): Likewise.
* login/forkpty.c (forkpty): Likewise.
* misc/hsearch_r.c (__hsearch_r): Likewise.
* misc/select.c (__select): Likewise.
* nptl/cleanup_defer_compat.c (_pthread_cleanup_pop_restore):
Likewise.
* nptl/old_pthread_cond_init.c (__pthread_cond_init_2_0):
Likewise.
* nptl/old_pthread_cond_timedwait.c
(__pthread_cond_timedwait_2_0): Likewise.
* nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise.
* nptl/pthread_barrierattr_getpshared.c
(pthread_barrierattr_getpshared): Likewise.
* nptl/pthread_getschedparam.c (__pthread_getschedparam):
Likewise.
* nptl/pthread_mutex_setprioceiling.c
(pthread_mutex_setprioceiling): Likewise.
* nptl/pthread_mutexattr_getprioceiling.c
(pthread_mutexattr_getprioceiling): Likewise.
* nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise.
* nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
Likewise.
* nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
Likewise.
* nptl/pthread_setschedparam.c (__pthread_setschedparam):
Likewise.
* socket/recvfrom.c (__recvfrom): Likewise.
* socket/sendto.c (__sendto): Likewise.
* socket/setsockopt.c (__setsockopt): Likewise.
* stdio-common/_itoa.c (_itoa): Likewise.
* stdio-common/_itowa.c (_itowa): Likewise.
* stdio-common/reg-printf.c (__register_printf_specifier):
Likewise.
(__register_printf_function): Likewise.
* stdio-common/tempname.c (__path_search): Likewise.
* stdlib/addmul_1.c (mpn_addmul_1): Likewise.
* stdlib/mul_1.c (mpn_mul_1): Likewise.
* stdlib/random_r.c (__initstate_r): Likewise.
* stdlib/setenv.c (__add_to_environ): Likewise.
* stdlib/submul_1.c (mpn_submul_1): Likewise.
* streams/getpmsg.c (getpmsg): Likewise.
* streams/putmsg.c (putmsg): Likewise.
* streams/putpmsg.c (putpmsg): Likewise.
* sunrpc/clnt_raw.c (clntraw_call): Likewise.
* sunrpc/clnt_tcp.c (clnttcp_call): Likewise.
* sunrpc/clnt_udp.c (clntudp_create): Likewise.
* sunrpc/clnt_unix.c (clntunix_call): Likewise.
* sunrpc/pm_getport.c (pmap_getport): Likewise.
* sunrpc/svc_udp.c (cache_get): Likewise.
* sunrpc/xdr_array.c (xdr_vector): Likewise.
* sysdeps/mach/hurd/getcwd.c
(__canonicalize_directory_name_internal): Likewise.
* sysdeps/mach/hurd/pselect.c (__pselect): Likewise.
* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
* sysdeps/mach/hurd/select.c (__select): Likewise.
* sysdeps/posix/ttyname_r.c (getttyname_r): Likewise.
* sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
* sysdeps/sparc/nptl/pthread_barrier_init.c
(__pthread_barrier_init): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
(__pthread_cond_timedwait): Likewise.
* sysdeps/unix/sysv/linux/i386/putmsg.c (putmsg): Likewise.
* sysdeps/unix/sysv/linux/s390/semtimedop.c (semtimedop):
Likewise.
* sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise.
* sysdeps/unix/sysv/linux/timer_settime.c (timer_settime):
Likewise.
* sysvipc/semtimedop.c (semtimedop): Likewise.
* time/setitimer.c (__setitimer): Likewise.
* time/strftime_l.c (emacs_strftime): Likewise.

8 years agouse -fstack-protector-strong when available
Mike Frysinger [Mon, 19 Oct 2015 17:07:28 +0000 (13:07 -0400)]
use -fstack-protector-strong when available

With gcc-4.9, a new -fstack-protector-strong flag is available that is
between -fstack-protector (pretty weak) and -fstack-protector-all (pretty
strong) that provides good trade-offs between overhead but still providing
good coverage.  Update the places in glibc that use ssp to use this flag
when it's available.

This also kills off the indirection of hardcoding the flag name in the
Makefiles and adding it based on a have-ssp boolean.  Instead, the build
always expands the $(stack-protector) variable to the best ssp setting.
This makes the build logic a bit simpler and allows people to easily set
to a diff flag like:
make stack-protector=-fstack-protector-all

8 years agoMark ld.so internel __fxstatat64 hidden
H.J. Lu [Mon, 19 Oct 2015 19:01:32 +0000 (12:01 -0700)]
Mark ld.so internel __fxstatat64 hidden

Since ld.so internel __fxstatat64 is only used internally in ld.so, it
can be made hidden.

[BZ #19122]
* include/sys/stat.h [IS_IN (rtld)] (__fxstatat64): Add
attribute_hidden.

8 years agoPowerPC: Fix a race condition when eliding a lock
Tulio Magno Quites Machado Filho [Wed, 22 Jul 2015 12:26:02 +0000 (09:26 -0300)]
PowerPC: Fix a race condition when eliding a lock

The previous code used to evaluate the preprocessor token is_lock_free to
a variable before starting a transaction.  This behavior can cause an
error if another thread got the lock (without using a transaction)
between the evaluation of the token and the beginning of the transaction.

This bug can be triggered with the following order of events:
1. The lock accessed by is_lock_free is free.
2. Thread T1 evaluates is_lock_free and stores into register R1 that the
   lock is free.
3. Thread T2 acquires the same lock used in is_lock_free.
4. T1 begins the transaction, creating a memory barrier where is_lock_free
   is false, but R1 is true.
5. T1 reads R1 and doesn't abort the transaction.
6. T1 calls ELIDE_UNLOCK, which reads false from is_lock_free and decides
   to unlock a lock acquired by T2, leading to undefined behavior.

This patch delays the evaluation of is_lock_free to inside a transaction
by moving this part of the code to the macro ELIDE_LOCK.

[BZ #18743]
* sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this
code to...
(ELIDE_LOCK): ...here.
(__get_new_count): New function with part of the code from
__elide_lock that updates the value of adapt_count after a
transaction abort.
(__elided_trylock): Moved this code to...
(ELIDE_TRYLOCK): ...here.

8 years agotimezone: polish grammar a bit in documentation
Mike Frysinger [Mon, 19 Oct 2015 18:12:03 +0000 (14:12 -0400)]
timezone: polish grammar a bit in documentation

Reported-by: ricaljasan@pacific.net
8 years agotimezone: document new --disable-timezone-tools option
Mike Frysinger [Mon, 19 Oct 2015 18:09:52 +0000 (14:09 -0400)]
timezone: document new --disable-timezone-tools option

Reported-by: Joseph Myers <joseph@codesourcery.com>
8 years agopt_chown: Clear any signal mask inherited from the parent process.
Geoffrey Thomas [Mon, 19 Oct 2015 14:03:28 +0000 (19:33 +0530)]
pt_chown: Clear any signal mask inherited from the parent process.

If grantpt() is called from a thread that is masking signals (for
instance, from a program using signalfd or using a dedicated
signal-handling thread), then that mask will get inherited to pt_chown.
This means that signals like SIGINT will not interrup pt_chown, so if it
hangs (e.g., because getgrnam("tty") hangs on a remote name service),
Ctrl-C will terminate the parent process but leave pt_chown around. Since
it's setuid, it's hard to kill any other way.

It is safe for pt_chown to unmask all signals, because grantpt() can be
(and usually is) called from an unprivileged process with all signals
unmasked.

8 years agoRemove -fgnu89-inline configure test.
Joseph Myers [Mon, 19 Oct 2015 12:07:03 +0000 (12:07 +0000)]
Remove -fgnu89-inline configure test.

There is a configure test for -fgnu89-inline.  This option was added
in GCC 4.2, so the test is obsolete; this patch removes it.

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

* configure.ac (libc_cv_gnu89_inline): Remove configure test.
* configure: Regenerated.
* config.make.in (gnu89-inline-CFLAGS): Remove variable.
* Makeconfig (CFLAGS): Use -fgnu89-inline instead of
$(gnu89-inline-CFLAGS).

8 years agoRemove .weak, .weakext configure tests.
Joseph Myers [Mon, 19 Oct 2015 12:06:00 +0000 (12:06 +0000)]
Remove .weak, .weakext configure tests.

There are configure tests for assembler .weak support, and, as a
fallback, for .weakext support.

.weakext appears to be an ECOFF thing (although a few ELF targets
support it as well).  .weak has been supported by the GNU assembler
for ELF targets since version 2.2, so given the requirement for ELF
the configure tests are obsolete; this patch removes them.

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

* configure.ac (libc_cv_asm_weak_directive): Remove configure
test.
(libc_cv_asm_weakext_directive): Likewise.
* configure: Regenerated.
* config.h.in (HAVE_ASM_WEAK_DIRECTIVE): Remove #undef.
(HAVE_ASM_WEAKEXT_DIRECTIVE): Likewise.
* include/libc-symbols.h
[!HAVE_ASM_WEAK_DIRECTIVE && !HAVE_ASM_WEAKEXT_DIRECTIVE]: Remove
#error.
[HAVE_ASM_WEAKEXT_DIRECTIVE]: Remove conditional code.
[!HAVE_ASM_WEAKEXT_DIRECTIVE]: Make code unconditional.

8 years agoConvert 231 sysdeps function definitions to prototype style.
Joseph Myers [Mon, 19 Oct 2015 12:04:33 +0000 (12:04 +0000)]
Convert 231 sysdeps function definitions to prototype style.

This mostly automatically-generated patch converts 231 sysdeps
function definitions in glibc from old-style K&R to prototype-style.

For __aio_sigqueue and __gai_sigqueue I had to add internal_function
to the definitions as noted by Florian in
<https://sourceware.org/ml/libc-alpha/2015-10/msg00595.html> to keep
the functions compiling on x86 after conversion to prototype
definitions.  Otherwise, the patch is automatically generated with all
the same exclusions and caveats as in
<https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> except
that it's a patch for sysdeps files.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).  Also tested for arm,
mips64 and powerpc32 that installed stripped shared libraries are
unchanged by the patch.

* sysdeps/arm/backtrace.c (__backtrace): Convert to
prototype-style function definition.
* sysdeps/i386/backtrace.c (__backtrace): Likewise.
* sysdeps/i386/ffs.c (__ffs): Likewise.
* sysdeps/i386/i686/ffs.c (__ffs): Likewise.
* sysdeps/ia64/nptl/pthread_spin_lock.c (pthread_spin_lock):
Likewise.
* sysdeps/ia64/nptl/pthread_spin_trylock.c (pthread_spin_trylock):
Likewise.
* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l):
Likewise.
* sysdeps/m68k/ffs.c (__ffs): Likewise.
* sysdeps/m68k/m680x0/fpu/e_acos.c (FUNC): Likewise.
* sysdeps/m68k/m680x0/fpu/e_fmod.c (FUNC): Likewise.
* sysdeps/mach/adjtime.c (__adjtime): Likewise.
* sysdeps/mach/gettimeofday.c (__gettimeofday): Likewise.
* sysdeps/mach/hurd/_exit.c (_exit): Likewise.
* sysdeps/mach/hurd/access.c (__access): Likewise.
* sysdeps/mach/hurd/adjtime.c (__adjtime): Likewise.
* sysdeps/mach/hurd/chdir.c (__chdir): Likewise.
* sysdeps/mach/hurd/chmod.c (__chmod): Likewise.
* sysdeps/mach/hurd/chown.c (__chown): Likewise.
* sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Likewise.
(cthread_getspecific): Likewise.
(cthread_setspecific): Likewise.
(__libc_getspecific): Likewise.
* sysdeps/mach/hurd/euidaccess.c (__euidaccess): Likewise.
* sysdeps/mach/hurd/faccessat.c (faccessat): Likewise.
* sysdeps/mach/hurd/fchdir.c (__fchdir): Likewise.
* sysdeps/mach/hurd/fchmod.c (__fchmod): Likewise.
* sysdeps/mach/hurd/fchmodat.c (fchmodat): Likewise.
* sysdeps/mach/hurd/fchown.c (__fchown): Likewise.
* sysdeps/mach/hurd/fchownat.c (fchownat): Likewise.
* sysdeps/mach/hurd/flock.c (__flock): Likewise.
* sysdeps/mach/hurd/fsync.c (fsync): Likewise.
* sysdeps/mach/hurd/ftruncate.c (__ftruncate): Likewise.
* sysdeps/mach/hurd/getgroups.c (__getgroups): Likewise.
* sysdeps/mach/hurd/gethostname.c (__gethostname): Likewise.
* sysdeps/mach/hurd/getitimer.c (__getitimer): Likewise.
* sysdeps/mach/hurd/getlogin_r.c (__getlogin_r): Likewise.
* sysdeps/mach/hurd/getpgid.c (__getpgid): Likewise.
* sysdeps/mach/hurd/getrusage.c (__getrusage): Likewise.
* sysdeps/mach/hurd/getsockname.c (__getsockname): Likewise.
* sysdeps/mach/hurd/group_member.c (__group_member): Likewise.
* sysdeps/mach/hurd/isatty.c (__isatty): Likewise.
* sysdeps/mach/hurd/lchown.c (__lchown): Likewise.
* sysdeps/mach/hurd/link.c (__link): Likewise.
* sysdeps/mach/hurd/linkat.c (linkat): Likewise.
* sysdeps/mach/hurd/listen.c (__listen): Likewise.
* sysdeps/mach/hurd/mkdir.c (__mkdir): Likewise.
* sysdeps/mach/hurd/mkdirat.c (mkdirat): Likewise.
* sysdeps/mach/hurd/openat.c (__openat): Likewise.
* sysdeps/mach/hurd/poll.c (__poll): Likewise.
* sysdeps/mach/hurd/readlink.c (__readlink): Likewise.
* sysdeps/mach/hurd/readlinkat.c (readlinkat): Likewise.
* sysdeps/mach/hurd/recv.c (__recv): Likewise.
* sysdeps/mach/hurd/rename.c (rename): Likewise.
* sysdeps/mach/hurd/renameat.c (renameat): Likewise.
* sysdeps/mach/hurd/revoke.c (revoke): Likewise.
* sysdeps/mach/hurd/rewinddir.c (__rewinddir): Likewise.
* sysdeps/mach/hurd/rmdir.c (__rmdir): Likewise.
* sysdeps/mach/hurd/seekdir.c (seekdir): Likewise.
* sysdeps/mach/hurd/send.c (__send): Likewise.
* sysdeps/mach/hurd/setdomain.c (setdomainname): Likewise.
* sysdeps/mach/hurd/setegid.c (setegid): Likewise.
* sysdeps/mach/hurd/seteuid.c (seteuid): Likewise.
* sysdeps/mach/hurd/setgid.c (__setgid): Likewise.
* sysdeps/mach/hurd/setgroups.c (setgroups): Likewise.
* sysdeps/mach/hurd/sethostid.c (sethostid): Likewise.
* sysdeps/mach/hurd/sethostname.c (sethostname): Likewise.
* sysdeps/mach/hurd/setlogin.c (setlogin): Likewise.
* sysdeps/mach/hurd/setpgid.c (__setpgid): Likewise.
* sysdeps/mach/hurd/setregid.c (__setregid): Likewise.
* sysdeps/mach/hurd/setreuid.c (__setreuid): Likewise.
* sysdeps/mach/hurd/settimeofday.c (__settimeofday): Likewise.
* sysdeps/mach/hurd/setuid.c (__setuid): Likewise.
* sysdeps/mach/hurd/shutdown.c (shutdown): Likewise.
* sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise.
* sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise.
* sysdeps/mach/hurd/sigpending.c (sigpending): Likewise.
* sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise.
* sysdeps/mach/hurd/sigsuspend.c (__sigsuspend): Likewise.
* sysdeps/mach/hurd/socket.c (__socket): Likewise.
* sysdeps/mach/hurd/symlink.c (__symlink): Likewise.
* sysdeps/mach/hurd/symlinkat.c (symlinkat): Likewise.
* sysdeps/mach/hurd/telldir.c (telldir): Likewise.
* sysdeps/mach/hurd/truncate.c (__truncate): Likewise.
* sysdeps/mach/hurd/umask.c (__umask): Likewise.
* sysdeps/mach/hurd/unlink.c (__unlink): Likewise.
* sysdeps/mach/hurd/unlinkat.c (unlinkat): Likewise.
* sysdeps/mips/mips64/__longjmp.c (__longjmp): Likewise.
* sysdeps/posix/alarm.c (alarm): Likewise.
* sysdeps/posix/cuserid.c (cuserid): Likewise.
* sysdeps/posix/dirfd.c (dirfd): Likewise.
* sysdeps/posix/dup.c (__dup): Likewise.
* sysdeps/posix/dup2.c (__dup2): Likewise.
* sysdeps/posix/euidaccess.c (euidaccess): Likewise.
(main): Likewise.
* sysdeps/posix/flock.c (__flock): Likewise.
* sysdeps/posix/fpathconf.c (__fpathconf): Likewise.
* sysdeps/posix/getcwd.c (__getcwd): Likewise.
* sysdeps/posix/gethostname.c (__gethostname): Likewise.
* sysdeps/posix/gettimeofday.c (__gettimeofday): Likewise.
* sysdeps/posix/isatty.c (__isatty): Likewise.
* sysdeps/posix/killpg.c (killpg): Likewise.
* sysdeps/posix/libc_fatal.c (__libc_fatal): Likewise.
* sysdeps/posix/mkfifoat.c (mkfifoat): Likewise.
* sysdeps/posix/raise.c (raise): Likewise.
* sysdeps/posix/remove.c (remove): Likewise.
* sysdeps/posix/rename.c (rename): Likewise.
* sysdeps/posix/rewinddir.c (__rewinddir): Likewise.
* sysdeps/posix/seekdir.c (seekdir): Likewise.
* sysdeps/posix/sigblock.c (__sigblock): Likewise.
* sysdeps/posix/sigignore.c (sigignore): Likewise.
* sysdeps/posix/sigintr.c (siginterrupt): Likewise.
* sysdeps/posix/signal.c (__bsd_signal): Likewise.
* sysdeps/posix/sigset.c (sigset): Likewise.
* sysdeps/posix/sigsuspend.c (__sigsuspend): Likewise.
* sysdeps/posix/sysconf.c (__sysconf): Likewise.
* sysdeps/posix/sysv_signal.c (__sysv_signal): Likewise.
* sysdeps/posix/time.c (time): Likewise.
* sysdeps/posix/ttyname.c (getttyname): Likewise.
(ttyname): Likewise.
* sysdeps/posix/ttyname_r.c (__ttyname_r): Likewise.
* sysdeps/posix/utime.c (utime): Likewise.
* sysdeps/powerpc/fpu/s_isnan.c (__isnan): Likewise.
* sysdeps/powerpc/nptl/pthread_spin_lock.c (pthread_spin_lock):
Likewise.
* sysdeps/powerpc/nptl/pthread_spin_trylock.c
(pthread_spin_trylock): Likewise.
* sysdeps/pthread/aio_error.c (aio_error): Likewise.
* sysdeps/pthread/aio_read.c (aio_read): Likewise.
* sysdeps/pthread/aio_read64.c (aio_read64): Likewise.
* sysdeps/pthread/aio_write.c (aio_write): Likewise.
* sysdeps/pthread/aio_write64.c (aio_write64): Likewise.
* sysdeps/pthread/flockfile.c (__flockfile): Likewise.
* sysdeps/pthread/ftrylockfile.c (__ftrylockfile): Likewise.
* sysdeps/pthread/funlockfile.c (__funlockfile): Likewise.
* sysdeps/pthread/timer_create.c (timer_create): Likewise.
* sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise.
* sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise.
* sysdeps/s390/ffs.c (__ffs): Likewise.
* sysdeps/s390/nptl/pthread_spin_lock.c (pthread_spin_lock):
Likewise.
* sysdeps/s390/nptl/pthread_spin_trylock.c (pthread_spin_trylock):
Likewise.
* sysdeps/sh/nptl/pthread_spin_lock.c (pthread_spin_lock):
Likewise.
* sysdeps/sparc/nptl/pthread_barrier_destroy.c
(pthread_barrier_destroy): Likewise.
* sysdeps/sparc/nptl/pthread_barrier_wait.c
(__pthread_barrier_wait): Likewise.
* sysdeps/sparc/sparc32/e_sqrt.c (__ieee754_sqrt): Likewise.
* sysdeps/sparc/sparc32/pthread_barrier_wait.c
(__pthread_barrier_wait): Likewise.
* sysdeps/sparc/sparc32/sem_init.c (__old_sem_init): Likewise.
* sysdeps/tile/memcmp.c (memcmp_common_alignment): Likewise.
(memcmp_not_common_alignment): Likewise.
(MEMCMP): Likewise.
* sysdeps/tile/wordcopy.c (_wordcopy_fwd_aligned): Likewise.
(_wordcopy_fwd_dest_aligned): Likewise.
(_wordcopy_bwd_aligned): Likewise.
(_wordcopy_bwd_dest_aligned): Likewise.
* sysdeps/unix/bsd/ftime.c (ftime): Likewise.
* sysdeps/unix/bsd/gtty.c (gtty): Likewise.
* sysdeps/unix/bsd/stty.c (stty): Likewise.
* sysdeps/unix/bsd/tcflow.c (tcflow): Likewise.
* sysdeps/unix/bsd/tcflush.c (tcflush): Likewise.
* sysdeps/unix/bsd/tcgetattr.c (__tcgetattr): Likewise.
* sysdeps/unix/bsd/tcgetpgrp.c (tcgetpgrp): Likewise.
* sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Likewise.
* sysdeps/unix/bsd/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/bsd/tcsetpgrp.c (tcsetpgrp): Likewise.
* sysdeps/unix/bsd/ualarm.c (ualarm): Likewise.
* sysdeps/unix/bsd/wait3.c (__wait3): Likewise.
* sysdeps/unix/getlogin_r.c (__getlogin_r): Likewise.
* sysdeps/unix/sockatmark.c (sockatmark): Likewise.
* sysdeps/unix/stime.c (stime): Likewise.
* sysdeps/unix/sysv/linux/_exit.c (_exit): Likewise.
* sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue):
Likewise.  Use internal_function.
* sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction):
Convert to prototype-style function definition.
* sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise.
* sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise.
* sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Likewise.
* sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue):
Likewise.  Use internal_function.
* sysdeps/unix/sysv/linux/gethostid.c (sethostid): Convert to
prototype-style function definition
* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
Likewise.
(__getlogin_r): Likewise.
* sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c
(__pthread_cond_broadcast): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c
(__pthread_cond_destroy): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c
(__pthread_cond_init): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c
(__pthread_cond_signal): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
(__pthread_cond_wait): Likewise.
* sysdeps/unix/sysv/linux/i386/getmsg.c (getmsg): Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/ia64/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/ia64/sigpending.c (sigpending):
Likewise.
* sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask):
Likewise.
* sysdeps/unix/sysv/linux/mips/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/msgget.c (msgget): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
(__ftruncate64): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
(truncate64): Likewise.
* sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise.
* sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
(pthread_getcpuclockid): Likewise.
* sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
Likewise.
* sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np):
Likewise.
* sysdeps/unix/sysv/linux/pthread_sigmask.c (pthread_sigmask):
Likewise.
* sysdeps/unix/sysv/linux/pthread_sigqueue.c (pthread_sigqueue):
Likewise.
* sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c
(__libc_sigaction): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c (sigpending):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c
(__sigprocmask): Likewise.
* sysdeps/unix/sysv/linux/semget.c (semget): Likewise.
* sysdeps/unix/sysv/linux/semop.c (semop): Likewise.
* sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64): Likewise.
* sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise.
* sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise.
* sysdeps/unix/sysv/linux/shmget.c (shmget): Likewise.
* sysdeps/unix/sysv/linux/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/sigpending.c (sigpending): Likewise.
* sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask): Likewise.
* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise.
* sysdeps/unix/sysv/linux/sigstack.c (sigstack): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c (sigpending):
Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
(__sigprocmask): Likewise.
* sysdeps/unix/sysv/linux/speed.c (cfgetospeed): Likewise.
(cfgetispeed): Likewise.
(cfsetospeed): Likewise.
(cfsetispeed): Likewise.
* sysdeps/unix/sysv/linux/tcflow.c (tcflow): Likewise.
* sysdeps/unix/sysv/linux/tcflush.c (tcflush): Likewise.
* sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Likewise.
* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/sysv/linux/time.c (time): Likewise.
* sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
* sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Likewise.
* sysdeps/unix/sysv/linux/timer_getoverr.c (timer_getoverrun):
Likewise.
* sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/sigpending.c (sigpending):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask):
Likewise.
* sysdeps/x86_64/backtrace.c (__backtrace): Likewise.

8 years agosunrpc: Rewrite with explicit TLS access using __thread
Florian Weimer [Sat, 17 Oct 2015 10:07:04 +0000 (12:07 +0200)]
sunrpc: Rewrite with explicit TLS access using __thread

8 years agomalloc: Rewrite with explicit TLS access using __thread
Florian Weimer [Sat, 17 Oct 2015 10:06:48 +0000 (12:06 +0200)]
malloc: Rewrite with explicit TLS access using __thread

8 years agovfprintf: Rewrite printf_positional to use struct scratch_buffer
Florian Weimer [Sat, 17 Oct 2015 10:05:12 +0000 (12:05 +0200)]
vfprintf: Rewrite printf_positional to use struct scratch_buffer

8 years agoAssume that SOCK_CLOEXEC is available and works
Florian Weimer [Sat, 17 Oct 2015 10:02:37 +0000 (12:02 +0200)]
Assume that SOCK_CLOEXEC is available and works

This fixes (harmless) data races when accessing the various
__have_sock_cloexec variables.

8 years agoThe va_list pointer is unspecified after a call to vfprintf [BZ #18982]
Florian Weimer [Sat, 17 Oct 2015 10:02:22 +0000 (12:02 +0200)]
The va_list pointer is unspecified after a call to vfprintf [BZ #18982]

This adjusts the documentation to the existing implementation.

8 years agolt_LT: change currency symbol to the euro [BZ #18953]
Gunnar Hjalmarsson [Wed, 16 Sep 2015 20:22:26 +0000 (22:22 +0200)]
lt_LT: change currency symbol to the euro [BZ #18953]

Lithuania switched currency to the Euro on 1st Jan 2015.

8 years agohu_HU: change time separator to colon [BZ #18918]
Egmont Koblinger [Tue, 13 Oct 2015 18:48:55 +0000 (20:48 +0200)]
hu_HU: change time separator to colon [BZ #18918]

The previous (11th) version of the Hungarian spelling rules (released
in 1984) said that the separator had to be a dot, e.g. 10.35 meaning
10 o'clock 35 minutes. glibc correctly implements this.

The brand new (12th) version, in effect since September 1, 2015 adopts
to the common use of colon (especially in the digital world) and
allows to use either separator, without even expressing a preference.

For computer systems, using colons is way more typical and probably
easier to recognize. Dot is typically used in printed materials.

It also avoids an almost ambiguous situation where a space makes a
difference, e.g. "10.15-ig" means "until 10 o'clock 15 minutes"
whereas "10. 15-ig" means "until 15th of October". So I believe using
the colon as the separator is not only more frequent in the computer
world, but is also easier and quicker to recognize for the brain that
it's about hour:minute rather than month and day. And luckily it's now
equally correct according to the official rules.

11th edition: http://helyesiras.mta.hu/helyesiras/default/akh11

12th edition: http://helyesiras.mta.hu/helyesiras/default/akh12

In both editions it's the very last (299th and 300th, respectively) rule.

Microsoft also uses and recommends a colon since at least May 2011:
http://download.microsoft.com/download/e/6/1/e61266b2-d8b4-4fe0-a553-f01dc3976675/hun-hun-StyleGuide.pdf
  The time format is different in common language and in the language of
  IT. In common texts we usually do not abbreviate, so the full forms are
  used: “7 óra 10 perckor csörgött a telefon”. However, the short format,
  consisting of numerals only, can also be used. In this case a period
  must be used between the two numbers and there must not be a space
  between them: “találkozzunk 10.45-kor”.

  However, in software mostly the short format is used, and the numbers
  are separated by a colon. An obvious example is the clock in the bottom
  right corner of your screen, thus 18:31.

8 years agoAdd more libm tests (fabs, fdim, fma, fmax, fmin, fmod).
Joseph Myers [Fri, 16 Oct 2015 22:52:52 +0000 (22:52 +0000)]
Add more libm tests (fabs, fdim, fma, fmax, fmin, fmod).

This patch improves the libm test coverage for a few more functions.

Tested for x86_64 and x86.

* math/libm-test.inc (fabs_test_data): Add more tests.
(fdim_test_data): Likewise.
(fma_test_data): Likewise.
(fmax_test_data): Likewise.
(fmin_test_data): Likewise.
(fmod_test_data): Likewise.

8 years ago Make performance improvement to MIPS memcpy for small copies.
Steve Ellcey [Fri, 16 Oct 2015 21:32:49 +0000 (14:32 -0700)]
Make performance improvement to MIPS memcpy for small copies.

* sysdeps/mips/memcpy.S (memcpy):  Add word copies for small aligned
data.

8 years agoAdd more tests for ceil, floor, round, trunc.
Joseph Myers [Fri, 16 Oct 2015 21:28:03 +0000 (21:28 +0000)]
Add more tests for ceil, floor, round, trunc.

This patch adds more tests for ceil, floor, round and trunc, with a
particular focus on verifying they don't raise spurious "inexact"
exceptions for integer arguments (a C99 / C11 requirement, as opposed
to the general principle that they shouldn't raise "inexact" for any
arguments at all which is a TS 18661-1 requirement).

Tested for x86_64 and x86.

* math/libm-test.inc (ceil_test_data): Add more tests and more
expectations for "inexact".
(floor_test_data): Add more tests.
(round_test_data): Likewise.
(trunc_test_data): Likewise.

8 years agoConvert 703 function definitions to prototype style.
Joseph Myers [Fri, 16 Oct 2015 20:21:49 +0000 (20:21 +0000)]
Convert 703 function definitions to prototype style.

This automatically-generated patch converts 703 function definitions
in glibc from old-style K&R to prototype-style.

This conversion is deliberately simplistic, excluding any tricky cases
as even a patch covering only simple cases is still very large.
Currently excluded are: sysdeps files (to improve test coverage for
the initial patch); files containing assertions (to avoid line number
changes so that generated libraries can be compared); any cases where
the generated function declaration would involve lines over 79
characters and so need to be wrapped; any cases with array parameters
or other cases where parameter declarators don't end with the
parameter name; any other cases that my script didn't parse.

I didn't try to make the ChangeLog generation indicate when function
definitions are conditional; it just lists the functions changed
without regard to that.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* crypt/cert.c (good_bye): Convert to prototype-style function
definition.
(get8): Likewise.
(put8): Likewise.
* crypt/crypt-entry.c (crypt): Likewise.
(__fcrypt): Likewise.
* crypt/crypt_util.c (_ufc_prbits): Likewise.
(_ufc_set_bits): Likewise.
(_ufc_clearmem): Likewise.
(__init_des_r): Likewise.
(shuffle_sb): Likewise.
(shuffle_sb): Likewise.
(_ufc_setup_salt_r): Likewise.
(_ufc_mk_keytab_r): Likewise.
(_ufc_dofinalperm_r): Likewise.
(encrypt): Likewise.
(__setkey_r): Likewise.
(setkey): Likewise.
* crypt/md5.c (md5_init_ctx): Likewise.
(md5_read_ctx): Likewise.
(md5_finish_ctx): Likewise.
(md5_stream): Likewise.
(md5_buffer): Likewise.
(md5_process_bytes): Likewise.
* crypt/sha256.c (__sha256_init_ctx): Likewise.
(__sha256_finish_ctx): Likewise.
(__sha256_process_bytes): Likewise.
* crypt/sha512.c (__sha512_init_ctx): Likewise.
(__sha512_finish_ctx): Likewise.
(__sha512_process_bytes): Likewise.
* ctype/isctype.c (__isctype): Likewise.
* debug/backtrace.c (__backtrace): Likewise.
* debug/backtracesymsfd.c (__backtrace_symbols_fd): Likewise.
* debug/fgets_chk.c (__fgets_chk): Likewise.
* debug/fgets_u_chk.c (__fgets_unlocked_chk): Likewise.
* debug/memcpy_chk.c (__memcpy_chk): Likewise.
* debug/memmove_chk.c (MEMMOVE_CHK): Likewise.
* debug/mempcpy_chk.c (__mempcpy_chk): Likewise.
* debug/memset_chk.c (__memset_chk): Likewise.
* debug/strcat_chk.c (__strcat_chk): Likewise.
* debug/strncat_chk.c (__strncat_chk): Likewise.
* debug/strncpy_chk.c (__strncpy_chk): Likewise.
* debug/vsprintf_chk.c (_IO_str_chk_overflow): Likewise.
* dirent/dirfd.c (dirfd): Likewise.
* dirent/getdents.c (__getdirentries): Likewise.
* dirent/getdents64.c (getdirentries64): Likewise.
* dirent/rewinddir.c (__rewinddir): Likewise.
* dirent/seekdir.c (seekdir): Likewise.
* dirent/telldir.c (telldir): Likewise.
* elf/sln.c (makesymlinks): Likewise.
(makesymlink): Likewise.
* gmon/gmon.c (__moncontrol): Likewise.
(__monstartup): Likewise.
(write_hist): Likewise.
(write_call_graph): Likewise.
(write_bb_counts): Likewise.
* grp/setgroups.c (setgroups): Likewise.
* inet/inet_lnaof.c (inet_lnaof): Likewise.
* inet/inet_net.c (inet_network): Likewise.
* inet/inet_netof.c (inet_netof): Likewise.
* inet/rcmd.c (rresvport_af): Likewise.
(rresvport): Likewise.
* io/access.c (__access): Likewise.
* io/chdir.c (__chdir): Likewise.
* io/chmod.c (__chmod): Likewise.
* io/chown.c (__chown): Likewise.
* io/close.c (__close): Likewise.
* io/creat.c (creat): Likewise.
* io/creat64.c (creat64): Likewise.
* io/dup.c (__dup): Likewise.
* io/dup2.c (__dup2): Likewise.
* io/dup3.c (__dup3): Likewise.
* io/euidaccess.c (__euidaccess): Likewise.
* io/faccessat.c (faccessat): Likewise.
* io/fchmod.c (__fchmod): Likewise.
* io/fchmodat.c (fchmodat): Likewise.
* io/fchown.c (__fchown): Likewise.
* io/fchownat.c (fchownat): Likewise.
* io/fcntl.c (__fcntl): Likewise.
* io/flock.c (__flock): Likewise.
* io/fts.c (fts_load): Likewise.
(fts_close): Likewise.
(fts_read): Likewise.
(fts_set): Likewise.
(fts_children): Likewise.
(fts_build): Likewise.
(fts_stat): Likewise.
(fts_sort): Likewise.
(fts_alloc): Likewise.
(fts_lfree): Likewise.
(fts_palloc): Likewise.
(fts_padjust): Likewise.
(fts_maxarglen): Likewise.
(fts_safe_changedir): Likewise.
* io/getwd.c (getwd): Likewise.
* io/isatty.c (__isatty): Likewise.
* io/lchown.c (__lchown): Likewise.
* io/link.c (__link): Likewise.
* io/linkat.c (linkat): Likewise.
* io/lseek.c (__libc_lseek): Likewise.
* io/mkdir.c (__mkdir): Likewise.
* io/mkdirat.c (mkdirat): Likewise.
* io/mkfifo.c (mkfifo): Likewise.
* io/mkfifoat.c (mkfifoat): Likewise.
* io/open.c (__libc_open): Likewise.
* io/open64.c (__libc_open64): Likewise.
* io/readlink.c (__readlink): Likewise.
* io/readlinkat.c (readlinkat): Likewise.
* io/rmdir.c (__rmdir): Likewise.
* io/symlink.c (__symlink): Likewise.
* io/symlinkat.c (symlinkat): Likewise.
* io/ttyname.c (ttyname): Likewise.
* io/ttyname_r.c (__ttyname_r): Likewise.
* io/umask.c (__umask): Likewise.
* io/unlink.c (__unlink): Likewise.
* io/unlinkat.c (unlinkat): Likewise.
* io/utime.c (utime): Likewise.
* libio/clearerr.c (clearerr): Likewise.
* libio/clearerr_u.c (clearerr_unlocked): Likewise.
* libio/feof.c (_IO_feof): Likewise.
* libio/feof_u.c (feof_unlocked): Likewise.
* libio/ferror.c (_IO_ferror): Likewise.
* libio/ferror_u.c (ferror_unlocked): Likewise.
* libio/filedoalloc.c (_IO_file_doallocate): Likewise.
* libio/fileno.c (__fileno): Likewise.
* libio/fputc.c (fputc): Likewise.
* libio/fputc_u.c (fputc_unlocked): Likewise.
* libio/fputwc.c (fputwc): Likewise.
* libio/fputwc_u.c (fputwc_unlocked): Likewise.
* libio/freopen.c (freopen): Likewise.
* libio/freopen64.c (freopen64): Likewise.
* libio/fseek.c (fseek): Likewise.
* libio/fseeko.c (fseeko): Likewise.
* libio/fseeko64.c (fseeko64): Likewise.
* libio/ftello.c (__ftello): Likewise.
* libio/ftello64.c (ftello64): Likewise.
* libio/fwide.c (fwide): Likewise.
* libio/genops.c (_IO_un_link): Likewise.
(_IO_link_in): Likewise.
(_IO_least_marker): Likewise.
(_IO_switch_to_main_get_area): Likewise.
(_IO_switch_to_backup_area): Likewise.
(_IO_switch_to_get_mode): Likewise.
(_IO_free_backup_area): Likewise.
(_IO_switch_to_put_mode): Likewise.
(__overflow): Likewise.
(__underflow): Likewise.
(__uflow): Likewise.
(_IO_setb): Likewise.
(_IO_doallocbuf): Likewise.
(_IO_default_underflow): Likewise.
(_IO_default_uflow): Likewise.
(_IO_default_xsputn): Likewise.
(_IO_sgetn): Likewise.
(_IO_default_xsgetn): Likewise.
(_IO_sync): Likewise.
(_IO_default_setbuf): Likewise.
(_IO_default_seekpos): Likewise.
(_IO_default_doallocate): Likewise.
(_IO_init): Likewise.
(_IO_old_init): Likewise.
(_IO_default_sync): Likewise.
(_IO_default_finish): Likewise.
(_IO_default_seekoff): Likewise.
(_IO_sputbackc): Likewise.
(_IO_sungetc): Likewise.
(_IO_set_column): Likewise.
(_IO_set_column): Likewise.
(_IO_adjust_column): Likewise.
(_IO_get_column): Likewise.
(_IO_init_marker): Likewise.
(_IO_remove_marker): Likewise.
(_IO_marker_difference): Likewise.
(_IO_marker_delta): Likewise.
(_IO_seekmark): Likewise.
(_IO_unsave_markers): Likewise.
(_IO_nobackup_pbackfail): Likewise.
(_IO_default_pbackfail): Likewise.
(_IO_default_seek): Likewise.
(_IO_default_stat): Likewise.
(_IO_default_read): Likewise.
(_IO_default_write): Likewise.
(_IO_default_showmanyc): Likewise.
(_IO_default_imbue): Likewise.
(_IO_iter_next): Likewise.
(_IO_iter_file): Likewise.
* libio/getc.c (_IO_getc): Likewise.
* libio/getwc.c (_IO_getwc): Likewise.
* libio/iofclose.c (_IO_new_fclose): Likewise.
* libio/iofdopen.c (_IO_new_fdopen): Likewise.
* libio/iofflush.c (_IO_fflush): Likewise.
* libio/iofflush_u.c (__fflush_unlocked): Likewise.
* libio/iofgetpos.c (_IO_new_fgetpos): Likewise.
* libio/iofgetpos64.c (_IO_new_fgetpos64): Likewise.
* libio/iofgets.c (_IO_fgets): Likewise.
* libio/iofgets_u.c (__fgets_unlocked): Likewise.
* libio/iofgetws.c (fgetws): Likewise.
* libio/iofgetws_u.c (fgetws_unlocked): Likewise.
* libio/iofopen64.c (_IO_fopen64): Likewise.
* libio/iofopncook.c (_IO_cookie_read): Likewise.
(_IO_cookie_write): Likewise.
(_IO_cookie_seek): Likewise.
(_IO_cookie_close): Likewise.
(_IO_cookie_seekoff): Likewise.
(_IO_old_cookie_seek): Likewise.
* libio/iofputs.c (_IO_fputs): Likewise.
* libio/iofputs_u.c (__fputs_unlocked): Likewise.
* libio/iofputws.c (fputws): Likewise.
* libio/iofputws_u.c (fputws_unlocked): Likewise.
* libio/iofread.c (_IO_fread): Likewise.
* libio/iofread_u.c (__fread_unlocked): Likewise.
* libio/iofsetpos.c (_IO_new_fsetpos): Likewise.
* libio/iofsetpos64.c (_IO_new_fsetpos64): Likewise.
* libio/ioftell.c (_IO_ftell): Likewise.
* libio/iofwrite.c (_IO_fwrite): Likewise.
* libio/iogetdelim.c (_IO_getdelim): Likewise.
* libio/iogets.c (_IO_gets): Likewise.
* libio/iopadn.c (_IO_padn): Likewise.
* libio/iopopen.c (_IO_new_proc_open): Likewise.
(_IO_new_popen): Likewise.
(_IO_new_proc_close): Likewise.
* libio/ioputs.c (_IO_puts): Likewise.
* libio/ioseekoff.c (_IO_seekoff_unlocked): Likewise.
(_IO_seekoff): Likewise.
* libio/ioseekpos.c (_IO_seekpos_unlocked): Likewise.
(_IO_seekpos): Likewise.
* libio/iosetbuffer.c (_IO_setbuffer): Likewise.
* libio/iosetvbuf.c (_IO_setvbuf): Likewise.
* libio/ioungetc.c (_IO_ungetc): Likewise.
* libio/ioungetwc.c (ungetwc): Likewise.
* libio/iovdprintf.c (_IO_vdprintf): Likewise.
* libio/iovsscanf.c (_IO_vsscanf): Likewise.
* libio/iowpadn.c (_IO_wpadn): Likewise.
* libio/libc_fatal.c (__libc_fatal): Likewise.
* libio/memstream.c (__open_memstream): Likewise.
(_IO_mem_sync): Likewise.
(_IO_mem_finish): Likewise.
* libio/oldfileops.c (_IO_old_file_init): Likewise.
(_IO_old_file_close_it): Likewise.
(_IO_old_file_finish): Likewise.
(_IO_old_file_fopen): Likewise.
(_IO_old_file_attach): Likewise.
(_IO_old_file_setbuf): Likewise.
(_IO_old_do_write): Likewise.
(old_do_write): Likewise.
(_IO_old_file_underflow): Likewise.
(_IO_old_file_overflow): Likewise.
(_IO_old_file_sync): Likewise.
(_IO_old_file_seekoff): Likewise.
(_IO_old_file_write): Likewise.
(_IO_old_file_xsputn): Likewise.
* libio/oldiofclose.c (_IO_old_fclose): Likewise.
* libio/oldiofdopen.c (_IO_old_fdopen): Likewise.
* libio/oldiofgetpos.c (_IO_old_fgetpos): Likewise.
* libio/oldiofgetpos64.c (_IO_old_fgetpos64): Likewise.
* libio/oldiofopen.c (_IO_old_fopen): Likewise.
* libio/oldiofsetpos.c (_IO_old_fsetpos): Likewise.
* libio/oldiofsetpos64.c (_IO_old_fsetpos64): Likewise.
* libio/oldiopopen.c (_IO_old_proc_open): Likewise.
(_IO_old_popen): Likewise.
(_IO_old_proc_close): Likewise.
* libio/oldpclose.c (__old_pclose): Likewise.
* libio/pclose.c (__new_pclose): Likewise.
* libio/peekc.c (_IO_peekc_locked): Likewise.
* libio/putc.c (_IO_putc): Likewise.
* libio/putc_u.c (putc_unlocked): Likewise.
* libio/putchar.c (putchar): Likewise.
* libio/putchar_u.c (putchar_unlocked): Likewise.
* libio/putwc.c (putwc): Likewise.
* libio/putwc_u.c (putwc_unlocked): Likewise.
* libio/putwchar.c (putwchar): Likewise.
* libio/putwchar_u.c (putwchar_unlocked): Likewise.
* libio/rewind.c (rewind): Likewise.
* libio/setbuf.c (setbuf): Likewise.
* libio/setlinebuf.c (setlinebuf): Likewise.
* libio/vasprintf.c (_IO_vasprintf): Likewise.
* libio/vscanf.c (_IO_vscanf): Likewise.
* libio/vsnprintf.c (_IO_strn_overflow): Likewise.
* libio/vswprintf.c (_IO_wstrn_overflow): Likewise.
* libio/wfiledoalloc.c (_IO_wfile_doallocate): Likewise.
* libio/wgenops.c (_IO_least_wmarker): Likewise.
(_IO_switch_to_main_wget_area): Likewise.
(_IO_switch_to_wbackup_area): Likewise.
(_IO_wsetb): Likewise.
(_IO_wdefault_pbackfail): Likewise.
(_IO_wdefault_finish): Likewise.
(_IO_wdefault_uflow): Likewise.
(__woverflow): Likewise.
(__wuflow): Likewise.
(__wunderflow): Likewise.
(_IO_wdefault_xsputn): Likewise.
(_IO_wdefault_xsgetn): Likewise.
(_IO_wdoallocbuf): Likewise.
(_IO_wdefault_doallocate): Likewise.
(_IO_switch_to_wget_mode): Likewise.
(_IO_free_wbackup_area): Likewise.
(_IO_switch_to_wput_mode): Likewise.
(_IO_sputbackwc): Likewise.
(_IO_sungetwc): Likewise.
(_IO_adjust_wcolumn): Likewise.
(_IO_init_wmarker): Likewise.
(_IO_wmarker_delta): Likewise.
(_IO_seekwmark): Likewise.
(_IO_unsave_wmarkers): Likewise.
* libio/wmemstream.c (open_wmemstream): Likewise.
(_IO_wmem_sync): Likewise.
(_IO_wmem_finish): Likewise.
* locale/nl_langinfo.c (nl_langinfo): Likewise.
* locale/nl_langinfo_l.c (__nl_langinfo_l): Likewise.
* locale/programs/simple-hash.c (init_hash): Likewise.
(delete_hash): Likewise.
(insert_entry): Likewise.
(set_entry): Likewise.
(next_prime): Likewise.
(is_prime): Likewise.
* locale/programs/xmalloc.c (fixup_null_alloc): Likewise.
(xmalloc): Likewise.
(xrealloc): Likewise.
* locale/programs/xstrdup.c (xstrdup): Likewise.
* localedata/collate-test.c (xstrcoll): Likewise.
* localedata/xfrm-test.c (xstrcmp): Likewise.
* login/getlogin_r.c (__getlogin_r): Likewise.
* login/getpt.c (__posix_openpt): Likewise.
* login/login_tty.c (login_tty): Likewise.
* login/setlogin.c (setlogin): Likewise.
* mach/msg-destroy.c (__mach_msg_destroy): Likewise.
(mach_msg_destroy_port): Likewise.
(mach_msg_destroy_memory): Likewise.
* malloc/mcheck.c (flood): Likewise.
* misc/acct.c (acct): Likewise.
* misc/brk.c (__brk): Likewise.
* misc/chflags.c (chflags): Likewise.
* misc/chroot.c (chroot): Likewise.
* misc/fchflags.c (fchflags): Likewise.
* misc/fstab.c (getfsspec): Likewise.
(getfsfile): Likewise.
* misc/fsync.c (fsync): Likewise.
* misc/ftruncate.c (__ftruncate): Likewise.
* misc/ftruncate64.c (__ftruncate64): Likewise.
* misc/getdomain.c (getdomainname): Likewise.
(getdomainname): Likewise.
* misc/gethostname.c (__gethostname): Likewise.
* misc/getpass.c (getpass): Likewise.
* misc/getttyent.c (skip): Likewise.
(value): Likewise.
* misc/gtty.c (gtty): Likewise.
* misc/hsearch.c (hsearch): Likewise.
(hcreate): Likewise.
* misc/hsearch_r.c (__hcreate_r): Likewise.
(__hdestroy_r): Likewise.
* misc/ioctl.c (__ioctl): Likewise.
* misc/mkdtemp.c (mkdtemp): Likewise.
* misc/mkostemp.c (mkostemp): Likewise.
* misc/mkostemp64.c (mkostemp64): Likewise.
* misc/mkostemps.c (mkostemps): Likewise.
* misc/mkostemps64.c (mkostemps64): Likewise.
* misc/mkstemp.c (mkstemp): Likewise.
* misc/mkstemp64.c (mkstemp64): Likewise.
* misc/mkstemps.c (mkstemps): Likewise.
* misc/mkstemps64.c (mkstemps64): Likewise.
* misc/mktemp.c (__mktemp): Likewise.
* misc/preadv.c (preadv): Likewise.
* misc/preadv64.c (preadv64): Likewise.
* misc/pwritev.c (pwritev): Likewise.
* misc/pwritev64.c (pwritev64): Likewise.
* misc/readv.c (__readv): Likewise.
* misc/revoke.c (revoke): Likewise.
* misc/setdomain.c (setdomainname): Likewise.
* misc/setegid.c (setegid): Likewise.
* misc/seteuid.c (seteuid): Likewise.
* misc/sethostid.c (sethostid): Likewise.
* misc/sethostname.c (sethostname): Likewise.
* misc/setregid.c (__setregid): Likewise.
* misc/setreuid.c (__setreuid): Likewise.
* misc/sstk.c (sstk): Likewise.
* misc/stty.c (stty): Likewise.
* misc/syscall.c (syscall): Likewise.
* misc/syslog.c (setlogmask): Likewise.
* misc/truncate.c (__truncate): Likewise.
* misc/truncate64.c (truncate64): Likewise.
* misc/ualarm.c (ualarm): Likewise.
* misc/usleep.c (usleep): Likewise.
* misc/ustat.c (ustat): Likewise.
* misc/writev.c (__writev): Likewise.
* nptl/cleanup_compat.c (_pthread_cleanup_pop): Likewise.
* nptl/old_pthread_cond_broadcast.c
(__pthread_cond_broadcast_2_0): Likewise.
* nptl/old_pthread_cond_destroy.c (__pthread_cond_destroy_2_0):
Likewise.
* nptl/old_pthread_cond_signal.c (__pthread_cond_signal_2_0):
Likewise.
* nptl/old_pthread_cond_wait.c (__pthread_cond_wait_2_0):
Likewise.
* nptl/pt-raise.c (raise): Likewise.
* nptl/pthread_barrier_destroy.c (pthread_barrier_destroy):
Likewise.
* nptl/pthread_barrier_wait.c (__pthread_barrier_wait): Likewise.
* nptl/pthread_barrierattr_destroy.c
(pthread_barrierattr_destroy): Likewise.
* nptl/pthread_barrierattr_init.c (pthread_barrierattr_init):
Likewise.
* nptl/pthread_barrierattr_setpshared.c
(pthread_barrierattr_setpshared): Likewise.
* nptl/pthread_cond_broadcast.c (__pthread_cond_broadcast):
Likewise.
* nptl/pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
* nptl/pthread_cond_init.c (__pthread_cond_init): Likewise.
* nptl/pthread_cond_signal.c (__pthread_cond_signal): Likewise.
* nptl/pthread_condattr_destroy.c (__pthread_condattr_destroy):
Likewise.
* nptl/pthread_condattr_getclock.c (pthread_condattr_getclock):
Likewise.
* nptl/pthread_condattr_getpshared.c
(pthread_condattr_getpshared): Likewise.
* nptl/pthread_condattr_init.c (__pthread_condattr_init):
Likewise.
* nptl/pthread_condattr_setpshared.c
(pthread_condattr_setpshared): Likewise.
* nptl/pthread_detach.c (pthread_detach): Likewise.
* nptl/pthread_equal.c (__pthread_equal): Likewise.
* nptl/pthread_getcpuclockid.c (pthread_getcpuclockid): Likewise.
* nptl/pthread_getspecific.c (__pthread_getspecific): Likewise.
* nptl/pthread_key_delete.c (pthread_key_delete): Likewise.
* nptl/pthread_mutex_consistent.c (pthread_mutex_consistent):
Likewise.
* nptl/pthread_mutex_destroy.c (__pthread_mutex_destroy):
Likewise.
* nptl/pthread_mutex_getprioceiling.c
(pthread_mutex_getprioceiling): Likewise.
* nptl/pthread_mutexattr_destroy.c (__pthread_mutexattr_destroy):
Likewise.
* nptl/pthread_mutexattr_getprotocol.c
(pthread_mutexattr_getprotocol): Likewise.
* nptl/pthread_mutexattr_getpshared.c
(pthread_mutexattr_getpshared): Likewise.
* nptl/pthread_mutexattr_getrobust.c
(pthread_mutexattr_getrobust): Likewise.
* nptl/pthread_mutexattr_gettype.c (pthread_mutexattr_gettype):
Likewise.
* nptl/pthread_mutexattr_init.c (__pthread_mutexattr_init):
Likewise.
* nptl/pthread_mutexattr_setprioceiling.c
(pthread_mutexattr_setprioceiling): Likewise.
* nptl/pthread_mutexattr_setprotocol.c
(pthread_mutexattr_setprotocol): Likewise.
* nptl/pthread_mutexattr_setpshared.c
(pthread_mutexattr_setpshared): Likewise.
* nptl/pthread_mutexattr_setrobust.c
(pthread_mutexattr_setrobust): Likewise.
* nptl/pthread_mutexattr_settype.c (__pthread_mutexattr_settype):
Likewise.
* nptl/pthread_rwlock_destroy.c (__pthread_rwlock_destroy):
Likewise.
* nptl/pthread_rwlockattr_destroy.c (pthread_rwlockattr_destroy):
Likewise.
* nptl/pthread_rwlockattr_getkind_np.c
(pthread_rwlockattr_getkind_np): Likewise.
* nptl/pthread_rwlockattr_getpshared.c
(pthread_rwlockattr_getpshared): Likewise.
* nptl/pthread_rwlockattr_init.c (pthread_rwlockattr_init):
Likewise.
* nptl/pthread_rwlockattr_setkind_np.c
(pthread_rwlockattr_setkind_np): Likewise.
* nptl/pthread_rwlockattr_setpshared.c
(pthread_rwlockattr_setpshared): Likewise.
* nptl/pthread_setcancelstate.c (__pthread_setcancelstate):
Likewise.
* nptl/pthread_setcanceltype.c (__pthread_setcanceltype):
Likewise.
* nptl/pthread_setconcurrency.c (pthread_setconcurrency):
Likewise.
* nptl/pthread_setschedprio.c (pthread_setschedprio): Likewise.
* nptl/pthread_setspecific.c (__pthread_setspecific): Likewise.
* nptl/pthread_spin_destroy.c (pthread_spin_destroy): Likewise.
* nptl/pthread_tryjoin.c (pthread_tryjoin_np): Likewise.
* nptl/sem_close.c (sem_close): Likewise.
* nptl/sem_destroy.c (__new_sem_destroy): Likewise.
* nptl/sem_init.c (__old_sem_init): Likewise.
* nptl/sigaction.c (__sigaction): Likewise.
* nptl/unregister-atfork.c (__unregister_atfork): Likewise.
* posix/_exit.c (_exit): Likewise.
* posix/alarm.c (alarm): Likewise.
* posix/confstr.c (confstr): Likewise.
* posix/fpathconf.c (__fpathconf): Likewise.
* posix/getgroups.c (__getgroups): Likewise.
* posix/getpgid.c (__getpgid): Likewise.
* posix/group_member.c (__group_member): Likewise.
* posix/pathconf.c (__pathconf): Likewise.
* posix/sched_getaffinity.c (sched_getaffinity): Likewise.
* posix/sched_setaffinity.c (sched_setaffinity): Likewise.
* posix/setgid.c (__setgid): Likewise.
* posix/setpgid.c (__setpgid): Likewise.
* posix/setuid.c (__setuid): Likewise.
* posix/sleep.c (__sleep): Likewise.
* posix/sysconf.c (__sysconf): Likewise.
* posix/times.c (__times): Likewise.
* posix/uname.c (__uname): Likewise.
* posix/waitid.c (__waitid): Likewise.
* pwd/getpw.c (__getpw): Likewise.
* resolv/base64.c (b64_pton): Likewise.
* resolv/gai_sigqueue.c (__gai_sigqueue): Likewise.
* resolv/gethnamaddr.c (Dprintf): Likewise.
(gethostbyname): Likewise.
(gethostbyname2): Likewise.
(gethostbyaddr): Likewise.
(_sethtent): Likewise.
(_gethtbyname): Likewise.
(_gethtbyname2): Likewise.
(_gethtbyaddr): Likewise.
(map_v4v6_address): Likewise.
(map_v4v6_hostent): Likewise.
(addrsort): Likewise.
(ht_sethostent): Likewise.
(ht_gethostbyname): Likewise.
(ht_gethostbyaddr): Likewise.
* resolv/inet_net_ntop.c (inet_net_ntop): Likewise.
(inet_net_ntop_ipv4): Likewise.
* resolv/inet_neta.c (inet_neta): Likewise.
* resolv/inet_ntop.c (inet_ntop): Likewise.
(inet_ntop4): Likewise.
(inet_ntop6): Likewise.
* resolv/inet_pton.c (__inet_pton): Likewise.
(inet_pton4): Likewise.
(inet_pton6): Likewise.
* resolv/res_debug.c (loc_aton): Likewise.
(loc_ntoa): Likewise.
* resource/getpriority.c (__getpriority): Likewise.
* resource/getrusage.c (__getrusage): Likewise.
* resource/nice.c (nice): Likewise.
* resource/setpriority.c (__setpriority): Likewise.
* resource/setrlimit64.c (setrlimit64): Likewise.
* resource/vlimit.c (vlimit): Likewise.
* resource/vtimes.c (vtimes): Likewise.
* rt/aio_error.c (aio_error): Likewise.
* rt/aio_return.c (aio_return): Likewise.
* rt/aio_sigqueue.c (__aio_sigqueue): Likewise.
* signal/kill.c (__kill): Likewise.
* signal/killpg.c (killpg): Likewise.
* signal/raise.c (raise): Likewise.
* signal/sigaction.c (__sigaction): Likewise.
* signal/sigaddset.c (sigaddset): Likewise.
* signal/sigaltstack.c (sigaltstack): Likewise.
* signal/sigandset.c (sigandset): Likewise.
* signal/sigblock.c (__sigblock): Likewise.
* signal/sigdelset.c (sigdelset): Likewise.
* signal/sigempty.c (sigemptyset): Likewise.
* signal/sigfillset.c (sigfillset): Likewise.
* signal/sighold.c (sighold): Likewise.
* signal/sigignore.c (sigignore): Likewise.
* signal/sigintr.c (siginterrupt): Likewise.
* signal/sigisempty.c (sigisemptyset): Likewise.
* signal/sigismem.c (sigismember): Likewise.
* signal/signal.c (signal): Likewise.
* signal/sigorset.c (sigorset): Likewise.
* signal/sigpause.c (__sigpause): Likewise.
* signal/sigpending.c (sigpending): Likewise.
* signal/sigprocmask.c (__sigprocmask): Likewise.
* signal/sigrelse.c (sigrelse): Likewise.
* signal/sigreturn.c (__sigreturn): Likewise.
* signal/sigset.c (sigset): Likewise.
* signal/sigsetmask.c (__sigsetmask): Likewise.
* signal/sigstack.c (sigstack): Likewise.
* signal/sigsuspend.c (__sigsuspend): Likewise.
* signal/sigvec.c (sigvec_wrapper_handler): Likewise.
* signal/sysv_signal.c (__sysv_signal): Likewise.
* socket/accept.c (accept): Likewise.
* socket/accept4.c (__libc_accept4): Likewise.
* socket/bind.c (__bind): Likewise.
* socket/connect.c (__connect): Likewise.
* socket/getpeername.c (getpeername): Likewise.
* socket/getsockname.c (__getsockname): Likewise.
* socket/getsockopt.c (getsockopt): Likewise.
* socket/listen.c (__listen): Likewise.
* socket/recv.c (__recv): Likewise.
* socket/recvmsg.c (__recvmsg): Likewise.
* socket/send.c (__send): Likewise.
* socket/sendmsg.c (__sendmsg): Likewise.
* socket/shutdown.c (shutdown): Likewise.
* socket/sockatmark.c (sockatmark): Likewise.
* socket/socket.c (__socket): Likewise.
* stdio-common/ctermid.c (ctermid): Likewise.
* stdio-common/cuserid.c (cuserid): Likewise.
* stdio-common/printf-prs.c (parse_printf_format): Likewise.
* stdio-common/remove.c (remove): Likewise.
* stdio-common/rename.c (rename): Likewise.
* stdio-common/renameat.c (renameat): Likewise.
* stdio-common/tempname.c (__gen_tempname): Likewise.
* stdio-common/xbug.c (InitBuffer): Likewise.
(AppendToBuffer): Likewise.
(ReadFile): Likewise.
* stdlib/a64l.c (a64l): Likewise.
* stdlib/drand48_r.c (drand48_r): Likewise.
* stdlib/getcontext.c (getcontext): Likewise.
* stdlib/getenv.c (getenv): Likewise.
* stdlib/l64a.c (l64a): Likewise.
* stdlib/llabs.c (llabs): Likewise.
* stdlib/lldiv.c (lldiv): Likewise.
* stdlib/lrand48_r.c (lrand48_r): Likewise.
* stdlib/mrand48_r.c (mrand48_r): Likewise.
* stdlib/putenv.c (putenv): Likewise.
* stdlib/random.c (__srandom): Likewise.
(__initstate): Likewise.
(__setstate): Likewise.
* stdlib/random_r.c (__srandom_r): Likewise.
(__setstate_r): Likewise.
(__random_r): Likewise.
* stdlib/secure-getenv.c (__libc_secure_getenv): Likewise.
* stdlib/setcontext.c (setcontext): Likewise.
* stdlib/setenv.c (setenv): Likewise.
(unsetenv): Likewise.
* stdlib/srand48.c (srand48): Likewise.
* stdlib/srand48_r.c (__srand48_r): Likewise.
* stdlib/swapcontext.c (swapcontext): Likewise.
* stdlib/system.c (__libc_system): Likewise.
* stdlib/tst-strtod.c (expand): Likewise.
* stdlib/tst-strtol.c (expand): Likewise.
* stdlib/tst-strtoll.c (expand): Likewise.
* streams/fattach.c (fattach): Likewise.
* streams/fdetach.c (fdetach): Likewise.
* streams/getmsg.c (getmsg): Likewise.
* streams/isastream.c (isastream): Likewise.
* string/ffs.c (__ffs): Likewise.
* string/ffsll.c (ffsll): Likewise.
* string/memcmp.c (memcmp_common_alignment): Likewise.
(memcmp_not_common_alignment): Likewise.
(MEMCMP): Likewise.
* string/memcpy.c (memcpy): Likewise.
* string/memmove.c (MEMMOVE): Likewise.
* string/memset.c (memset): Likewise.
* string/rawmemchr.c (RAWMEMCHR): Likewise.
* string/strchrnul.c (STRCHRNUL): Likewise.
* string/strerror.c (strerror): Likewise.
* string/strndup.c (__strndup): Likewise.
* string/strverscmp.c (__strverscmp): Likewise.
* sunrpc/clnt_raw.c (clntraw_freeres): Likewise.
* sunrpc/clnt_tcp.c (clnttcp_geterr): Likewise.
(clnttcp_freeres): Likewise.
* sunrpc/clnt_unix.c (clntunix_freeres): Likewise.
* sunrpc/pmap_prot.c (xdr_pmap): Likewise.
* sunrpc/pmap_prot2.c (xdr_pmaplist): Likewise.
* sunrpc/pmap_rmt.c (xdr_rmtcallres): Likewise.
* sunrpc/rpc_prot.c (xdr_replymsg): Likewise.
(xdr_callhdr): Likewise.
* sunrpc/rpcinfo.c (udpping): Likewise.
(tcpping): Likewise.
(pstatus): Likewise.
(pmapdump): Likewise.
(brdcst): Likewise.
(deletereg): Likewise.
(getprognum): Likewise.
(getvers): Likewise.
(get_inet_address): Likewise.
* sunrpc/svc_raw.c (svcraw_recv): Likewise.
* sunrpc/svc_udp.c (svcudp_create): Likewise.
(svcudp_stat): Likewise.
(svcudp_recv): Likewise.
(svcudp_reply): Likewise.
(svcudp_getargs): Likewise.
(svcudp_freeargs): Likewise.
(svcudp_destroy): Likewise.
* sunrpc/xdr.c (xdr_bytes): Likewise.
(xdr_netobj): Likewise.
(xdr_string): Likewise.
(xdr_wrapstring): Likewise.
* sunrpc/xdr_float.c (xdr_float): Likewise.
(xdr_double): Likewise.
* sunrpc/xdr_mem.c (xdrmem_setpos): Likewise.
* sunrpc/xdr_ref.c (xdr_pointer): Likewise.
* sysvipc/ftok.c (ftok): Likewise.
* sysvipc/msgctl.c (msgctl): Likewise.
* sysvipc/msgget.c (msgget): Likewise.
* sysvipc/msgrcv.c (msgrcv): Likewise.
* sysvipc/msgsnd.c (msgsnd): Likewise.
* sysvipc/semget.c (semget): Likewise.
* sysvipc/semop.c (semop): Likewise.
* sysvipc/shmat.c (shmat): Likewise.
* sysvipc/shmctl.c (shmctl): Likewise.
* sysvipc/shmdt.c (shmdt): Likewise.
* sysvipc/shmget.c (shmget): Likewise.
* termios/cfmakeraw.c (cfmakeraw): Likewise.
* termios/speed.c (cfgetospeed): Likewise.
(cfgetispeed): Likewise.
(cfsetospeed): Likewise.
(cfsetispeed): Likewise.
* termios/tcflow.c (tcflow): Likewise.
* termios/tcflush.c (tcflush): Likewise.
* termios/tcgetattr.c (__tcgetattr): Likewise.
* termios/tcgetpgrp.c (tcgetpgrp): Likewise.
* termios/tcgetsid.c (tcgetsid): Likewise.
* termios/tcsendbrk.c (tcsendbreak): Likewise.
* termios/tcsetpgrp.c (tcsetpgrp): Likewise.
* time/adjtime.c (__adjtime): Likewise.
* time/dysize.c (dysize): Likewise.
* time/ftime.c (ftime): Likewise.
* time/getitimer.c (__getitimer): Likewise.
* time/gettimeofday.c (__gettimeofday): Likewise.
* time/gmtime.c (__gmtime_r): Likewise.
(gmtime): Likewise.
* time/localtime.c (__localtime_r): Likewise.
(localtime): Likewise.
* time/offtime.c (__offtime): Likewise.
* time/settimeofday.c (__settimeofday): Likewise.
* time/stime.c (stime): Likewise.
* time/strftime_l.c (tm_diff): Likewise.
(iso_week_days): Likewise.
* time/strptime.c (strptime): Likewise.
* time/time.c (time): Likewise.
* time/timespec_get.c (timespec_get): Likewise.
* time/tzset.c (tzset_internal): Likewise.
(compute_change): Likewise.
(__tz_compute): Likewise.
* wcsmbs/btowc.c (__btowc): Likewise.
* wcsmbs/mbrlen.c (__mbrlen): Likewise.
* wcsmbs/mbsinit.c (__mbsinit): Likewise.
* wcsmbs/mbsrtowcs.c (__mbsrtowcs): Likewise.
* wcsmbs/wcpcpy.c (__wcpcpy): Likewise.
* wcsmbs/wcpncpy.c (__wcpncpy): Likewise.
* wcsmbs/wcscat.c (__wcscat): Likewise.
* wcsmbs/wcschrnul.c (__wcschrnul): Likewise.
* wcsmbs/wcscmp.c (WCSCMP): Likewise.
* wcsmbs/wcscpy.c (WCSCPY): Likewise.
* wcsmbs/wcscspn.c (wcscspn): Likewise.
* wcsmbs/wcsdup.c (wcsdup): Likewise.
* wcsmbs/wcslen.c (__wcslen): Likewise.
* wcsmbs/wcsncat.c (WCSNCAT): Likewise.
* wcsmbs/wcsncmp.c (WCSNCMP): Likewise.
* wcsmbs/wcsncpy.c (__wcsncpy): Likewise.
* wcsmbs/wcsnlen.c (__wcsnlen): Likewise.
* wcsmbs/wcspbrk.c (wcspbrk): Likewise.
* wcsmbs/wcsrchr.c (WCSRCHR): Likewise.
* wcsmbs/wcsspn.c (wcsspn): Likewise.
* wcsmbs/wcsstr.c (wcsstr): Likewise.
* wcsmbs/wcstok.c (wcstok): Likewise.
* wcsmbs/wctob.c (wctob): Likewise.
* wcsmbs/wmemchr.c (__wmemchr): Likewise.
* wcsmbs/wmemcmp.c (WMEMCMP): Likewise.
* wcsmbs/wmemcpy.c (__wmemcpy): Likewise.
* wcsmbs/wmemmove.c (__wmemmove): Likewise.
* wcsmbs/wmempcpy.c (__wmempcpy): Likewise.
* wcsmbs/wmemset.c (__wmemset): Likewise.
* wctype/wcfuncs.c (__towlower): Likewise.
(__towupper): Likewise.

8 years agoFix i386 build for lll_unlock_elision change.
Joseph Myers [Fri, 16 Oct 2015 16:04:06 +0000 (16:04 +0000)]
Fix i386 build for lll_unlock_elision change.

Tested for i386.

* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(lll_unlock_elision): Add adapt_count parameter.

8 years agoRemove NPTL configure errors based on top-level configure tests.
Joseph Myers [Thu, 15 Oct 2015 23:59:54 +0000 (23:59 +0000)]
Remove NPTL configure errors based on top-level configure tests.

sysdeps/nptl/configure.ac has code to give errors if certain tests in
the top-level configure failed.  However, all those failure conditions
also produce errors in the top-level configure, so the errors in the
NPTL configure are completely redundant; this patch removes them.

(As suggested in
<https://sourceware.org/ml/libc-alpha/2015-10/msg00510.html>, I think
the top-level tests in question can be completely removed as
unnecessary given the version tests.  But even without that there is
clearly no point in duplicating code that gives an error if the test
fails.)

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

* sysdeps/nptl/configure.ac: Do not give errors based on the
results of top-level configure tests.
* sysdeps/nptl/configure: Regenerated.

8 years agoRemove -Bgroup configure test.
Joseph Myers [Thu, 15 Oct 2015 23:36:22 +0000 (23:36 +0000)]
Remove -Bgroup configure test.

There is a configure test for the -Bgroup linker option whose results
aren't used anywhere.  This patch removes that test.

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

* configure.ac (libc_cv_Bgroup): Remove configure test.
* configure: Regenerated.
* config.make.in (have-Bgroup): Remove variable.

8 years agoRemove sizeof (long double) configure test.
Joseph Myers [Thu, 15 Oct 2015 23:30:42 +0000 (23:30 +0000)]
Remove sizeof (long double) configure test.

There is a configure test for sizeof (long double) whose results
aren't used anywhere.  This patch removes that test.

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

* configure.ac (sizeof_long_double): Remove configure test.
* configure: Regenerated.
* config.make.in (sizeof-long-double): Remove variable.

8 years agoRemove -fexceptions configure test.
Joseph Myers [Thu, 15 Oct 2015 22:35:13 +0000 (22:35 +0000)]
Remove -fexceptions configure test.

There is a configure test for -fexceptions.  This option was added in
GCC 2.8, so the test is obsolete - and indeed plenty of code is using
-fexceptions directly.  This patch removes the configure test and
makes all uses of $(exceptions) use -fexceptions directly.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

* configure.ac (libc_cv_gcc_exceptions): Remove configure test.
* configure: Regenerated.
* sysdeps/arm/configure.ac (libc_cv_gcc_exceptions): Do not set
variable.
(exceptions): Likewise.
* sysdeps/arm/configure: Regenerated.
* config.make.in (exceptions): Remove variable.
* Makeconfig (uses-callbacks): Use -fexceptions instead of
$(exceptions).
* debug/Makefile (CFLAGS-dprintf_chk.c): Likewise.
(CFLAGS-vdprintf_chk.c): Likewise.
(CFLAGS-printf_chk.c): Likewise.
(CFLAGS-fprintf_chk.c): Likewise.
(CFLAGS-vprintf_chk.c): Likewise.
(CFLAGS-vfprintf_chk.c): Likewise.
(CFLAGS-gets_chk.c): Likewise.
(CFLAGS-fgets_chk.c): Likewise.
(CFLAGS-fgets_u_chk.c): Likewise.
(CFLAGS-fread_chk.c): Likewise.
(CFLAGS-fread_u_chk.c): Likewise.
(CFLAGS-wprintf_chk.c): Likewise.
(CFLAGS-fwprintf_chk.c): Likewise.
(CFLAGS-vwprintf_chk.c): Likewise.
(CFLAGS-vfwprintf_chk.c): Likewise.
(CFLAGS-fgetws_chk.c): Likewise.
(CFLAGS-fgetws_u_chk.c): Likewise.
* libio/Makefile (CFLAGS-fileops.c): Likewise.
(CFLAGS-fputc.c): Likewise.
(CFLAGS-fputwc.c): Likewise.
(CFLAGS-freopen64.c): Likewise.
(CFLAGS-freopen.c): Likewise.
(CFLAGS-fseek.c): Likewise.
(CFLAGS-fseeko64.c): Likewise.
(CFLAGS-fseeko.c): Likewise.
(CFLAGS-ftello64.c): Likewise.
(CFLAGS-ftello.c): Likewise.
(CFLAGS-fwide.c): Likewise.
(CFLAGS-genops.c): Likewise.
(CFLAGS-getc.c): Likewise.
(CFLAGS-getchar.c): Likewise.
(CFLAGS-getwc.c): Likewise.
(CFLAGS-getwchar.c): Likewise.
(CFLAGS-iofclose.c): Likewise.
(CFLAGS-iofflush.c): Likewise.
(CFLAGS-iofgetpos64.c): Likewise.
(CFLAGS-iofgetpos.c): Likewise.
(CFLAGS-iofgets.c): Likewise.
(CFLAGS-iofgetws.c): Likewise.
(CFLAGS-iofputs.c): Likewise.
(CFLAGS-iofputws.c): Likewise.
(CFLAGS-iofread.c): Likewise.
(CFLAGS-iofsetpos64.c): Likewise.
(CFLAGS-iofsetpos.c): Likewise.
(CFLAGS-ioftell.c): Likewise.
(CFLAGS-iofwrite.c): Likewise.
(CFLAGS-iogetdelim.c): Likewise.
(CFLAGS-iogetline.c): Likewise.
(CFLAGS-iogets.c): Likewise.
(CFLAGS-iogetwline.c): Likewise.
(CFLAGS-ioputs.c): Likewise.
(CFLAGS-ioseekoff.c): Likewise.
(CFLAGS-ioseekpos.c): Likewise.
(CFLAGS-iosetbuffer.c): Likewise.
(CFLAGS-iosetvbuf.c): Likewise.
(CFLAGS-ioungetc.c): Likewise.
(CFLAGS-ioungetwc.c): Likewise.
(CFLAGS-oldfileops.c): Likewise.
(CFLAGS-oldiofclose.c): Likewise.
(CFLAGS-oldiofgetpos64.c): Likewise.
(CFLAGS-oldiofgetpos.c): Likewise.
(CFLAGS-oldiofsetpos64.c): Likewise.
(CFLAGS-oldiofsetpos.c): Likewise.
(CFLAGS-peekc.c): Likewise.
(CFLAGS-putc.c): Likewise.
(CFLAGS-putchar.c): Likewise.
(CFLAGS-putwc.c): Likewise.
(CFLAGS-putwchar.c): Likewise.
(CFLAGS-rewind.c): Likewise.
(CFLAGS-wfileops.c): Likewise.
(CFLAGS-wgenops.c): Likewise.
(CFLAGS-oldiofopen.c): Likewise.
(CFLAGS-iofopen.c): Likewise.
(CFLAGS-iofopen64.c): Likewise.
(CFLAGS-oldtmpfile.c): Likewise.
* stdio-common/Makefile (CFLAGS-vfprintf.c): Likewise.
(CFLAGS-fprintf.c): Likewise.
(CFLAGS-printf.c): Likewise.
(CFLAGS-vfwprintf.c): Likewise.
(CFLAGS-vfscanf.c): Likewise.
(CFLAGS-vfwscanf.c): Likewise.
(CFLAGS-fscanf.c): Likewise.
(CFLAGS-scanf.c): Likewise.
(CFLAGS-isoc99_vfscanf.c): Likewise.
(CFLAGS-isoc99_vscanf.c): Likewise.
(CFLAGS-isoc99_fscanf.c): Likewise.
(CFLAGS-isoc99_scanf.c): Likewise.
* wcsmbs/Makefile (CFLAGS-isoc99_wscanf.c): Likewise.
(CFLAGS-isoc99_fwscanf.c): Likewise.
(CFLAGS-isoc99_vwscanf.c): Likewise.
(CFLAGS-isoc99_vfwscanf.c): Likewise.

8 years agoDo not leave files behind in /tmp from testing.
Joseph Myers [Thu, 15 Oct 2015 22:29:06 +0000 (22:29 +0000)]
Do not leave files behind in /tmp from testing.

I noticed that glibc testsuite runs left several files behind in /tmp
(or TMPDIR, if different).  The problem was testcases that generate a
template for mkstemp / mkstemp64, ending with XXXXXX, then pass that
template to add_temp_file before calling mkstemp / mkstemp64, meaning
that the template ending with XXXXXX is stored in the list of
temporary files to delete (add_temp_file uses strdup so that the
original string doesn't need to stay live), not the actual filename as
determined by mkstemp / mkstemp64.  This patch fixes those tests to
call add_temp_file later.

Tested for x86_64 (that the files are no longer left behind by a
testsuite run and the modified tests still pass).

* io/test-lfs.c (do_prepare): Do not call add_temp_file until
after mkstemp64.
* login/tst-utmp.c (do_prepare): Likewise.
* rt/tst-aio.c (do_prepare): Likewise.
* rt/tst-aio64.c (do_prepare): Likewise.

8 years agopowerpc: Optimize lock elision for pthread_mutex_t
Paul Murphy [Thu, 3 Sep 2015 18:40:21 +0000 (13:40 -0500)]
powerpc: Optimize lock elision for pthread_mutex_t

With TLE enabled, the adapt count variable update incurs
an 8% overhead before entering the critical section of an
elided mutex.

Instead, if it is done right after leaving the critical
section, this serialization can be avoided.

This alters the existing behavior of __lll_trylock_elision
as it will only decrement the adapt_count if it successfully
acquires the lock.

* sysdeps/unix/sysv/linux/powerpc/elision-lock.c
(__lll_lock_elision): Remove adapt_count decrement...
* sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
(__lll_trylock_elision): Likewise.
* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
(__lll_unlock_elision): ... to here. And utilize
new adapt_count parameter.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
(__lll_unlock_elision): Update to include adapt_count
parameter.
(lll_unlock_elision): Pass pointer to adapt_count
variable.

8 years agonptl: Add adapt_count parameter to lll_unlock_elision
Paul Murphy [Thu, 3 Sep 2015 18:40:11 +0000 (13:40 -0500)]
nptl: Add adapt_count parameter to lll_unlock_elision

Adding this parameter will give architectures more freedom in
how they choose to update this variable.  This change has no
effect on architectures which choose not to use it.

* nptl/pthread_mutex_unlock.c(lll_unlock_elision):
Add elision adapt_count parameter to list of arguments.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
(lll_unlock_elision): Update with new parameter list
* sysdeps/unix/sysv/linux/s390/lowlevellock.h
(lll_unlock_elision): Likewise
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(lll_unlock_elision): Likewise

8 years agoMark ld.so internel __uname hidden
H.J. Lu [Thu, 15 Oct 2015 21:33:26 +0000 (14:33 -0700)]
Mark ld.so internel __uname hidden

Since ld.so internel __uname is only used internally in ld.so, it can
be made hidden.

[BZ #19122]
* include/sys/utsname.h [IS_IN (rtld)] (__uname): Add
attribute_hidden.

8 years agoMark ld.so internel string functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:25:45 +0000 (14:25 -0700)]
Mark ld.so internel string functions hidden

Since ld.so internel string functions are only used internally in
ld.so, they can be made hidden.

[BZ #19122]
* include/string.h [IS_IN (rtld)] (__stpcpy): Add
attribute_hidden.
[IS_IN (rtld)] (__strdup): Likewise.
[IS_IN (rtld)] (__strerror_r): Likewise.
[IS_IN (rtld)] (__strsep_g): Likewise.
[IS_IN (rtld)] (memchr): Likewise.
[IS_IN (rtld)] (memcmp): Likewise.
[IS_IN (rtld)] (memcpy): Likewise.
[IS_IN (rtld)] (memmove): Likewise.
[IS_IN (rtld)] (memset): Likewise.
[IS_IN (rtld)] (rawmemchr): Likewise.
[IS_IN (rtld)] (stpcpy): Likewise.
[IS_IN (rtld)] (strchr): Likewise.
[IS_IN (rtld)] (strcmp): Likewise.
[IS_IN (rtld)] (strlen): Likewise.
[IS_IN (rtld)] (strnlen): Likewise.
[IS_IN (rtld)] (strsep): Likewise.

8 years agoMark ld.so internel stdlib functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:24:20 +0000 (14:24 -0700)]
Mark ld.so internel stdlib functions hidden

Since ld.so internel stdlib functions are only used internally in
ld.so, they can be made hidden.

[BZ #19122]
* include/stdlib.h [IS_IN (rtld)] (unsetenv): Add
attribute_hidden.
[IS_IN (rtld)] (__strtoul_internal): Likewise.

8 years agoMark ld.so internel sigaction functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:23:09 +0000 (14:23 -0700)]
Mark ld.so internel sigaction functions hidden

Since ld.so internel sigaction functions are only used internally in
ld.so, they can be made hidden.

[BZ #19122]
* include/signal.h [IS_IN (rtld)] (__sigaction): Add
attribute_hidden.
[IS_IN (rtld)] (__libc_sigaction): Likewise.

8 years agoMark internal setjmp functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:22:10 +0000 (14:22 -0700)]
Mark internal setjmp functions hidden

Since internal dirent functions are only used internally in ld.so and
libc.so, they can be made hidden.

[BZ #19122]
* include/setjmp.h (__longjmp): Add attribute_hidden.
[IS_IN (rtld)] (__sigsetjmp): Likewise.

8 years agoMark ld.so internel __profile_frequency hidden
H.J. Lu [Thu, 15 Oct 2015 21:20:43 +0000 (14:20 -0700)]
Mark ld.so internel __profile_frequency hidden

Since ld.so internel __profile_frequency is only used internally in
ld.so, it can be made hidden.

[BZ #19122]
* include/libc-internal.h [IS_IN (rtld)] (__profile_frequency):
Add attribute_hidden.

8 years agoMark internal fcntl functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:16:22 +0000 (14:16 -0700)]
Mark internal fcntl functions hidden

Since internal fcntl functions are only used internally in ld.so and
libc.so, they can be made hidden.

[BZ #19122]
* include/fcntl.h (__libc_fcntl): Add attribute_hidden.
[IS_IN (rtld)] (__open): Likewise.
[IS_IN (rtld)] (__fcntl): Likewise.

8 years agoMark internal dirent functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:15:26 +0000 (14:15 -0700)]
Mark internal dirent functions hidden

Since internal dirent functions are only used internally in ld.so and
libc.so, they can be made hidden.

[BZ #19122]
* include/dirent.h (__opendirat): Add attribute_hidden.
(__getdents): Likewise.
(__getdents64): Likewise.
(__alloc_dir): Likewise.
[IS_IN (rtld)] (__closedir): Likewise.
[IS_IN (rtld)] (__fdopendir): Likewise.
[IS_IN (rtld)] (__readdir): Likewise.
[IS_IN (rtld)] (__readdir64): Likewise.
[IS_IN (rtld)] (__rewinddir): Likewise.

8 years agoMark _dl_catch_error hidden
H.J. Lu [Thu, 15 Oct 2015 21:13:37 +0000 (14:13 -0700)]
Mark _dl_catch_error hidden

Since _dl_catch_error is only used internally in ld.so, it should be
declared in sysdeps/generic/ldsodefs.h, not include/dlfcn.h and it can
be made hidden.

[BZ #19122]
* include/dlfcn.h (_dl_catch_error): Moved to ...
* sysdeps/generic/ldsodefs.h (_dl_catch_error): Add
attribute_hidden.

8 years agoMark internal _itoa functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:06:54 +0000 (14:06 -0700)]
Mark internal _itoa functions hidden

Since internal _itoa functions are only used internally in ld.so and
libc.so, they can be made hidden.

[BZ #19122]
* sysdeps/generic/_itoa.h (_itoa): Add attribute_hidden.
(_itoa_word): Likewise.

8 years agoMark internal _dl_XXX functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:04:00 +0000 (14:04 -0700)]
Mark internal _dl_XXX functions hidden

Since internal _dl_XXX functions are only used internally in ld.so,
they can be made hidden.

[BZ #19122]
* elf/dl-runtime.c (_dl_fixup): Add attribute_hidden.
* elf/dynamic-link.h (_dl_try_allocate_static_tls): Likewise.
* sysdeps/generic/dl-cache.h (_dl_cache_libcmp): Likewise.
* sysdeps/generic/ldsodefs.h (_dl_name_match_p): Likewise.
(_dl_higher_prime_number): Likewise.
(_dl_debug_printf_c): Likewise.
(_dl_signal_cerror): Likewise.
(_dl_receive_error): Likewise.
(_dl_reloc_bad_type): Likewise.
(_dl_resolve_conflicts): Likewise.
(_dl_check_all_versions): Likewise.
(_dl_check_map_versions): Likewise.
(_dl_sort_fini): Likewise.
(_dl_debug_initialize): Likewise.
(_dl_init_paths): Likewise.
(_dl_show_auxv): Likewise.
(_dl_next_ld_env_entry): Likewise.
(_dl_important_hwcaps): Likewise.
(_dl_load_cache_lookup): Likewise.
(_dl_update_slotinfo): Likewise.
(_dl_show_scope): Likewise.

8 years agoMark _wordcopy_XXX functions hidden
H.J. Lu [Thu, 15 Oct 2015 21:01:35 +0000 (14:01 -0700)]
Mark _wordcopy_XXX functions hidden

Since _wordcopy_XXX functions are only used internally in ld.so and
libc.so, they can be made hidden.

[BZ #19122]
* sysdeps/generic/memcopy.h (_wordcopy_fwd_aligned): Add
attribute_hidden.
(_wordcopy_fwd_dest_aligned): Likewise.
(_wordcopy_bwd_aligned): Likewise.
(_wordcopy_bwd_dest_aligned): Likewise.

8 years agoMark x86 _dl_unmap/_dl_make_tlsdesc_dynamic hidden
H.J. Lu [Thu, 15 Oct 2015 20:41:21 +0000 (13:41 -0700)]
Mark x86 _dl_unmap/_dl_make_tlsdesc_dynamic hidden

Since x86 _dl_unmap and _dl_make_tlsdesc_dynamic are only used
internally in ld.so, they can be made hidden.

[BZ #19122]
* sysdeps/i386/dl-lookupcfg.h (_dl_unmap): Add attribute_hidden.
* sysdeps/i386/dl-tlsdesc.h (_dl_make_tlsdesc_dynamic):
Likewise.
* sysdeps/x86_64/dl-tlsdesc.h (_dl_make_tlsdesc_dynamic):
Likewise.
* sysdeps/x86_64/dl-lookupcfg.h (_dl_unmap): Likewise.

8 years agoAdd comments for GCC 5 requirement
H.J. Lu [Thu, 15 Oct 2015 20:35:40 +0000 (13:35 -0700)]
Add comments for GCC 5 requirement

* sysdeps/unix/sysv/linux/i386/sysdep.h: Add comments for
GCC 5 requirement.

8 years agoRemove assembler -mtune=i686 configure test.
Joseph Myers [Thu, 15 Oct 2015 20:28:27 +0000 (20:28 +0000)]
Remove assembler -mtune=i686 configure test.

There is a configure test for assembler support for -mtune=i686.  This
option was added in binutils 2.18 so the test is obsolete; this patch
removes it.

Tested for x86 (testsuite, and that installed shared libraries are
unchanged by the patch).

* sysdeps/i386/configure.ac (libc_cv_as_i686): Remove configure
test.
* sysdeps/i386/configure: Regenerated.
* sysdeps/i386/i686/Makefile [$(config-asflags-i686) = yes]: Make
code unconditional.

8 years agoRemove .previous, .popsection configure tests.
Joseph Myers [Thu, 15 Oct 2015 19:47:55 +0000 (19:47 +0000)]
Remove .previous, .popsection configure tests.

There is a configure test for the assembler .previous directive, and,
as a fallback, for .popsection.

glibc now only supports ELF.  For ELF, the GNU assembler has supported
.previous since version 2.2 (support added by

Mon Jul 19 15:21:20 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)

        * config/obj-elf.c (obj_elf_previous): New function.
        (previous_section, previous_subsection): New vars.
        (obj_elf_section): Save current place in case DWARF code wants us
        to pop back to it.  Handle unquoted section name as well as quoted
        section name.  Don't crash on invalid strings.
        (obj_pseudo_table): Handle new pseudos "previous", "2byte", and
        "4byte".

).  Thus this configure test is obsolete, and this patch removes it
(and with it the fallback .popsection test).

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

* configure.ac (libc_cv_asm_previous_directive): Remove configure
test.
(libc_cv_asm_popsection_directive): Likewise.
* configure: Regenerated.
* config.h.in (HAVE_ASM_PREVIOUS_DIRECTIVE): Remove #undef.
(HAVE_ASM_POPSECTION_DIRECTIVE): Likewise.
* include/libc-symbols.h [HAVE_ASM_PREVIOUS_DIRECTIVE]
(__make_section_unallocated): Make definition unconditional.
[HAVE_ASM_POPSECTION_DIRECTIVE] (__make_section_unallocated):
Remove conditional definition.
[!HAVE_ASM_PREVIOUS_DIRECTIVE && !HAVE_ASM_POPSECTION_DIRECTIVE]
(__make_section_unallocated): Likewise.

8 years agoRemove -static-libgcc configure test.
Joseph Myers [Thu, 15 Oct 2015 19:32:58 +0000 (19:32 +0000)]
Remove -static-libgcc configure test.

There is a configure test for -static-libgcc.  GCC added this option
in version 3.0, so this test is obsolete; this patch removes it.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

* configure.ac (libc_cv_gcc_static_libgcc): Remove configure test.
* configure: Regenerated.
* config.make.in (static-libgcc): Remove variable.
* Makerules (build-shlib-helper): Use -static-libgcc instead of
$(static-libgcc).
(build-module-helper): Likewise.

8 years agoRemove stddef.h configure test.
Joseph Myers [Thu, 15 Oct 2015 19:31:46 +0000 (19:31 +0000)]
Remove stddef.h configure test.

There is a configure test "for libc-friendly stddef.h", which sets a
makefile variable stddef.h that appears to be nowhere used.  It
appears the uses of this variable were removed by:

Tue Feb 21 00:10:50 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>

        * Makefile (headers): Remove $(stddef.h).
        * Makeconfig (stddef.h): Variable removed; now require gcc version
        >= 2.2.
        * stddef.h: File removed.

(having been added by

Wed May 26 14:44:19 1993  Roland McGrath  (roland@churchy.gnu.ai.mit.edu)

        * configure.in (autoconf checks): Add new check for a
        libc-friendly stddef.h.

so the test was of use for less than two years, before being obsolete
for over 20 years).  This patch removes the test.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

* configure.ac (libc_cv_friendly_stddef): Remove configure test.
* configure: Regenerated.

8 years agovfscanf: Use struct scratch_buffer instead of extend_alloca
Florian Weimer [Thu, 15 Oct 2015 14:37:48 +0000 (16:37 +0200)]
vfscanf: Use struct scratch_buffer instead of extend_alloca

A custom character buffer is added in this commit, in the form of
struct char_buffer.  The char_buffer_add function replaces the
ADDW macro (which has grown with each successive security fix).
The char_buffer_add slow path is moved out-of-line, reducing
code size.

* stdio-common/vfscanf.c (MEMCPY): Remove macro.
(struct char_buffer): New type.
(char_buffer_start, char_buffer_size, char_buffer_error)
(char_buffer_rewind, char_buffer_add): New functions.
(ADDW): Remove macro, replaced by the char_buffer_add function.
(_IO_vfscanf_internal): Rewrite using struct char_buffer instead
of extend_alloca.  Make control flow more explicit.

8 years agoRemove i386/epoll_pwait.S
H.J. Lu [Thu, 15 Oct 2015 13:26:38 +0000 (06:26 -0700)]
Remove i386/epoll_pwait.S

Only i386 implements epoll_pwait in assembly code withot cancellation
support.  All other architectures implement epoll_pwait in epoll_pwait.c
with

int epoll_pwait (int epfd, struct epoll_event *events,
 int maxevents, int timeout,
 const sigset_t *set)
{
  return SYSCALL_CANCEL (epoll_pwait, epfd, events, maxevents,
 timeout, set, _NSIG / 8);
}

Although there is no test for epoll_pwait in glibc, since SYSCALL_CANCEL
works on i386 and epoll_pwait.c works for other architectures, it is
safe to assume that epoll_pwait.c with SYSCALL_CANCEL also works on
i386.

[BZ #19137]
* sysdeps/unix/sysv/linux/i386/Makefile (CFLAGS-epoll_pwait.c):
Add -fomit-frame-pointer.
* sysdeps/unix/sysv/linux/i386/epoll_pwait.S: Remove file.

8 years agoOptimize i386 syscall inlining for GCC 5
H.J. Lu [Thu, 15 Oct 2015 12:23:42 +0000 (05:23 -0700)]
Optimize i386 syscall inlining for GCC 5

Since GCC 5 and above can properly spill %ebx when needed, we can inline
syscalls with 6 arguments if GCC 5 or above is used to compile glibc.
This patch rewrites INTERNAL_SYSCALL macros and skips __libc_do_syscall
for GCC 5.

For sysdeps/unix/sysv/linux/i386/brk.c, with -O2 -march=i686
-mtune=generic, GCC 5.2 now generates:

<__brk>:
   0: push   %ebx
   1: mov    $0x2d,%eax
   6: mov    0x8(%esp),%ebx
   a: call   b <__brk+0xb> b: R_386_PC32 __x86.get_pc_thunk.dx
   f: add    $0x2,%edx 11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
  15: call   *%gs:0x10
  1c: mov    0x0(%edx),%edx 1e: R_386_GOT32 __curbrk
  22: cmp    %eax,%ebx
  24: mov    %eax,(%edx)
  26: ja     30 <__brk+0x30>
  28: xor    %eax,%eax
  2a: pop    %ebx
  2b: ret

instead of

<__brk>:
   0: push   %ebx
   1: mov    0x8(%esp),%ecx
   5: call   6 <__brk+0x6> 6: R_386_PC32 __x86.get_pc_thunk.bx
   a: add    $0x2,%ebx c: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
  10: xchg   %ecx,%ebx
  12: mov    $0x2d,%eax
  17: call   *%gs:0x10
  1e: xchg   %ecx,%ebx
  20: mov    %eax,%edx
  22: mov    0x0(%ebx),%eax 24: R_386_GOT32 __curbrk
  28: mov    %edx,(%eax)
  2a: xor    %eax,%eax
  2c: cmp    %edx,%ecx
  2e: ja     38 <__brk+0x38>
  30: pop    %ebx
  31: ret

The new one is shorter by 2 instructions.

* sysdeps/unix/sysv/linux/i386/libc-do-syscall.S
(__libc_do_syscall): Defined only if !__GNUC_PREREQ (5,0).
* sysdeps/unix/sysv/linux/i386/sysdep.h: Define assembler macros
only if !__GNUC_PREREQ (5,0).
(INTERNAL_SYSCALL_MAIN_6): Optimize for GCC 5.
(INTERNAL_SYSCALL_MAIN_INLINE): Likewise.
(INTERNAL_SYSCALL_NCS): Likewise.
(LOADREGS_0): New macro for GCC 5.
(ASMARGS_0): Likewise.
(LOADREGS_1): Likewise.
(ASMARGS_1): Likewise.
(LOADREGS_2): Likewise.
(ASMARGS_2): Likewise.
(LOADREGS_3): Likewise.
(ASMARGS_3): Likewise.
(LOADREGS_4): Likewise.
(ASMARGS_4): Likewise.
(LOADREGS_5): Likewise.
(ASMARGS_5): Likewise.
(LOADREGS_6): Likewise.
(ASMARGS_6): Likewise.

8 years agoi386: Remove syscall assembly codes with 6 arguments
H.J. Lu [Thu, 15 Oct 2015 11:33:15 +0000 (04:33 -0700)]
i386: Remove syscall assembly codes with 6 arguments

This patch removes i386 assembly implementation for mmap, mmap64,
semtimeop now that i386 have 6 argument syscall support from C code
and GCC 5 can inline syscalls with 6 arguments.  We also compile mmap.c,
mmap64.c and semtimedop.c with -fomit-frame-pointer since %ebp may be
used to pass the 6th argument to syscall.

Fo sysdeps/unix/sysv/linux/i386/mmap.c, with -O2 -march=i686
-mtune=generic, GCC 5.2 now generates:

<__mmap>:
   0: sub    $0x10,%esp
   3: mov    0x28(%esp),%eax
   7: mov    %ebx,(%esp)
   a: mov    0x18(%esp),%ecx
   e: mov    %esi,0x4(%esp)
  12: mov    0x14(%esp),%ebx
  16: mov    %edi,0x8(%esp)
  1a: mov    0x1c(%esp),%edx
  1e: test   $0xfff,%eax
  23: mov    0x20(%esp),%esi
  27: mov    %ebp,0xc(%esp)
  2b: mov    0x24(%esp),%edi
  2f: jne    60 <__mmap+0x60>
  31: shr    $0xc,%eax
  34: mov    %eax,%ebp
  36: mov    $0xc0,%eax
  3b: call   *%gs:0x10
  42: cmp    $0xfffff000,%eax
  47: ja     65 <__mmap+0x65>
  49: mov    (%esp),%ebx
  4c: mov    0x4(%esp),%esi
  50: mov    0x8(%esp),%edi
  54: mov    0xc(%esp),%ebp
  58: add    $0x10,%esp
  5b: ret
  5c: lea    0x0(%esi,%eiz,1),%esi
  60: mov    $0xffffffea,%eax
  65: mov    (%esp),%ebx
  68: mov    0x4(%esp),%esi
  6c: mov    0x8(%esp),%edi
  70: mov    0xc(%esp),%ebp
  74: add    $0x10,%esp
  77: jmp    78 <__mmap+0x78>

vs sysdeps/unix/sysv/linux/i386/mmap.S:

<__mmap>:
   0: push   %ebp
   1: push   %ebx
   2: push   %esi
   3: push   %edi
   4: mov    0x14(%esp),%ebx
   8: mov    0x18(%esp),%ecx
   c: mov    0x1c(%esp),%edx
  10: mov    0x20(%esp),%esi
  14: mov    0x24(%esp),%edi
  18: mov    0x28(%esp),%ebp
  1c: test   $0xfff,%ebp
  22: mov    $0xffffffea,%eax
  27: jne    38 <__mmap+0x38>
  29: shr    $0xc,%ebp
  2c: mov    $0xc0,%eax
  31: call   *%gs:0x10
  38: pop    %edi
  39: pop    %esi
  3a: pop    %ebx
  3b: pop    %ebp
  3c: cmp    $0xfffff000,%eax
  41: ja     44 <__mmap+0x44>
  43: ret
  44: call   45 <__mmap+0x45> 45: R_386_PC32 __x86.get_pc_thunk.cx
  49: add    $0x2,%ecx 4b: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
  4f: mov    0x0(%ecx),%ecx 51: R_386_TLS_GOTIE __libc_errno
  55: neg    %eax
  57: mov    %eax,%gs:(%ecx)
  5a: or     $0xffffffff,%eax
  5d: ret

The C version has:

   3: mov    0x28(%esp),%eax
...
  1e: test   $0xfff,%eax
...
  31: sar    $0xc,%eax
  34: mov    %eax,%ebp

is due to missing $ebx register constraint for inline asm.  We have
to use "r" constraint with

register unsigned int _a6 asm ("ebp") = (unsigned int) (arg6);

and compiler chose %eax for offset (arg6) in

  if (offset & (MMAP_PAGE_UNIT - 1))

* sysdeps/unix/sysv/linux/i386/Makefile (CFLAGS-epoll_pwait.c):
Add -fomit-frame-pointer.
(CFLAGS-mmap.c): Likewise.
(CFLAGS-mmap64.c): Likewise.
(CFLAGS-semtimedop.c): Likewise.
* sysdeps/unix/sysv/linux/i386/mmap.c: New file.
* sysdeps/unix/sysv/linux/i386/mmap.S: Remove file.
* sysdeps/unix/sysv/linux/i386/mmap64.S: Likewise.
* sysdeps/unix/sysv/linux/i386/semtimedop.S: Likewise.

8 years agoAlways enable pointer guard [BZ #18928]
Florian Weimer [Thu, 15 Oct 2015 07:23:07 +0000 (09:23 +0200)]
Always enable pointer guard [BZ #18928]

Honoring the LD_POINTER_GUARD environment variable in AT_SECURE mode
has security implications.  This commit enables pointer guard
unconditionally, and the environment variable is now ignored.

        [BZ #18928]
        * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
        _dl_pointer_guard member.
        * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
        initializer.
        (security_init): Always set up pointer guard.
        (process_envvars): Do not process LD_POINTER_GUARD.

8 years agoFix powerpc32 lround, lroundf spurious exceptions (bug 19134).
Joseph Myers [Wed, 14 Oct 2015 21:13:42 +0000 (21:13 +0000)]
Fix powerpc32 lround, lroundf spurious exceptions (bug 19134).

The powerpc32 implementation of lround and lroundf can produce
spurious exceptions from adding 0.5 then converting to integer.  This
includes "inexact" from the conversion to integer (not allowed for
integer arguments to these functions), and, for larger integer
arguments, "inexact", and "overflow" when rounding upward, from the
addition.  In addition, "inexact" is not allowed together with
"invalid" and so inexact addition must be avoided when the integer
will be out of range of 32-bit long, whether or not the argument is an
integer.

This patch fixes these problems.  As in the powerpc64 llround
implementation, a check is added for too-large arguments; in the
powerpc64 case that means arguments at least 2^52 in magnitude (so
that 0.5 cannot be added exactly), while in this case it means
arguments for which the result would overflow "long".  In those cases
a suitable overflowing value is used for the integer conversion
without adding 0.5, while for smaller arguments it's tested whether
the argument is an integer (by adding and subtracting 2^52 to the
absolute value and comparing with the original absolute value) to
avoid adding 0.5 to integers and generating spurious "inexact".

This code is not used when the power5+ sysdeps directories are used,
as there's a separate power5+ version of these functions..

Tested for powerpc.  This gets test-float (for a default powerpc32
hard-float build without any --with-cpu) back to the point where it
should pass once powerpc ulps are regenerated; test-double still needs
another problem with exceptions fixed to get back to that point (and I
haven't looked lately at what default powerpc64 results are like).

[BZ #19134]
* sysdeps/powerpc/powerpc32/fpu/s_lround.S (.LC1): New object.
(.LC2): Likewise.
(.LC3): Likewise.
(__lround): Do not add 0.5 to integer or out-of-range arguments.

8 years ago[BZ #19129][ARM] Fix _dl_tlsdesc_resolve_hold to save r0
Szabolcs Nagy [Wed, 14 Oct 2015 15:58:41 +0000 (16:58 +0100)]
[BZ #19129][ARM] Fix _dl_tlsdesc_resolve_hold to save r0

_dl_tlsdesc_resolve_hold calls into a C function that clobbers r0,
but it assumes the original argument is still in r0 after the call.
This can cause crash in case of concurrent TLS access when TLSDESC
is in use (-mtls-dialect=gnu2).

Run into this while fixing BZ 18572.

Both r0 and r1 are saved/restored so the stack remains 8 byte aligned.

[BZ #19129]
* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_resolve_hold): Save and restore
r0 and r1.

8 years agomanual/argp.texi (Specifying Argp Parsers): Fix typo.
Namhyung Kim [Wed, 14 Oct 2015 15:49:58 +0000 (11:49 -0400)]
manual/argp.texi (Specifying Argp Parsers): Fix typo.

8 years agoinclude/stap-probe.h: Fix formatting.
Carlos O'Donell [Wed, 14 Oct 2015 15:34:20 +0000 (11:34 -0400)]
include/stap-probe.h: Fix formatting.

Fix macro indentation.

8 years agoFix double-checked locking in _res_hconf_reorder_addrs [BZ #19074]
Florian Weimer [Wed, 14 Oct 2015 14:19:24 +0000 (16:19 +0200)]
Fix double-checked locking in _res_hconf_reorder_addrs [BZ #19074]

[BZ #19074]
* resolv/res_hconf.c (_res_hconf_reorder_addrs): Use atomics to
load and store num_ifs.

8 years agoAvoid PLT when calling __sched_getaffinity_new
H.J. Lu [Wed, 14 Oct 2015 13:33:24 +0000 (06:33 -0700)]
Avoid PLT when calling __sched_getaffinity_new

This patch adds an internal entry for __sched_getaffinity_new so that
__sched_getaffinity_old calls __sched_getaffinity_new without going
through PLT.

[BZ #18822]
* sysdeps/unix/sysv/linux/sched_getaffinity.c
(__sched_getaffinity_new): Add libc_hidden_proto and
libc_hidden_def.

8 years agoSupport PLT and GOT references in local PIC check
H.J. Lu [Wed, 14 Oct 2015 12:59:50 +0000 (05:59 -0700)]
Support PLT and GOT references in local PIC check

Linker in binutils 2.26 and newer generate GOT references instead
PLT references when -z now is passed to linker.  We need to extend
scripts/localplt.awk to allow PLT or GOT references.

[BZ #19007]
* scripts/localplt.awk: Also allow GOT references.
* sysdeps/unix/sysv/linux/i386/localplt.data: Mark
_Unwind_Find_FDE, calloc, memalign, realloc and __libc_memalign
with "+ REL R_386_GLOB_DAT".
* sysdeps/x86_64/localplt.data: Mark calloc, memalign, realloc
and __libc_memalign with "+ RELA R_X86_64_GLOB_DAT".

8 years agoUse INTERNAL_SYSCALL and INLINE_SYSCALL_ERROR_RETURN_VALUE
H.J. Lu [Wed, 14 Oct 2015 10:45:32 +0000 (03:45 -0700)]
Use INTERNAL_SYSCALL and INLINE_SYSCALL_ERROR_RETURN_VALUE

This patch uses INTERNAL_SYSCALL and INLINE_SYSCALL_ERROR_RETURN_VALUE
to avoid reading and writing errno directly so that we don't need to
call __x86.get_pc_thunk.reg to load PC into reg in case there is an
error.

* sysdeps/unix/sysv/linux/i386/brk.c (__brk): Use
INLINE_SYSCALL_ERROR_RETURN_VALUE.
* sysdeps/unix/sysv/linux/i386/fxstatat.c (__fxstatat):
Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Use
INTERNAL_SYSCALLINTERNAL_SYSCALL and
INLINE_SYSCALL_ERROR_RETURN_VALUE.
* sysdeps/unix/sysv/linux/i386/lockf64.c (lockf64): Likewise.
* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/i386/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.

8 years agoFix powerpc32 llround, llroundf exceptions (bug 19125).
Joseph Myers [Tue, 13 Oct 2015 23:30:20 +0000 (23:30 +0000)]
Fix powerpc32 llround, llroundf exceptions (bug 19125).

The powerpc32 implementations of llroundf and llround produce spurious
and missing exceptions (some arising from such exceptions from
conversions to long long, some present even when fctidz is used).

This patch fixes those problems in a similar way to the llrint /
llrintf fixes.  The spurious exceptions in the fctidz case for large
arguments arise from a converted value that saturated as LLONG_MAX
being converted back to float or double (the conversion back being
inexact, but "inexact" must not be raised together with "invalid"),
and from the subtraction x - xrf also being inexact for sufficiently
large arguments (whether the saturation was to LLONG_MAX or
LLONG_MIN); those are fixed by returning early if the argument is
large enough that no rounding is needed.

This code is not used for --with-cpu=power4 builds (I suspect the code
used in that case may also produce spurious "inexact" exceptions, but
that's something to investigate later).

Tested for powerpc.

[BZ #19125]
* sysdeps/powerpc/powerpc32/fpu/s_llround.c: Include <limits.h>,
<math_private.h> and <stdint.h>.
(__llround): Avoid conversions to and from long long int, and
subtractions, where those might raise spurious exceptions.
* sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: Include
<math_private.h> and <stdint.h>.
(__llroundf): Avoid conversions to and from long long int, and
subtractions, where those might raise spurious exceptions.

8 years agoUse INLINE_SYSCALL_ERROR_RETURN_VALUE
H.J. Lu [Tue, 13 Oct 2015 19:00:45 +0000 (12:00 -0700)]
Use INLINE_SYSCALL_ERROR_RETURN_VALUE

This patch replaces

  {
    __set_errno (ERRNO);
    return -1;
  }

with INLINE_SYSCALL_ERROR_RETURN_VALUE (ERRNO).

* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME): Use
INLINE_SYSCALL_ERROR_RETURN_VALUE.
* sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise.
* sysdeps/unix/sysv/linux/eventfd.c (eventfd): Likewise.
* sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise.
* sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise.
* sysdeps/unix/sysv/linux/fcntl.c (do_fcntl): Likewise.
* sysdeps/unix/sysv/linux/futimens.c (futimens): Likewise.
* sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise.
* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
* sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise.
* sysdeps/unix/sysv/linux/lutimes.c (lutimes): Likewise.
* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/lxstat64.c (___lxstat64): Likewise.
* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Likewise.
* sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Likewise.
* sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Likewise.
* sysdeps/unix/sysv/linux/prlimit.c (prlimit): Likewise.
* sysdeps/unix/sysv/linux/readahead.c (__readahead): Likewise.
* sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise.
* sysdeps/unix/sysv/linux/signalfd.c (signalfd): Likewise.
* sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Likewise.
* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/sysv/linux/ustat.c (ustat): Likewise.
* sysdeps/unix/sysv/linux/utimensat.c (utimensat): Likewise.
* sysdeps/unix/sysv/linux/xmknod.c (__xmknod): Likewise.
* sysdeps/unix/sysv/linux/xmknodat.c (__xmknodat): Likewise.
* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/xstatconv.c (__xstat_conv): Likewise.
(__xstat64_conv): Likewise.
(__xstat32_conv): Likewise.

8 years agoAdd INLINE_SYSCALL_ERROR_RETURN_VALUE
H.J. Lu [Tue, 13 Oct 2015 18:58:53 +0000 (11:58 -0700)]
Add INLINE_SYSCALL_ERROR_RETURN_VALUE

For ia32 PIC, the first thing of many syscalls does is to call
__x86.get_pc_thunk.reg to load PC into reg in case there is an error,
which is required for setting errno.  In most cases, there are no
errors.  But we still call __x86.get_pc_thunk.reg.  This patch adds
INLINE_SYSCALL_ERROR_RETURN_VALUE so that i386 can optimize setting
errno by branching to the internal __syscall_error without PLT.

With i386 INLINE_SYSCALL_ERROR_RETURN_VALUE and i386 syscall inlining
optimization for GCC 5, for sysdeps/unix/sysv/linux/fchmodat.c with
-O2 -march=i686 -mtune=generic, GCC 5.2 now generates:

<fchmodat>:
   0: push   %ebx
   1: mov    0x14(%esp),%eax
   5: mov    0x8(%esp),%ebx
   9: mov    0xc(%esp),%ecx
   d: mov    0x10(%esp),%edx
  11: test   $0xfffffeff,%eax
  16: jne    38 <fchmodat+0x38>
  18: test   $0x1,%ah
  1b: jne    48 <fchmodat+0x48>
  1d: mov    $0x132,%eax
  22: call   *%gs:0x10
  29: cmp    $0xfffff000,%eax
  2e: ja     58 <fchmodat+0x58>
  30: pop    %ebx
  31: ret
  32: lea    0x0(%esi),%esi
  38: pop    %ebx
  39: mov    $0xffffffea,%eax
  3e: jmp    3f <fchmodat+0x3f> 3f: R_386_PC32 __syscall_error
  43: nop
  44: lea    0x0(%esi,%eiz,1),%esi
  48: pop    %ebx
  49: mov    $0xffffffa1,%eax
  4e: jmp    4f <fchmodat+0x4f> 4f: R_386_PC32 __syscall_error
  53: nop
  54: lea    0x0(%esi,%eiz,1),%esi
  58: pop    %ebx
  59: jmp    5a <fchmodat+0x5a> 5a: R_386_PC32 __syscall_error

instead of

<fchmodat>:
   0: sub    $0x8,%esp
   3: mov    0x18(%esp),%eax
   7: mov    %ebx,(%esp)
   a: call   b <fchmodat+0xb> b: R_386_PC32 __x86.get_pc_thunk.bx
   f: add    $0x2,%ebx 11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_
  15: mov    %edi,0x4(%esp)
  19: test   $0xfffffeff,%eax
  1e: jne    70 <fchmodat+0x70>
  20: test   $0x1,%ah
  23: jne    88 <fchmodat+0x88>
  25: mov    0x14(%esp),%edx
  29: mov    0x10(%esp),%ecx
  2d: mov    0xc(%esp),%edi
  31: xchg   %ebx,%edi
  33: mov    $0x132,%eax
  38: call   *%gs:0x10
  3f: xchg   %edi,%ebx
  41: cmp    $0xfffff000,%eax
  46: ja     58 <fchmodat+0x58>
  48: mov    (%esp),%ebx
  4b: mov    0x4(%esp),%edi
  4f: add    $0x8,%esp
  52: ret
  53: nop
  54: lea    0x0(%esi,%eiz,1),%esi
  58: mov    0x0(%ebx),%edx 5a: R_386_TLS_GOTIE __libc_errno
  5e: neg    %eax
  60: mov    %eax,%gs:(%edx)
  63: mov    $0xffffffff,%eax
  68: jmp    48 <fchmodat+0x48>
  6a: lea    0x0(%esi),%esi
  70: mov    0x0(%ebx),%eax 72: R_386_TLS_GOTIE __libc_errno
  76: movl   $0x16,%gs:(%eax)
  7d: mov    $0xffffffff,%eax
  82: jmp    48 <fchmodat+0x48>
  84: lea    0x0(%esi,%eiz,1),%esi
  88: mov    0x0(%ebx),%eax 8a: R_386_TLS_GOTIE __libc_errno
  8e: movl   $0x5f,%gs:(%eax)
  95: mov    $0xffffffff,%eax
  9a: jmp    48 <fchmodat+0x48>

* sysdeps/unix/sysv/linux/sysdep.h: New file.
* sysdeps/unix/sysv/linux/i386/sysdep.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/sysdep.h: Include
<sysdeps/unix/sysv/linux/sysdep.h>.
* sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/generic/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/hppa/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/microblaze/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == csu]
(sysdep-dl-routines): Add sysdep.
[$(subdir) == nptl] (libpthread-routines): Likewise.
[$(subdir) == rt] (librt-routines): Likewise.
* sysdeps/unix/sysv/linux/i386/clone.S (__clone): Don't check
PIC when branching to SYSCALL_ERROR_LABEL.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Removed.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Include
<sysdeps/unix/sysv/linux/sysdep.h>.
(SYSCALL_ERROR_LABEL): Changed to __syscall_error.
(SYSCALL_ERROR_ERRNO): Removed.
(SYSCALL_ERROR_HANDLER): Changed to empty.
(SYSCALL_ERROR_HANDLER_TLS_STORE): Likewise.
(__syscall_error): New prototype.
[IS_IN (libc)] (INLINE_SYSCALL): New macro.
(INLINE_SYSCALL_ERROR_RETURN_VALUE): Likewise.

8 years agoSupport x86-64 assmebler without AVX512
H.J. Lu [Tue, 13 Oct 2015 17:29:45 +0000 (10:29 -0700)]
Support x86-64 assmebler without AVX512

When x86-64 assmebler doesn't support AVX512, we should make
_dl_runtime_resolve_avx512/_dl_runtime_profile_avx512 as aliases of
_dl_runtime_resolve_avx/_dl_runtime_profile_avx.  Tested on x86-64
using GCC 5.2 with binutils 20151008 and GCC 4.8 with binutils 20130219.
There are no differences in ld.so with binutils 20151008.  There are no
unexpected failures with binutils 20130219 and 20151008.

[BZ #19124]
* sysdeps/x86_64/dl-trampoline.S [!HAVE_AVX512_ASM_SUPPORT]
(_dl_runtime_resolve_avx512): Make it a hidden alias of
_dl_runtime_resolve_avx.
(_dl_runtime_profile_avx512): Make it a hidden alias of
_dl_runtime_profile_avx.

8 years agoMove powerpc llround implementations to powerpc32 directory.
Joseph Myers [Tue, 13 Oct 2015 16:53:09 +0000 (16:53 +0000)]
Move powerpc llround implementations to powerpc32 directory.

sysdeps/powerpc/fpu/ has versions of llround and llroundf that are
actually used only for powerpc32 because
sysdeps/powerpc/powerpc64/fpu/ has its own versions of those
functions.  This patch moves them into sysdeps/powerpc/powerpc32/fpu
to reflect where they are actually used (in preparation for fixing
other problems with those functions).

Tested for powerpc that installed stripped shared libraries are
unchanged by this patch.

* sysdeps/powerpc/fpu/s_llround.c: Move to ....
* sysdeps/powerpc/powerpc32/fpu/s_llround.c: ...here.
* sysdeps/powerpc/fpu/s_llroundf.c: Move to ....
* sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: ...here.

8 years agoFix powerpc32 llrint, llrintf bad exceptions (bug 16422).
Joseph Myers [Tue, 13 Oct 2015 00:52:54 +0000 (00:52 +0000)]
Fix powerpc32 llrint, llrintf bad exceptions (bug 16422).

The versions of llrint and llrintf for older powerpc32 processors
convert the results of __rint / __rintf to long long int, resulting in
spurious exceptions from such casts in certain cases.  This patch
makes glibc work around the problems with the libgcc conversions when
the compiler used to build glibc doesn't use the fctidz instruction
for them.

Tested for powerpc.

[BZ #16422]
* sysdeps/powerpc/powerpc32/fpu/configure.ac (libc_cv_ppc_fctidz):
New configure test.
* sysdeps/powerpc/powerpc32/fpu/configure: Regenerated.
* config.h.in [_LIBC] (HAVE_PPC_FCTIDZ): New macro.
* sysdeps/powerpc/powerpc32/fpu/s_llrint.c: Include <limits.h>,
<math_private.h> and <stdint.h>.
(__llrint): Avoid conversions to long long int where those might
raise spurious exceptions.
* sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include
<math_private.h> and <stdint.h>.
(__llrintf): Avoid conversions to long long int where those might
raise spurious exceptions.

8 years agoAdd bug reference
Andreas Schwab [Mon, 12 Oct 2015 13:28:24 +0000 (15:28 +0200)]
Add bug reference

8 years agoAdd dependencies on needed locales in each subdir tests (bug 18969)
Andreas Schwab [Mon, 12 Oct 2015 10:24:41 +0000 (12:24 +0200)]
Add dependencies on needed locales in each subdir tests (bug 18969)

8 years agoRemove unusued variable
Samuel Thibault [Sat, 10 Oct 2015 14:44:42 +0000 (16:44 +0200)]
Remove unusued variable

hurd/hurd-raise.c (_hurd_raise_signal): Remove unused err variable.

8 years agoMake _hurd_raise_signal directly return the error
Samuel Thibault [Sat, 10 Oct 2015 14:31:43 +0000 (16:31 +0200)]
Make _hurd_raise_signal directly return the error

* hurd/hurd-raise.c (_hurd_raise_signal): Return error returned by
__msg_sig_post.

8 years agoMake _hurd_raise_signal return errors
Samuel Thibault [Sat, 10 Oct 2015 14:21:41 +0000 (16:21 +0200)]
Make _hurd_raise_signal return errors

* hurd/hurd-raise.c (_hurd_raise_signal): Set errno to error returned
by __msg_sig_post.
* hurd/hurd/signal.h (_hurd_raise_signal): Add int return type.

8 years agoChangeLog: Fix incorrect email address
Phil Blundell [Fri, 9 Oct 2015 22:39:36 +0000 (23:39 +0100)]
ChangeLog: Fix incorrect email address

For reasons that are slightly unclear, the ChangeLog entry added in
67ac0f74a4a5021f77566fdbe4cda5880eba8ba4 contained a mangled version
of my email address.  Replace that with the correct one.

8 years agoRegenerate MIPS libm-test-ulps.
Joseph Myers [Fri, 9 Oct 2015 22:39:11 +0000 (22:39 +0000)]
Regenerate MIPS libm-test-ulps.

* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
* sysdeps/mips/mips64/libm-test-ulps: Likewise.

8 years agoRegenerate ARM libm-test-ulps.
Joseph Myers [Fri, 9 Oct 2015 22:30:26 +0000 (22:30 +0000)]
Regenerate ARM libm-test-ulps.

* sysdeps/arm/libm-test-ulps: Regenerated.

8 years agoFix llrint, llround missing exceptions for ARM (bug 15470).
Joseph Myers [Fri, 9 Oct 2015 22:23:39 +0000 (22:23 +0000)]
Fix llrint, llround missing exceptions for ARM (bug 15470).

Similar to the recent fix for MIPS, ARM is also missing correct
exceptions on overflow from llrint and llround functions because casts
from floating-point types to long long do not result in correct
exceptions on overflow.  This patch enables the fix for this for ARM.

Tested for ARM.

[BZ #15470]
* sysdeps/arm/fix-fp-int-convert-overflow.h: New file.

8 years agoFix lrint, llrint, lround, llround missing exceptions for MIPS (bug 16399).
Joseph Myers [Fri, 9 Oct 2015 21:02:19 +0000 (21:02 +0000)]
Fix lrint, llrint, lround, llround missing exceptions for MIPS (bug 16399).

For 32-bit MIPS and some other systems, various of the lrint, llrint,
lround, llround functions can be missing exceptions on overflow
because casts do not (in current GCC) result in the proper
exceptions.  In the MIPS case there are two problems here: MIPS I code
generation uses an assembler macro that doesn't raise exceptions,
while the libgcc conversions of floating-point values to long long
also do not raise "invalid" on all overflow cases (and can raise
spurious "inexact").

This patch adds support in the generic code (only the functions for
which this problem has actually been seen) for forcing the "invalid"
exception in the problem cases, and enables that support for the
affected MIPS cases.

Tested for MIPS; also tested for x86_64 and x86 that installed
stripped shared libraries are unchanged by this patch.

[BZ #16399]
* sysdeps/generic/fix-fp-int-convert-overflow.h: New file.
* sysdeps/ieee754/dbl-64/s_llrint.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__llrint) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/dbl-64/s_llround.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__llround) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/dbl-64/s_lrint.c: Include
<fix-fp-int-convert-overflow.h>.
(__lrint) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/dbl-64/s_lround.c: Include
<fix-fp-int-convert-overflow.h>.
(__lround) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_llrintf.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__llrintf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_llroundf.c: Include <fenv.h>,
<limits.h> and <fix-fp-int-convert-overflow.h>.
(__llroundf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_lrintf.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__lrintf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/ieee754/flt-32/s_lroundf.c: Include <fenv.h>, <limits.h>
and <fix-fp-int-convert-overflow.h>.
(__lroundf) [FE_INVALID]: Force FE_INVALID exception as needed if
FIX_DBL_LLONG_CONVERT_OVERFLOW.
* sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h: New file.

8 years agoFix typo in bug-strcoll2 (Bug 18589)
Carlos O'Donell [Fri, 9 Oct 2015 20:35:53 +0000 (16:35 -0400)]
Fix typo in bug-strcoll2 (Bug 18589)

Fix the copyright year and remove contributed by in the
bug-strcoll2 test. In addition add the correct dependency
on $(gen-locales) to ensure all the test locales are generated.

8 years agonptl: Add NPTL cases for cancellation failures cases
Adhemerval Zanella [Mon, 21 Sep 2015 22:54:04 +0000 (15:54 -0700)]
nptl: Add NPTL cases for cancellation failures cases

This patch pthread cancellation tests to check for failures cases
wherer the syscall cancel wrapper should both set the error and
the errno values.

Tested on i686, x86_64, x32, powerpc64le, and aarch64.

* nptl/Makefile (tests): Add tst-cancel26.c and tst-cancel27.c.
* nptl/tst-cancel26.c: New file.
* nptl/tst-cancel27.c: Likewise.

8 years agoUpdate lrint/lrintf/lrintl for x32
H.J. Lu [Fri, 9 Oct 2015 18:33:30 +0000 (11:33 -0700)]
Update lrint/lrintf/lrintl for x32

The x86_64 versions of lrint/lrintf/ lrintl are aliases for the long
long versions which isn't correct for x32, where exceptions must respect
overflow for 32-bit long.  Separate versions of the long functions for
x32 that convert to 32-bit long and raise the right exceptions for that
conversion, while keeping the aliases in the non-x32 case.

Tested on x86_64 and x32.  There are no code changes in libm.so on
x86_64.

* sysdeps/x86_64/fpu/s_llrint.S (__lrint): Add alias only if
__ILP32__ isn't defined.
(lrint): Likewise.
* sysdeps/x86_64/fpu/s_llrintf.S (__lrintf): Likewise.
(lrintf): Likewise.
* sysdeps/x86_64/fpu/s_llrintl.S (__lrintl): Likewise.
(lrintl): Likewise.
* sysdeps/x86_64/x32/fpu/s_lrint.S: New file.
* sysdeps/x86_64/x32/fpu/s_lrintf.S: Likewise.
* sysdeps/x86_64/x32/fpu/s_lrintl.S: Likewise.

8 years agoMark lseek/llseek as non-cancellable
Adhemerval Zanella [Thu, 24 Sep 2015 22:35:57 +0000 (15:35 -0700)]
Mark lseek/llseek as non-cancellable

This patch sets lseek/llseek for 64-bit, MIPS n32, and x86_32 as non-
cancelable.  This make it consistant with 32-bit platform.

Tested on i686, x86_64, and x32.

* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (lseek): Set as
non-cancelable.
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (llseek): Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/lseek.S (__libc_lseek64):
Likewise.

8 years agoRemove configure tests for -mno-vzeroupper support.
Joseph Myers [Fri, 9 Oct 2015 16:03:48 +0000 (16:03 +0000)]
Remove configure tests for -mno-vzeroupper support.

GCC added support for -mno-vzeroupper in version 4.6.  Thus the
configure tests for this support are obsolete, and this patch removes
them.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).

* sysdeps/i386/configure.ac (libc_cv_cc_novzeroupper): Remove
configure test.
* sysdeps/i386/configure: Regenerated.
* sysdeps/x86_64/configure.ac (libc_cv_cc_novzeroupper): Remove
configure test.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/Makefile [$(config-cflags-novzeroupper) = yes]:
Make code unconditional.

8 years agoRemove configure tests for FMA4 support.
Joseph Myers [Fri, 9 Oct 2015 16:02:54 +0000 (16:02 +0000)]
Remove configure tests for FMA4 support.

GCC added support for -mfma4 in version 4.5.  Thus the configure tests
for this support are obsolete, and this patch removes them.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).

* sysdeps/i386/configure.ac (libc_cv_cc_fma4): Remove configure
test.
* sysdeps/i386/configure: Regenerated.
* sysdeps/x86_64/configure.ac (libc_cv_cc_fma4): Remove configure
test.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/fpu/multiarch/Makefile [$(have-mfma4) = yes]:
Make code unconditional.
* sysdeps/x86_64/fpu/multiarch/e_asin.c [HAVE_FMA4_SUPPORT]:
Likewise.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c [HAVE_FMA4_SUPPORT]:
Likewise.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/e_exp.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/e_log.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
* sysdeps/x86_64/fpu/multiarch/s_atan.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_sin.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* sysdeps/x86_64/fpu/multiarch/s_tan.c [HAVE_FMA4_SUPPORT]: Make
code unconditional.
[!HAVE_FMA4_SUPPORT]: Remove conditional code.
* config.h.in (HAVE_FMA4_SUPPORT): Remove #undef.

8 years agoFix dbl-64 lrint for 64-bit long (bug 19095).
Joseph Myers [Fri, 9 Oct 2015 00:32:14 +0000 (00:32 +0000)]
Fix dbl-64 lrint for 64-bit long (bug 19095).

The dbl-64 implementation of lrint produces incorrect results for some
arguments with 64-bit long because a 32-bit (unsigned) low part of the
mantissa is shifted left, losing high bits in the process.  This patch
fixes this by casting to long int before shifting, as in lround (as
this case only applies for 64-bit long, there are no issues with
sign-extension).

Tested for mips64 (n64).

[BZ #19095]
* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Cast low part of
mantissa to long int before shifting left.

8 years agoFix lrint, llrint missing exceptions close to overflow threshold (bug 19094).
Joseph Myers [Thu, 8 Oct 2015 22:17:45 +0000 (22:17 +0000)]
Fix lrint, llrint missing exceptions close to overflow threshold (bug 19094).

The dbl-64, ldbl-96 and ldbl-128 implementations of lrint and llrint
fail to produce "invalid" exceptions in cases where the rounded result
overflows the target type, but truncating the floating-point argument
to the next integer towards zero does not overflow it (so in
particular casts do not produce such exceptions).  (This issue cannot
arise for float, or for double with 64-bit target type, or for ldbl-96
with 64-bit target type and negative arguments, because of
insufficient precision in the floating-point type for arguments with
the relevant property to exist.  It also obviously cannot arise in
FE_TOWARDZERO mode.)

This patch fixes these problems by inserting checks for the special
cases that can occur in each implementation, and explicitly raising
FE_INVALID (and avoiding the cast if it might raise spurious
FE_INEXACT, while raising FE_INEXACT explicitly in the cases where it
is needed; unlike lround and llround, FE_INEXACT is required, not
optional, for these functions for a within-range inexact result).

The fixes are conditional on FE_INVALID or FE_INEXACT being defined.
If any future architecture supports one but not both of those
exceptions, the code will fail to compile and need fixing to handle
that case (this seemed better than conditioning on both macros being
defined, resulting in code that would compile but quietly miss
exceptions on such a system).

Tested for x86_64, x86 and mips64.  Tested the ldbl-96 changes (only
relevant for ia64, it appears) on x86_64 by removing the x86_64
versions of lrintl / llrintl.

[BZ #19094]
* sysdeps/ieee754/dbl-64/s_lrint.c: Include <fenv.h> and
<limits.h>.
(__lrint) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-128/s_llrintl.c: Include <fenv.h> and
<limits.h>.
(__llrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-128/s_lrintl.c: Include <fenv.h> and
<limits.h>.
(__lrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-96/s_llrintl.c: Include <fenv.h> and
<limits.h>.
(__llrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* sysdeps/ieee754/ldbl-96/s_lrintl.c: Include <fenv.h> and
<limits.h>.
(__lrintl) [FE_INVALID || FE_INEXACT]: Force FE_INVALID exception
when result overflows but exception would not result from cast.
* math/libm-test.inc (lrint_test_data): Add more tests.
(llrint_test_data): Likewise.

8 years agoBZ#18872: Don't conditionalize build rules for test program.
Roland McGrath [Thu, 8 Oct 2015 21:50:22 +0000 (14:50 -0700)]
BZ#18872: Don't conditionalize build rules for test program.

8 years agostrcoll: Add bug-strcoll2 to testsuite (Bug 18589).
Carlos O'Donell [Thu, 8 Oct 2015 20:54:30 +0000 (16:54 -0400)]
strcoll: Add bug-strcoll2 to testsuite (Bug 18589).

Adds bug-strcoll2 to the string tests, along with the
generation of required locales.

8 years agostrcoll: Remove incorrect STRDIFF-based optimization (Bug 18589).
Carlos O'Donell [Thu, 8 Oct 2015 20:34:53 +0000 (16:34 -0400)]
strcoll: Remove incorrect STRDIFF-based optimization (Bug 18589).

The optimization introduced in commit
f13c2a8dff2329c6692a80176262ceaaf8a6f74e, causes regressions in
sorting for languages that have digraphs that change sort order, like
cs_CZ which sorts ch between h and i.

My analysis shows the fast-forwarding optimization in STRCOLL advances
through a digraph while possibly stopping in the middle which results
in a subsequent skipping of the digraph and incorrect sorting. The
optimization is incorrect as implemented and because of that I'm
removing it for 2.23, and I will also commit this fix for 2.22 where
it was originally introduced.

This patch reverts the optimization, introduces a new bug-strcoll2.c
regression test that tests both cs_CZ.UTF-8 and da_DK.ISO-8859-1 and
ensures they sort one digraph each correctly. The optimization can't be
applied without regressing this test.

Checked on x86_64, bug-strcoll2.c fails without this patch and passes
after. This will also get a fix on 2.22 which has the same bug.

8 years agoCorrect "inexact" expectations in lround, llround tests.
Joseph Myers [Thu, 8 Oct 2015 17:24:49 +0000 (17:24 +0000)]
Correct "inexact" expectations in lround, llround tests.

I noticed that some of my recently added tests of lround and llround
wrongly expected the "inexact" exception to be absent for certain
within-range non-integer arguments.  (It's unspecified whether this
exception is present or not for within-range non-integer arguments; it
mustn't be present for integer arguments and out-of-range arguments.)
This patch corrects those expectations.

Tested for x86_64 and x86.

* math/libm-test.inc (lround_test_data): Do not expect the absence
of "inexact" for some tests with non-integer arguments.
(llround_test_data): Likewise.

8 years agoRemove configure tests for AVX support.
Joseph Myers [Thu, 8 Oct 2015 15:59:32 +0000 (15:59 +0000)]
Remove configure tests for AVX support.

GCC added support for -mavx and -msse2avx in version 4.4.  Thus the
configure tests for this support are obsolete, and this patch removes
them.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).

* sysdeps/i386/configure.ac (libc_cv_cc_avx): Remove configure
test.
(libc_cv_cc_sse2avx): Likewise.
* sysdeps/i386/configure: Regenerated.
* sysdeps/i386/i686/multiarch/Makefile
[$(subdir)$(config-cflags-avx) = mathyes]: Change conditional to
[$(subdir) = math].
* sysdeps/i386/i686/multiarch/s_fma-fma.c [HAVE_AVX_SUPPORT]: Make
code unconditional.
* sysdeps/i386/i686/multiarch/s_fma.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/i386/i686/multiarch/s_fmaf-fma.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/i386/i686/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/x86_64/configure.ac (libc_cv_cc_avx): Remove configure
test.
(libc_cv_cc_sse2avx): Likewise.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/Makefile [$(config-cflags-avx) = yes]: Make code
unconditional.
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile)
[HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT]: Make code
unconditional.
(_dl_runtime_profile)
[!(HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT)]: Remove
conditional code.
* sysdeps/x86_64/fpu/multiarch/Makefile
[$(config-cflags-sse2avx) = yes]: Make code unconditional.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]:
Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.
* sysdeps/x86_64/multiarch/strcmp.S [HAVE_AVX_SUPPORT]: Likewise.
* config.h.in (HAVE_AVX_SUPPORT): Remove #undef.
(HAVE_SSE2AVX_SUPPORT): Likewise.

8 years agoAdd BZ#19086 to NEWS.
Carlos O'Donell [Thu, 8 Oct 2015 14:38:36 +0000 (10:38 -0400)]
Add BZ#19086 to NEWS.

8 years agostdio-common/tst-printf-bz18872.sh: Use attribute optimize instead of
Paul Pluzhnikov [Thu, 8 Oct 2015 06:17:33 +0000 (23:17 -0700)]
stdio-common/tst-printf-bz18872.sh: Use attribute optimize instead of

This fixes build problems on arm, aarch64 and s390, which failed due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884.

8 years agomalloc: Consistently apply trim_threshold to all heaps (Bug 17195)
Carlos O'Donell [Thu, 8 Oct 2015 02:21:36 +0000 (22:21 -0400)]
malloc: Consistently apply trim_threshold to all heaps (Bug 17195)

In the per-thread arenas we apply trim_threshold-based checks
to the extra space between the pad and the top_area. This isn't
quite accurate and instead we should be harmonizing with the way
in which trim_treshold is applied everywhere else like sysrtim
and _int_free. The trimming check should be based on the size of
the top chunk and only the size of the top chunk. The following
patch harmonizes the trimming and make it consistent for the main
arena and thread arenas.

In the old code a large padding request might have meant that
trimming was not triggered. Now trimming is considered first based
on the chunk, then the pad is subtracted, and the remainder trimmed.
This is how all the other trimmings operate. I didn't measure the
performance difference of this change because it corrects what I
consider to be a behavioural anomaly. We'll need some profile driven
optimization to make this code better, and even there Ondrej and
others have better ideas on how to speedup malloc.

Tested on x86_64 with no regressions. Already reviewed by Siddhesh
Poyarekar and Mel Gorman here and discussed here:
https://sourceware.org/ml/libc-alpha/2015-05/msg00002.html

8 years agoAdd task_notify to mach_interface_list
Samuel Thibault [Thu, 8 Oct 2015 00:14:43 +0000 (02:14 +0200)]
Add task_notify to mach_interface_list

* sysdeps/mach/configure.ac (mach_interface_list): Add task_notify.

This page took 0.120222 seconds and 5 git commands to generate.