Commit Graph

9426 Commits

Author SHA1 Message Date
Siddhesh Poyarekar
9cd4747089 Add new macro IN_MODULE to identify module in which source is built
The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will replace uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant binary changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

	* Makeconfig (in-module): Get value of libof set for the
	translation unit.
	(CPPFLAGS): Use $(in-module).
	* Makerules: Don't suffix routine names for nonlib.
	* include/libc-modules.h: New file.
	* include/libc-symbols.h: Include libc-modules.h
	(IS_IN): New macro to replace IS_IN_* macros.
	* elf/Makefile: Set libof-* for each routine.
	* elf/rtld-Rules: Likewise.
	* extra-modules.mk: Likewise.
	* iconv/Makefile: Likewise.
	* iconvdata/Makefile: Likewise.
	* locale/Makefile: Likewise.
	* malloc/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* sysdeps/gnu/Makefile: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Likewise.
	* sysdeps/s390/s390-64/Makefile: Likewise.
	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
	CPPFLAGS for nscd instead of nonlib.
2014-11-19 12:13:54 +05:30
Roland McGrath
6540b9916b NPTL: Move Linux-specific createthread.c to sysdeps. 2014-11-18 11:03:20 -08:00
Joseph Myers
107a5bf085 Fix libm mpone, mptwo namespace (bug 17616).
libm uses symbols mpone and mptwo for internal purposes.  This patch
moves them to the implementation namespace (__mpone and __mptwo).

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

	[BZ #17616]
	* sysdeps/ieee754/dbl-64/mpa.c (mpone): Rename to __mpone.
	(mptwo): Rename to __mptwo.
	(__inv): Use __mptwo instead of mptwo.
	* sysdeps/ieee754/dbl-64/mpa.h (mpone): Rename to __mpone.
	(mptwo): Rename to __mptwo.
	* sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Use __mpone instead
	of mpone and __mptwo instead of mptwo.
	* sysdeps/ieee754/dbl-64/mpatan2.c (__mpatan2): Use __mpone
	instead of mpone.
	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Likewise.
	* sysdeps/ieee754/dbl-64/mplog.c (__mplog): Likewise.
	* sysdeps/ieee754/dbl-64/sincos32.c (__c32): Use __mpone instead
	of mpone and __mptwo instead of mptwo.
	(__mpranred): Use __mpone instead of mpone.
	* conform/Makefile (test-xfail-ISO/math.h/linknamespace): Remove
	variable.
	(test-xfail-ISO99/complex.h/linknamespace): Likewise.
	(test-xfail-ISO99/math.h/linknamespace): Likewise.
	(test-xfail-ISO99/tgmath.h/linknamespace): Likewise.
	(test-xfail-ISO11/complex.h/linknamespace): Likewise.
	(test-xfail-ISO11/math.h/linknamespace): Likewise.
	(test-xfail-ISO11/tgmath.h/linknamespace): Likewise.
	(test-xfail-XPG3/math.h/linknamespace): Likewise.
	(test-xfail-XPG4/math.h/linknamespace): Likewise.
	(test-xfail-POSIX/math.h/linknamespace): Likewise.
	(test-xfail-UNIX98/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/tgmath.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/complex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/math.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/tgmath.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/tgmath.h/linknamespace): Likewise.
2014-11-18 15:40:56 +00:00
Richard Henderson
4886f34179 alpha: Fix soft-fp breakage
Commit 5c0508a318 broke the Alpha
port, as the extra parenthesis got in the way of some token pasting
that we were doing in a redefined raw unpack macro.

Avoid this situation in the future by not attempting to redefine a
basic macro, but rather work from the outermost public interface.
The compiler does in fact see through the added indirection.

	* sysdeps/alpha/soft-fp/local-soft-fp.h (_FP_UNPACK_RAW_2): Remove.
	(_FP_PACK_RAW_2): Remove.
	(AXP_DECL_RETURN_Q): Rename from FP_DECL_RETURN, use _FP_UNION_Q.
	(AXP_RETURN_Q): Rename from FP_RETURN, use _FP_UNION_Q.
	(AXP_UNPACK_RAW_Q, AXP_UNPACK_SEMIRAW_Q, AXP_UNPACK_Q): New.
	(AXP_PACK_RAW_Q, AXP_PACK_SEMIRAW_Q, AXP_PACK_Q): New.
	* sysdeps/alpha/soft-fp/ots_add.c (_OtsAddX): Update to match.
	* sysdeps/alpha/soft-fp/ots_cmp.c (internal_equality): Likewise.
	* sysdeps/alpha/soft-fp/ots_cmpe.c (internal_compare): Likewise.
	* sysdeps/alpha/soft-fp/ots_cvtqux.c (_OtsCvtQUX): Likewise.
	* sysdeps/alpha/soft-fp/ots_cvtqx.c (_OtsCvtQX): Likewise.
	* sysdeps/alpha/soft-fp/ots_cvttx.c (_OtsConvertFloatTX): Likewise.
	* sysdeps/alpha/soft-fp/ots_cvtxq.c (_OtsCvtXQ): Likewise.
	* sysdeps/alpha/soft-fp/ots_cvtxt.c (_OtsConvertFloatXT): Likewise.
	* sysdeps/alpha/soft-fp/ots_div.c (_OtsDivX): Likewise.
	* sysdeps/alpha/soft-fp/ots_mul.c (_OtsMulX): Likewise.
	* sysdeps/alpha/soft-fp/ots_nintxq.c (_OtsNintXQ): Likewise.
	* sysdeps/alpha/soft-fp/ots_sub.c (_OtsSubX): Likewise.
2014-11-17 09:20:02 -08:00
Roland McGrath
0781a7772a Remove sigvec. 2014-11-14 11:06:08 -08:00
Joseph Myers
5ae4fe60e6 Remove x86_64 __GNUC_PREREQ (4, 6) conditional.
This patch removes a conditional on __GNUC_PREREQ (4, 6) in x86_64
code.

Tested for x86_64 that installed shared libraries are unchanged by
this patch.  Committed (I think this file reasonably comes under math
maintainership).

	* sysdeps/x86_64/fpu/dla.h [__FMA4__ && __GNUC_PREREQ (4, 6)]
	(DLA_FMS): Make definition conditional only on [__FMA4__].
	[__FMA4__ && !__GNUC_PREREQ (4, 6)] (DLA_FMS): Remove conditional
	definition.
2014-11-14 18:53:07 +00:00
Joseph Myers
6a0dd472f4 Remove ARM __GNUC_PREREQ(4,4) conditionals.
This patch removes conditionals in ARM code on __GNUC_PREREQ(4,4),
which were already obsolete even before the move from 4.4 to 4.6 as
minimum GCC version for building glibc.

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

	* sysdeps/arm/sysdep.h [PROF && __GNUC_PREREQ(4,4)] (CALL_MCOUNT):
	Make definition conditional only on [PROF].
	[PROF && !__GNUC_PREREQ(4,4)] (CALL_MCOUNT): Remove conditional
	definition.
	[__GNUC_PREREQ(4,4)] (mcount): Make definition unconditional.
	[!__GNUC_PREREQ(4,4)] (mcount): Remove conditional definition.
2014-11-14 18:39:33 +00:00
David S. Miller
cf7246ddf5 Fix sparc build.
* sysdeps/sparc/sparc64/rtld-memcpy.c (NO_MEMPCPY_STPCPY_REDIRECT):
	Define before including <string/memcpy.c> and <string/mempcpy.c>.
2014-11-14 10:32:52 -08:00
Joseph Myers
c1b0aadcdf Fix build of C mempcpy and stpcpy.
This patch fixes the build of C mempcpy and stpcpy by disabling the
redirection to __mempcpy and __stpcpy asm names if
NO_MEMPCPY_STPCPY_REDIRECT is defined, and defining that macro in the
relevant source files.

Tested for powerpc32 that the build is fixed.

	* include/string.h [NO_MEMPCPY_STPCPY_REDIRECT] (mempcpy): Do not
	redeclare with asm name.
	[NO_MEMPCPY_STPCPY_REDIRECT] (stpcpy): Likewise.
	* string/mempcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Define before
	including <string.h>.
	* string/stpcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
	* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
	[!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
	[!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
	[SHARED && !NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise.
2014-11-14 13:48:39 +00:00
Stefan Liebler
20ed0d266f S/390: dl-machine.h: Use numbered labels in inline assembly. 2014-11-13 10:45:28 +01:00
Stefan Liebler
53244a4e12 S/390: Add SystemTap probes to longjmp and setjmp. 2014-11-13 10:44:42 +01:00
Stefan Liebler
47df8251e8 S/390: Get rid of warning unused variable in dl-machine.h. 2014-11-13 10:44:11 +01:00
Stefan Liebler
618cebeff8 S/390: Get rid of warning: the comparision will always evaluate as false. 2014-11-13 10:43:24 +01:00
Joseph Myers
c4eae75271 Fix __get_nprocs fgets_unlocked namespace (bug 17582).
__get_nprocs is called from malloc code, but calls fgets_unlocked,
which is not an ISO C or POSIX function.  This patch fixes it to call
a new __fgets_unlocked name instead.

Note: there are various other uses of fgets_unlocked in glibc's
libraries, and I haven't yet investigated which others might also be
problematic (called directly or indirectly from standard functions)
and so need to change to use __fgets_unlocked.

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

	[BZ #17582]
	* libio/iofgets.c [weak_alias && !_IO_MTSAFE_IO]
	(__fgets_unlocked): Add alias of _IO_fgets.  Use libc_hidden_def.
	* libio/iofgets_u.c (fgets_unlocked): Rename to __fgets_unlocked
	and define as weak alias of __fgets_unlocked.  Use
	libc_hidden_weak.
	(__fgets_unlocked): Use libc_hidden_def.
	* include/stdio.h (__fgets_unlocked): Declare.  Use
	libc_hidden_proto.
	* sysdeps/unix/sysv/linux/getsysstats.c (phys_pages_info): Use
	__fgets_unlocked instead of fgets_unlocked.
	* sysdeps/unix/sysv/linux/alpha/getsysstats.c
	(GET_NPROCS_CONF_PARSER): Likewise.
	* sysdeps/unix/sysv/linux/sparc/getsysstats.c
	(GET_NPROCS_CONF_PARSER): Likewise.
2014-11-12 22:39:36 +00:00
Joseph Myers
293d9a4180 Fix x86_64 rawmemchr namespace (bug 17572).
rawmemchr is not an ISO C function, but __rawmemchr is called from ISO
C functions, so rawmemchr should be a weak alias.  On most
architecture it is, but x86_64 defines the function as rawmemchr with
__rawmemchr as a strong alias.  This patch makes x86_64 follow the
same arrangements as other architectures.

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

	[BZ #17572]
	* sysdeps/x86_64/rawmemchr.S (rawmemchr): Rename to __rawmemchr
	and define as weak alias of __rawmemchr.
	(__rawmemchr): Do not define as strong alias of rawmemchr.
2014-11-12 22:35:12 +00:00
Joseph Myers
bef8fd6013 Fix qsort_r namespace (bug 17571).
qsort_r is defined in the same file as qsort, but is not an ISO C
function, so should be a weak alias for __qsort_r.  The uses in
getaddrinfo should also call __qsort_r, since getaddrinfo is a POSIX
function and qsort_r isn't.  This patch implements this.  Because nscd
uses the getaddrinfo sources outside libc, as do the tst-rfc3484
tests, a #define of __qsort_r to qsort_r is added there alongside the
similar defines for other libc-internal symbols used in getaddrinfo.

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

	[BZ #17571]
	* stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak
	alias of __qsort_r.
	(qsort): Call __qsort_r instead of qsort_r.
	* include/stdlib.h (qsort_r): Do not call libc_hidden_proto.
	(__qsort_r): Declare.  Call libc_hidden_proto.
	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r
	instead of qsort_r.
	* nscd/gai.c (__qsort_r): Define to qsort_r.
	* posix/tst-rfc3484.c (__qsort_r): Likewise.
	* posix/tst-rfc3484-2.c (__qsort_r): Likewise.
	* posix/tst-rfc3484-3.c (__qsort_r): Likewise.
2014-11-12 22:33:41 +00:00
Joseph Myers
2f5c1b000a Fix __getcwd rewinddir namespace (bug 17584).
__getcwd is called from dcigettext.o (brought in by various ISO C
functionality), but calls rewinddir, which is not an ISO C function.
This patch makes __getcwd call __rewinddir instead and makes rewinddir
a weak alias for __rewinddir.

Since getcwd.c is shared with gnulib (albeit not merged in either
direction for a long time, and omitted from gnulib's
config/srclist.txt list of shared files) I put in a #ifndef _LIBC
define of __rewinddir to rewinddir, although a future merged version
of getcwd could end up looking significantly different.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17584]
	* dirent/rewinddir.c (rewinddir): Rename to __rewinddir and define
	as weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* sysdeps/mach/hurd/rewinddir.c: Rename to __rewinddir and define
	as weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* sysdeps/posix/rewinddir.c: Rename to __rewinddir and define as
	weak alias of __rewinddir.  Don't use libc_hidden_def.
	(__rewinddir): Use libc_hidden_def.
	* include/dirent.h (rewinddir): Don't use libc_hidden_proto.
	(__rewinddir): Use libc_hidden_proto.
	* sysdeps/posix/getcwd.c [!_LIBC] (__rewinddir): Define to
	rewinddir.
	(__getcwd): Use __rewinddir instead of rewinddir.
2014-11-12 16:24:16 +00:00
Siddhesh Poyarekar
2581b98ecb Use GOT instead of GOT12 all over
GOT12 is a synonym for GOT, so just use GOT everywhere for
consistency.  Generated code is unchanged on s390.
2014-11-12 19:43:04 +05:30
Siddhesh Poyarekar
533bb7c2ae Fix stack alignment when loader is invoked directly
The s390 ABI requires the stack pointer to be aligned at 8-bytes.
When a program is invoked as an argument to the dynamic linker,
_dl_start_user adjusts the stack to remove the dynamic linker
arguments so that the program sees only its name and arguments.  This
may result in the stack being misaligned since each argument shift is
only a word and not a double-word.

This is now fixed shifting argv and envp down instead of shifting argc
up and reclaiming the stack.  This requires _dl_argv to be adjusted
and hence, is no longer relro.
2014-11-12 19:42:59 +05:30
Alan Hayward
5c40c3bab2 [AArch64] Add ipc.h.
Adding ipc.h for AArch64 adjusted to behave correctly on big endian
targets.
2014-11-11 16:32:34 +00:00
Renlin Li
80085defb8 [AArch64] End frame record chain correctly. 2014-11-11 15:02:02 +00:00
Andreas Schwab
1400983e04 m68k: don't expect PLT reference to __tls_get_addr 2014-11-07 17:39:55 +01:00
Joseph Myers
2c46a66a3a Remove __libc_waitpid function name.
Continuing the removal of unused __libc_* function names, this patch
removes the __libc_waitpid name.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch; __waitpid, which is exported from
shared libc, changes from weak to strong on some configurations, which
is of no significance).

	* include/sys/wait.h (__libc_waitpid): Remove declaration.
	* posix/waitpid.c (__libc_waitpid): Rename to __waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
	* sysdeps/unix/bsd/waitpid.c (__libc_waitpid): Rename to
	__waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (waitpid): Remove
	__libc_waitpid alias.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/syscalls.list (waitpid):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/tile/waitpid.S (__libc_waitpid): Remove
	alias.
	* sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Rename to
	__waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
2014-11-07 01:27:16 +00:00
Carlos O'Donell
da53d6dbc2 Run check-localpltk/textrel/execstack over ld.so.
For maximum paranoia we run ld.so through the normal set
of tests for all of the shared libraries. This includes
running ld.so through check-localplt, check-textrel, and
check-execstack. While none of these should trigger any
failures given the way ld.so is built, it might possibly
fail if a developer does something wrong. This paranoia
was triggered by a discussion over the use of __strcpy
vs. strcpy [1] and if the symbol could leak and use the
libc.so version.

The check-localplt test fails right away because localplt.data
needs updating for all arches. By default we add 6 new symbols:
__tls_get_addr, __libc_memalign, malloc, calloc, realloc and
free. Other machines like i386, power, and s390 require some
different symbol sets e.g. ___tls_get_addr vs. __tls_get_addr
for i386.

Verified for i386
Verified for x86_64
Verified for ppc32
Verified for ppc64
Verified for ppc64le
Verified for arm
Verified for aarch64
Verified for s390
Verified for s390x
Guessed for alpha
Guessed for ia64
Guessed for m68k
Guessed for microblaze
Guessed for sparc32
Guessed for sparc64
Defaults for sh
Defaults for mips
Defaults for hppa
Defaults for tile

Machine manintainers notified to double check the data
used in localplt.data.

[1] https://sourceware.org/ml/libc-alpha/2014-10/msg00548.html
2014-11-06 15:48:44 -05:00
Joseph Myers
9cf27b8d09 Remove INTDEF / INTUSE / INTVARDEF (bug 14132).
Completing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch removes the final use - that for _dl_starting_up - replacing it
by rtld_hidden_def / rtld_hidden_proto.  Having removed the last use,
the mechanism itself is also removed.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.  (This is not much of a test since this
variable is only defined and used in the !HAVE_INLINED_SYSCALLS case.)

	[BZ #14132]
	* include/libc-symbols.h (INTUSE): Remove macro.
	(INTDEF): Likewise.
	(INTVARDEF): Likewise.
	(_INTVARDEF): Likewise.
	(INTDEF2): Likewise.
	(INTVARDEF2): Likewise.
	* elf/rtld.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Use
	rtld_hidden_def instead of INTVARDEF.
	* sysdeps/generic/ldsodefs.h [IS_IN_rtld]
	(_dl_starting_up_internal): Remove declaration.
	(_dl_starting_up): Use rtld_hidden_proto.
	* elf/dl-init.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Remove
	declaration.
	[!HAVE_INLINED_SYSCALLS] (_dl_starting_up_internal): Likewise.
	(_dl_init) [!HAVE_INLINED_SYSCALLS]: Don't use INTUSE with
	_dl_starting_up.
	* elf/dl-writev.h (_dl_writev): Likewise.
	* sysdeps/powerpc/powerpc64/dl-machine.h [!HAVE_INLINED_SYSCALLS]
	(DL_STARTING_UP_DEF): Use __GI__dl_starting_up instead of
	_dl_starting_up_internal.
2014-11-05 23:35:36 +00:00
Richard Earnshaw
be9d4ccc7f [AArch64] Add optimized strchrnul.
Here is an optimized implementation of __strchrnul.  The
simplification that we don't have to track precisely why the loop
terminates (match or end-of-string) means we have to do less work in
both setup and the core inner loop.  That means this should never be
slower than strchr.

As with strchr, the use of LD1 means we do not need different versions
for big-/little-endian.
2014-11-05 13:51:56 +00:00
Adhemerval Zanella
7110166d4f powerpc: Simplify encoding of POWER8 instruction 2014-11-05 08:01:09 -05:00
Arjun Shankar
29955b5d96 Modify several tests to use test-skeleton.c
This patch modifies several test cases to use test-skeleton.c.
It was generated by a bash script written for this purpose and
thus excludes several other tests which I deemed worth a visual
inspection before making the change.

I intend to follow up with individual patches to the tests
skipped by the script.

The script itself resides at http://git.io/WODAmg and should
reproduce this very patch when run against master.

ChangeLog:

2014-10-30  Arjun Shankar  <arjun.is@lostca.se>

	* catgets/test-gencat.c: Use test-skeleton.c.
	* catgets/tst-catgets.c: Likewise.
	* csu/tst-empty.c: Likewise.
	* elf/tst-audit2.c: Likewise.
	* elf/tst-global1.c: Likewise.
	* elf/tst-pathopt.c: Likewise.
	* elf/tst-piemod1.c: Likewise.
	* elf/tst-tls10.c: Likewise.
	* elf/tst-tls11.c: Likewise.
	* elf/tst-tls12.c: Likewise.
	* gnulib/tst-gcc.c: Likewise.
	* iconvdata/tst-e2big.c: Likewise.
	* iconvdata/tst-loading.c: Likewise.
	* iconv/tst-iconv1.c: Likewise.
	* iconv/tst-iconv2.c: Likewise.
	* inet/test-inet6_opt.c: Likewise.
	* inet/tst-gethnm.c: Likewise.
	* inet/tst-network.c: Likewise.
	* inet/tst-ntoa.c: Likewise.
	* intl/tst-codeset.c: Likewise.
	* intl/tst-gettext2.c: Likewise.
	* intl/tst-gettext3.c: Likewise.
	* intl/tst-ngettext.c: Likewise.
	* intl/tst-translit.c: Likewise.
	* io/test-stat.c: Likewise.
	* libio/test-fmemopen.c: Likewise.
	* libio/tst-freopen.c: Likewise.
	* libio/tst-sscanf.c: Likewise.
	* libio/tst-ungetwc1.c: Likewise.
	* libio/tst-ungetwc2.c: Likewise.
	* libio/tst-widetext.c: Likewise.
	* localedata/tst-ctype.c: Likewise.
	* localedata/tst-digits.c: Likewise.
	* localedata/tst-leaks.c: Likewise.
	* localedata/tst-mbswcs1.c: Likewise.
	* localedata/tst-mbswcs2.c: Likewise.
	* localedata/tst-mbswcs3.c: Likewise.
	* localedata/tst-mbswcs4.c: Likewise.
	* localedata/tst-mbswcs5.c: Likewise.
	* localedata/tst-setlocale.c: Likewise.
	* localedata/tst-trans.c: Likewise.
	* localedata/tst-wctype.c: Likewise.
	* localedata/tst-xlocale1.c: Likewise.
	* login/tst-grantpt.c: Likewise.
	* malloc/tst-calloc.c: Likewise.
	* malloc/tst-malloc.c: Likewise.
	* malloc/tst-mallocstate.c: Likewise.
	* malloc/tst-mcheck.c: Likewise.
	* malloc/tst-mtrace.c: Likewise.
	* malloc/tst-obstack.c: Likewise.
	* math/atest-exp2.c: Likewise.
	* math/atest-exp.c: Likewise.
	* math/atest-sincos.c: Likewise.
	* math/test-matherr.c: Likewise.
	* math/test-misc.c: Likewise.
	* math/test-powl.c: Likewise.
	* math/tst-definitions.c: Likewise.
	* misc/tst-dirname.c: Likewise.
	* misc/tst-efgcvt.c: Likewise.
	* misc/tst-fdset.c: Likewise.
	* misc/tst-hsearch.c: Likewise.
	* misc/tst-mntent2.c: Likewise.
	* nptl/tst-sem7.c: Likewise.
	* nptl/tst-sem8.c: Likewise.
	* nptl/tst-sem9.c: Likewise.
	* nss/test-netdb.c: Likewise.
	* posix/tst-fnmatch.c: Likewise.
	* posix/tst-getlogin.c: Likewise.
	* posix/tst-gnuglob.c: Likewise.
	* posix/tst-mmap.c: Likewise.
	* pwd/tst-getpw.c: Likewise.
	* resolv/tst-inet_ntop.c: Likewise.
	* rt/tst-timer.c: Likewise.
	* stdio-common/test-fseek.c: Likewise.
	* stdio-common/test-popen.c: Likewise.
	* stdio-common/test-vfprintf.c: Likewise.
	* stdio-common/tst-cookie.c: Likewise.
	* stdio-common/tst-fileno.c: Likewise.
	* stdio-common/tst-gets.c: Likewise.
	* stdio-common/tst-obprintf.c: Likewise.
	* stdio-common/tst-perror.c: Likewise.
	* stdio-common/tst-sprintf2.c: Likewise.
	* stdio-common/tst-sprintf3.c: Likewise.
	* stdio-common/tst-sprintf.c: Likewise.
	* stdio-common/tst-swprintf.c: Likewise.
	* stdio-common/tst-tmpnam.c: Likewise.
	* stdio-common/tst-unbputc.c: Likewise.
	* stdio-common/tst-wc-printf.c: Likewise.
	* stdlib/tst-environ.c: Likewise.
	* stdlib/tst-fmtmsg.c: Likewise.
	* stdlib/tst-limits.c: Likewise.
	* stdlib/tst-rand48-2.c: Likewise.
	* stdlib/tst-rand48.c: Likewise.
	* stdlib/tst-random2.c: Likewise.
	* stdlib/tst-random.c: Likewise.
	* stdlib/tst-strtol.c: Likewise.
	* stdlib/tst-strtoll.c: Likewise.
	* stdlib/tst-tls-atexit.c: Likewise.
	* stdlib/tst-xpg-basename.c: Likewise.
	* string/test-ffs.c: Likewise.
	* string/tst-bswap.c: Likewise.
	* string/tst-inlcall.c: Likewise.
	* string/tst-strtok.c: Likewise.
	* string/tst-strxfrm.c: Likewise.
	* sysdeps/x86_64/tst-audit10.c: Likewise.
	* sysdeps/x86_64/tst-audit3.c: Likewise.
	* sysdeps/x86_64/tst-audit4.c: Likewise.
	* sysdeps/x86_64/tst-audit5.c: Likewise.
	* time/tst-ftime_l.c: Likewise.
	* time/tst-getdate.c: Likewise.
	* time/tst-mktime3.c: Likewise.
	* time/tst-mktime.c: Likewise.
	* time/tst-posixtz.c: Likewise.
	* time/tst-strptime2.c: Likewise.
	* time/tst-strptime3.c: Likewise.
	* wcsmbs/tst-btowc.c: Likewise.
	* wcsmbs/tst-mbrtowc.c: Likewise.
	* wcsmbs/tst-mbsrtowcs.c: Likewise.
	* wcsmbs/tst-wchar-h.c: Likewise.
	* wcsmbs/tst-wcpncpy.c: Likewise.
	* wcsmbs/tst-wcrtomb.c: Likewise.
	* wcsmbs/tst-wcsnlen.c: Likewise.
	* wcsmbs/tst-wcstof.c: Likewise.
2014-11-05 15:24:08 +05:30
Joseph Myers
ab97ee8f1b Don't use INTDEF/INTUSE with _dl_mcount (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch replaces its use for _dl_mcount with use of rtld_hidden_def /
rtld_hidden_proto.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* elf/dl-profile.c (_dl_mcount): Use rtld_hidden_def instead of
	INTDEF.
	* sysdeps/generic/ldsodefs.h (_dl_mcount_internal): Remove
	declaration.
	(_dl_mcount): Use rtld_hidden_proto.
	* elf/dl-runtime.c (_dl_profile_fixup): Don't use INTUSE with
	_dl_mcount.
	* elf/rtld.c (_rtld_global_ro): Likewise.
2014-11-05 01:02:47 +00:00
Joseph Myers
c5684fdb2b Don't use INTDEF/INTUSE with _dl_init (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch eliminates its use for _dl_init.  Since _dl_init was already
declared with hidden visibility, creating a second hidden alias for it
was completely pointless, so this patch replaces all uses of
_dl_init_internal with plain _dl_init instead of using hidden_proto /
hidden_def (which are only needed when you want a hidden alias for a
non-hidden symbol; it's quite possible there are cases where they are
used but don't need to be because the symbol in question is not part
of the public ABI and is only used within a single library, so using
attributes_hidden instead would suffice).

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* elf/dl-init.c (_dl_init): Don't use INTDEF.
	* sysdeps/aarch64/dl-machine.h (RTLD_START): Use _dl_init instead
	of _dl_init_internal.
	* sysdeps/alpha/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/arm/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/hppa/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/i386/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/ia64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/m68k/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/microblaze/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/mips/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/powerpc/powerpc32/dl-start.S (_start): Likewise.
	* sysdeps/s390/s390-32/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/s390/s390-64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/sh/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/sparc/sparc32/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/sparc/sparc64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/tile/dl-start.S (_start): Likewise.
	* sysdeps/x86_64/dl-machine.h (RTLD_START): Likewise.
	* sysdeps/x86_64/x32/dl-machine.h (RTLD_START): Likewise.
2014-11-04 23:26:39 +00:00
Joseph Myers
4243cbea6d Don't use INTDEF/INTUSE with _dl_argv (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch replaces its use for _dl_argv with rtld_hidden_data_def and
rtld_hidden_proto.  Some places in .S files that previously used
_dl_argv_internal or INTUSE(_dl_argv) now use __GI__dl_argv directly
(there are plenty of existing examples of such direct use of __GI_*).

A single place in rtld.c previously used _dl_argv without INTUSE,
apparently accidentally, while the rtld_hidden_proto mechanism avoids
such accidential omissions.  As a consequence, this patch *does*
change the contents of stripped ld.so.  However, the installed
stripped shared libraries are identical to those you get if instead of
this patch you change that single _dl_argv use to use INTUSE, without
any other changes.

Tested for x86_64 (testsuite as well as comparison of installed
stripped shared libraries as described above).

	[BZ #14132]
	* sysdeps/generic/ldsodefs.h (_dl_argv): Use rtld_hidden_proto.
	[IS_IN_rtld] (_dl_argv_internal): Do not declare.
	(rtld_progname): Make macro definition unconditional.
	* elf/rtld.c (_dl_argv): Use rtld_hidden_data_def instead of
	INTDEF.
	(dlmopen_doit): Do not use INTUSE with _dl_argv.
	(dl_main): Likewise.
	* elf/dl-sysdep.c (_dl_sysdep_start): Likewise.
	* sysdeps/alpha/dl-machine.h (RTLD_START): Use __GI__dl_argv
	instead of _dl_argv_internal.
	* sysdeps/powerpc/powerpc32/dl-start.S (_dl_start_user): Use
	__GI__dl_argv instead of INTUSE(_dl_argv).
	* sysdeps/powerpc/powerpc64/dl-machine.h (RTLD_START): Use
	__GI__dl_argv instead of _dl_argv_internal.
2014-11-04 17:39:39 +00:00
Adhemerval Zanella
5e4df2848d powerpc: Fix encoding of POWER8 instruction
This patch adds a binary encoding for 'mtvsrd' instruction to avoid
build failures when assembler does not support POWER8.
2014-11-03 07:26:33 -05:00
Jose E. Marchesi
4c6da7da9f Fix sparc struct fpu definition.
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h (struct fpu): fix
	the size of the fpu_fr.fpu_dregs[] array.
2014-11-01 13:45:02 -07:00
Joseph Myers
1679ba8eb6 Remove __libc_nanosleep function name.
Continuing the removal of unused __libc_* function names, this patch
removes the __libc_nanosleep name.

Tested for x86_64 (testsuite, and that the disassembly of installed
shared libraries is unchanged by the patch; __nanosleep changes from
weak to strong, which is of no significance).

	* posix/nanosleep.c (__libc_nanosleep): Rename to __nanosleep.
	(__nanosleep): Do not define as alias.
	(nanosleep): Define as alias of __nanosleep.
	* sysdeps/unix/sysv/linux/syscalls.list (nanosleep): Remove
	__libc_nanosleep name.
2014-11-01 12:26:09 +00:00
Torvald Riegel
7f981fc24a powerpc: Change atomic_write_barrier to have release semantics. 2014-10-31 23:26:22 +01:00
Joseph Myers
f62ff28683 Remove __libc_pselect alias.
Continuing the removal of unused __libc_* function names, this patch
removes the __libc_pselect alias.

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

	* misc/pselect.c [!__pselect] (__libc_pselect): Remove alias.
	* sysdeps/unix/sysv/linux/pselect.c [__NR_pselect6]
	(__libc_pselect): Likewise.
2014-10-31 21:22:35 +00:00
Joseph Myers
94a4245525 Move powerpc64 pread/pwrite definitions to syscalls.list (bug 14138).
Concluding the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch removes C definitions of pread, pread64, pwrite and
pwrite64 for powerpc64.  As far as I can tell, the existing
syscalls.list definitions in
sysdeps/unix/sysv/linux/wordsize-64/syscalls.list should suffice to
produce results equivalent to what these C files do.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: Remove file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: Likewise.
2014-10-31 21:13:32 +00:00
Torvald Riegel
ff9dbdc048 Fix SPARC atomic_write_barrier. 2014-10-31 12:00:38 +01:00
Joseph Myers
e19c95fd5e Remove __libc_readv and __libc_writev function names.
Continuing the removal of __libc_* function names that are no longer
used anywhere, this patch removes the __libc_readv and __libc_writev
names.

Tested for x86_64 that stripped installed shared libraries are
unchanged by the patch.

	* include/sys/uio.h (__libc_readv): Remove declaration.
	(__libc_writev): Likewise.
	* misc/readv.c (__libc_readv): Rename to __readv.
	(__readv): Do not define as alias.
	(readv): Define as alias of __readv.
	* misc/writev.c (__libc_writev): Rename to __writev.
	(__writev): Do not define as alias.
	(writev): Define as alias of __writev.
	* sysdeps/posix/readv.c (__libc_readv): Rename to __readv.
	(__readv): Do not define as alias.
	(readv): Define unconditionally as alias of __readv.
	* sysdeps/posix/writev.c (__libc_writev): Rename to __writev.
	(__writev): Do not define as alias.
	(writev): Define unconditionally as alias of __writev.
	* sysdeps/unix/syscalls.list (readv): Do not define __libc_readv
	name.
	(writev): Do not define __libc_writev name.
2014-10-30 20:56:34 +00:00
Joseph Myers
d4e157aaae Remove __libc_creat function name.
glibc has lots of __libc_* function names that no longer serve any
purpose (are not used for any calls or exported at a public symbol
version).  This patch removes __libc_creat.  It has the effect of
creat becoming a strong symbol instead of a weak symbol in various
cases, but that's fine; in shared libraries it doesn't matter at all,
while for static linking the only other symbol sometimes defined in
the same object is creat64, and whenever creat64 is a reserved name so
is creat.

Other such cases of unnecessary __libc_* symbols are expected to be
dealt with in separate patches over time.

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

	* include/fcntl.h (__libc_creat): Remove declaration.
	* io/creat.c (__libc_creat): Rename to creat.
	(creat): Do not define as alias.
	* sysdeps/unix/sysv/linux/alpha/creat.c (creat64): Define as alias
	of creat instead of __libc_creat.
	* sysdeps/unix/sysv/linux/generic/creat.c (__libc_creat): Rename
	to creat.
	(creat): Do not define as alias.
	[__WORDSIZE == 64] (creat64): Define as alias of creat instead of
	__libc_creat.
	* sysdeps/unix/sysv/linux/syscalls.list (creat): Do not define
	__libc_creat name.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (creat):
	Likewise.
2014-10-30 19:44:31 +00:00
Joseph Myers
51e623f241 Don't use INTDEF/INTUSE in unwind-dw2-fde.c (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch replaces its use in unwind-dw2-fde.c with hidden_def and
hidden_proto.

Tested for x86.  This patch does result in code generation differences
(for some reason GCC decides to partition __register_frame_info_bases
after the patch).

	[BZ #14132]
	* sysdeps/generic/unwind-dw2-fde.c
	(__register_frame_info_bases_internal): Do not declare.
	(__register_frame_info_table_bases_internal): Likewise.
	(__deregister_frame_info_bases_internal): Likewise.
	(__register_frame_info_bases): Declare and use hidden_proto before
	definition.  Use hidden_def instead of INTDEF.
	(__register_frame_info_table_bases): Likewise.
	(__deregister_frame_info_bases): Likewise.
	(__register_frame_info): Do not use INTUSE.
	(__register_frame): Likewise.
	(__register_frame_info_table): Likewise.
	(__register_frame_table): Likewise.
	(__deregister_frame_info): Likewise.
	(__deregister_frame): Likewise.
2014-10-28 17:12:57 +00:00
Gratian Crisan
03d41216fe arm: Re-enable PI futex support for ARM kernels >= 3.14.3
ARM linux kernels before 3.14.3 may or may not support
futex_atomic_cmpxchg_inatomic depending on the kernel configuration (e.g.
CONFIG_CPU_USE_DOMAINS && CONFIG_SMP configuration was not supported)

Starting with 3.14.3 the linux kernel unconditionally enables support for
ARM, and this re-enables the relevant __ASSUME_* macros.

Tested on ARM both with kernels >= 3.14.3 and older kernels.

	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_FUTEX_LOCK_PI): Do
	not undefine.
	[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_REQUEUE_PI):
	Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_SET_ROBUST_LIST):
	Likewise.
2014-10-27 22:45:43 +00:00
Joseph Myers
a4b3624d20 Move setfsgid/setfsuid definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of setfsgid and setfsuid.

Tested for x86.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/arm/setfsgid.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (setfsgid): Add
	syscall.
	(setfsuid): Likewise.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (setfsgid): Likewise.
	(setfsuid): Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (setfsgid): Likewise.
	(setfsuid): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (setfsgid):
	Likewise.
	(setfsuid): Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (setfsgid): Likewise.
	(setfsuid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (setfsgid):
	Likewise.
	(setfsuid): Likewise.
2014-10-27 12:24:42 +00:00
Andreas Schwab
3574f2fdf3 Fix misdetected Slow_SSE4_2 cpu feature bit (bug 17501) 2014-10-27 10:44:28 +01:00
Wilco Dijkstra
6a9ad2faee Call libc_fetestexcept_aarch64 from math_private.h rather than duplicating functionality. 2014-10-24 13:23:12 +00:00
Wilco Dijkstra
1c8810ed95 Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating functionality. 2014-10-24 13:21:27 +00:00
Wilco Dijkstra
8b1af712d1 Call get_rounding_mode rather than duplicating functionality. 2014-10-24 13:19:24 +00:00
Wilco Dijkstra
a7b00c1101 Cleanup feenableexcept to use the same logic as the ARM version. No functional changes. 2014-10-24 13:07:17 +00:00
Wilco Dijkstra
3a84f1a651 Cleanup fedisableexcept to use the same logic as the ARM version. No functional changes. 2014-10-24 13:06:04 +00:00
Wilco Dijkstra
ea9a7c8b06 Cleanup feclearexcept to use the same logic as the ARM version. No functional changes. 2014-10-24 13:03:11 +00:00
Wilco Dijkstra
e226de3372 Cleanup fesetexceptflag to use the same logic as the ARM version. No functional changes. 2014-10-24 13:03:09 +00:00
Wilco Dijkstra
6e3d8ed360 Remove an unused include. 2014-10-24 13:03:08 +00:00
Joseph Myers
c8bc40386a Move get*id and getgroups definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of get*id functions and
getgroups.  The previous C definitions were because of the transition
to 32-bit uids and gids.

Tested for x86.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/arm/getegid.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getegid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (getegid): Add
	syscall.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (getegid): Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (getegid): Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (getegid):
	Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (getegid): Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getresgid): Likewise.
	(getresuid): Likewise.
	(getgroups): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (getegid):
	Likewise.
	(geteuid): Likewise.
	(getgid): Likewise.
	(getuid): Likewise.
	(getgroups): Likewise.
2014-10-24 13:01:17 +00:00
Joseph Myers
48eb7a94e2 Move some chown / lchown / fchown definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of chown, lchown and fchown.

In most cases the need for special syscalls.list entries (rather than
existing generic ones) is because these architectures use chown32,
lchown32 and fchown32 as syscall names.  Some architectures also have
symbol versioning compatibility for older versions of chown having
been equivalent to lchown.

The aliases specified for s390-32 had the effect of exporting
__chown@@GLIBC_2.1 (but not __chown@GLIBC_2.0) despite it not being
listed in Versions files.  (I'm not sure why versioned_symbol but not
compat_symbol were effective like that to create such __chown exports
in the absence of Versions entries.)  The natural way to preserve that
versioned export of __chown seems to be to add it in a Versions file,
so I did so.  (Maybe actually it should be a compat symbol,
__chown@GLIBC_2.1, unless there's a good reason for that export, but
this patch doesn't change anything there.)

Tested for x86.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/i386/chown.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/fchown.c: Remove file.
	* sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/Versions (GLIBC_2.1): Add
	__chown.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (chown): Add syscall.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (chown):
	Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (chown): Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (chown):
	Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
2014-10-24 12:59:23 +00:00
Wilco Dijkstra
eb04247d5d Remove spaces. 2014-10-24 12:53:19 +00:00
Carlos O'Donell
13d845549e hppa: Make __SIGRTMIN 32 (ABI break).
In the Linux kernel version 3.17 the signal numbers were rearranged in
order to make hppa like every other arch. Previously we started
__SIGRTMIN at 37, and that meant several pieces of important software,
including systemd, would fail to build. To support systemd we removed
SIGEMT and SIGLOST, and rearranged the others according to expected
values. This is technically an ABI incompatible change, but because
zero applications use SIGSTKFLT, SIGXCPU, SIGXFSZ and SIGSYS nothing
broke.  Nothing uses SIGEMT and SIGLOST, and they were present for
HPUX compatibility which is no longer supported. Thus because nothing
breaks we don't do any compatibility work here.

Upstream kernel commit is 1f25df2eff5b25f52c139d3ff31bc883eee9a0ab.

Signed-off-by: Carlos O'Donell <carlos@systemhalted.org>
Signed-off-by: Helge Deller <deller@gmx.de>

2014-10-23  Carlos O'Donell  <carlos@systemhalted.org>
	    Helge Deller <deller@gmx.de>

	[BZ #17508]
	* sysdeps/unix/sysv/linux/hppa/bits/signum.h: Remove SIGEMT.
	Define SIGSTKFLT as 7. Define SIGSYS as 31. Define SIGXCPU as 12.
	Remove SIGLOST. Define SIGXFSZ as 30. Define __SIGRTMIN as 32.
2014-10-23 23:18:19 -04:00
Joseph Myers
15f9c5dfaf Don't use INTDEF for powerpc32 compat symbols (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch removes the use of INTUSE to rename symbols in
sysdeps/powerpc/powerpc32/libgcc-compat.S.  As the names in question
are purely internal to this particular object and not used anywhere
else, it doesn't matter at all whether __*_v_glibc20 or __*_internal
is used, so this patch just removes the macros in question.

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

	[BZ #14132]
	* sysdeps/powerpc/powerpc32/libgcc-compat.S (__ashldi3_v_glibc20):
	Remove macro definition.
	(__ashrdi3_v_glibc20): Likewise.
	(__lshrdi3_v_glibc20): Likewise.
	(__cmpdi2_v_glibc20): Likewise.
	(__ucmpdi2_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__fixdfdi_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__fixsfdi_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__fixunsdfdi_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__fixunssfdi_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__floatdidf_v_glibc20): Likewise.
	[!_SOFT_FLOAT && !__NO_FPRS__] (__floatdisf_v_glibc20): Likewise.
2014-10-23 21:43:41 +00:00
Roland McGrath
8c2b1ed8bb ARM: Use movw/movt more when available 2014-10-22 14:20:35 -07:00
Maciej W. Rozycki
b5af9297d5 MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
This satisfies a symbol reference created with:

	.symver	__libc_vfork, vfork@GLIBC_2.0

where `__libc_vfork' has not been defined or referenced.  In this case
the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a
bug present in GAS since forever causes an undefined symbol table entry
to be created.  This in turn triggers a problem in the linker that can
manifest itself by link errors such as:

ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr'

The GAS and linker bugs need to be resolved, but we can avoid them too
by providing a `__libc_vfork' definition just like our other platforms.

	[BZ #17485]
	* sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define.
2014-10-22 15:20:37 +01:00
Roland McGrath
ab49e7630f Make internal lock-init macros return void. 2014-10-20 14:13:14 -07:00
Torvald Riegel
f50277c19d pthread_once: Add fast path and remove x86 variants. 2014-10-20 20:28:08 +02:00
Torvald Riegel
63668b7084 pthread_once: Clean up constants.
[BZ #15215] This just gives a name to the integer constants being used.
2014-10-20 18:22:30 +02:00
Joseph Myers
42b7f5d485 Move readv and writev definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves definitions of readv and writev.

The relevant syscalls.list entries were already in
sysdeps/unix/syscalls.list, but to match the C files they needed to
have the names __libc_readv and __libc_writev added.  In fact, I don't
see anything making use of those names - as far as I can tell, these
functions could just be defined as __readv and __writev with aliases
readv and writev.  But cleaning up unnecessary aliases for functions
should be a separate matter from cleaning up unnecessary C syscall
wrappers.

Tested for x86_64.

	[BZ #14138]
	* sysdeps/unix/syscalls.list (readv): Use __libc_readv as strong
	name.
	(writev): Use __libc_writev as strong name.
	* sysdeps/unix/sysv/linux/readv.c: Remove file.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.
2014-10-20 15:49:08 +00:00
Roland McGrath
674b89786e NPTL: Clean up THREAD_SYSINFO macros. 2014-10-17 15:03:00 -07:00
Roland McGrath
ee54ce44cb Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
Siddhesh Poyarekar
fda389c8f0 Fix infinite loop in check_pf (BZ #12926)
The recvmsg could return 0 under some conditions and cause the
make_request function to be stuck in an infinite loop.

Thank you Jim King <jim.king@simplivity.com> for posting Paul's patch
on the list.
2014-10-14 21:05:33 +05:30
Joseph Myers
6bc6bd3b10 Don't use INTVARDEF/INTUSE with __libc_enable_secure (bug 14132).
Continuing the removal of the obsolete INTDEF / INTVARDEF / INTUSE
mechanism, this patch replaces its use for __libc_enable_secure with
the use of rtld_hidden_data_def and rtld_hidden_proto.

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

	[BZ #14132]
	* elf/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def
	instead of INTVARDEF.
	(_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure.
	* sysdeps/mach/hurd/dl-sysdep.c (__libc_enable_secure): Use
	rtld_hidden_data_def instead of INTVARDEF.
	(_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure.
	* elf/dl-deps.c (expand_dst): Likewise.
	* elf/dl-load.c (_dl_dst_count): Likewise.
	(_dl_dst_substitute): Likewise.
	(decompose_rpath): Likewise.
	(_dl_init_paths): Likewise.
	(open_path): Likewise.
	(_dl_map_object): Likewise.
	* elf/rtld.c (dl_main): Likewise.
	(process_dl_audit): Likewise.
	(process_envvars): Likewise.
	* include/unistd.h [IS_IN_rtld] (__libc_enable_secure_internal):
	Remove declaration.
	(__libc_enable_secure): Use rtld_hidden_proto.
2014-10-10 11:13:11 +00:00
Joseph Myers
5deeb19014 Remove stray *_internal aliases (bug 14132).
This patch removes some stray (unused) *_internal aliases, and
function prototypes with no corresponding definitions at all, at least
some of which were missed in previous INTDEF / INTUSE removal.

Not removed in this patch: __canonicalize_directory_name_internal,
noticed in the course of preparing this patch, isn't an alias, but an
actual function in sysdeps/mach/hurd/getcwd.c - apparently unused,
however.

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

	[BZ #14132]
	* include/wctype.h [!_ISOMAC] (__iswalpha_l_internal): Remove
	declaration.
	[!_ISOMAC] (__iswdigit_l_internal): Likewise.
	[!_ISOMAC] (__iswspace_l_internal): Likewise.
	[!_ISOMAC] (__iswxdigit_l_internal): Likewise.
	[!_ISOMAC] (__iswctype_internal): Likewise.
	* stdio-common/siglist.c (_sys_siglist_internal): Remove alias.
	* sysdeps/unix/syscalls.list (chown): Remove __chown_internal
	alias.
	(fcntl): Remove __fcntl_internal alias.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (connect): Remove
	__connect_internal alias.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (connect):
	Likewise.
2014-10-09 01:11:14 +00:00
Joseph Myers
73e28d9c88 soft-fp: Refactor exception handling for comparisons.
This patch refactors how soft-fp comparisons handle setting exceptions
for NaN operands, so that exceptions are set through the FP_CMP macros
rather than directly in the C files calling them.

The _FP_CMP* and FP_CMP* macros gain an extra argument to specify when
exceptions should be set, 0 for no exception setting (I'm not sure
this is actually needed - at least it's not needed for IEEE operations
in glibc / libgcc, but might be relevant in some cases for kernel
use), 1 for exceptions only for signaling NaNs and 2 for exceptions
for all NaNs.  This argument is handled through _FP_CMP_CHECK_NAN,
newly called by the _FP_CMP* macros when a NaN is encountered.  Calls
to these macros are updated, which eliminates all the existing
checking and exception setting in soft-fp *.c files in glibc.

Tested for powerpc-nofpu.  (The __unord* functions have no code
changes; the __eq* / __ge* / __le* functions get slightly larger, but
I don't think that's significant.)

	* soft-fp/op-common.h (_FP_CMP_CHECK_NAN): New macro.
	(_FP_CMP): Add extra argument EX.  Call _FP_CMP_CHECK_NAN.
	(_FP_CMP_EQ): Likewise.
	(_FP_CMP_UNORD): Likewise.
	* soft-fp/double.h (FP_CMP_D): Add extra argument EX.
	(FP_CMP_EQ_D): Likewise.
	(FP_CMP_UNORD_D): Likewise.
	* soft-fp/extended.h (FP_CMP_E): Likewise.
	(FP_CMP_EQ_E): Likewise.
	(FP_CMP_UNORD_E): Likewise.
	* soft-fp/quad.h (FP_CMP_Q): Likewise.
	(FP_CMP_EQ_Q): Likewise.
	(FP_CMP_UNORD_Q): Likewise.
	* soft-fp/single.h (FP_CMP_S): Likewise.
	(FP_CMP_EQ_S): Likewise.
	(FP_CMP_UNORD_S): Likewise.
	* soft-fp/eqdf2.c (__eqdf2): Update call to FP_CMP_EQ_D.
	* soft-fp/eqsf2.c (__eqsf2): Update call to FP_CMP_EQ_S.
	* soft-fp/eqtf2.c (__eqtf2): Update call to FP_CMP_EQ_Q.
	* soft-fp/gedf2.c (__gedf2): Update call to FP_CMP_D.
	* soft-fp/gesf2.c (__gesf2): Update call to FP_CMP_S.
	* soft-fp/getf2.c (__getf2): Update call to FP_CMP_Q.
	* soft-fp/ledf2.c (__ledf2): Update call to FP_CMP_D.
	* soft-fp/lesf2.c (__lesf2): Update call to FP_CMP_S.
	* soft-fp/letf2.c (__letf2): Update call to FP_CMP_Q.
	* soft-fp/unorddf2.c (__unorddf2): Update call to FP_CMP_UNORD_D.
	* soft-fp/unordsf2.c (__unordsf2): Update call to FP_CMP_UNORD_S.
	* soft-fp/unordtf2.c (__unordtf2): Update call to FP_CMP_UNORD_Q.
	* sysdeps/alpha/soft-fp/ots_cmpe.c (internal_compare): Update call
	to FP_CMP_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_cmp.c (_Q_cmp): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_cmpe.c (_Q_cmpe): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_feq.c (_Q_feq): Update call to
	FP_CMP_EQ_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_fge.c (_Q_fge): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc32/soft-fp/q_fgt.c (_Q_fgt): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_fle.c (_Q_fle): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_flt.c (_Q_flt): Likewise.
	* sysdeps/sparc/sparc32/soft-fp/q_fne.c (_Q_fne): Update call to
	FP_CMP_EQ_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_cmp.c (_Qp_cmp): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c (_Qp_cmpe): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_feq.c (_Qp_feq): Update call to
	FP_CMP_EQ_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_fge.c (_Qp_fge): Update call to
	FP_CMP_Q.
	* sysdeps/sparc/sparc64/soft-fp/qp_fgt.c (_Qp_fgt): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_fle.c (_Qp_fle): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_flt.c (_Qp_flt): Likewise.
	* sysdeps/sparc/sparc64/soft-fp/qp_fne.c (_Qp_fne): Update call to
	FP_CMP_EQ_Q.
2014-10-09 01:03:56 +00:00
Joseph Myers
2d6a47ba4c soft-fp: Remove FP_CLEAR_EXCEPTIONS.
As noted in
<https://sourceware.org/ml/libc-alpha/2013-10/msg00516.html>, the
soft-fp macro FP_CLEAR_EXCEPTIONS should not be necessary, as soft-fp
code should never set an exception and later clear it.

In fact, all four uses in glibc (for SPARC) are indeed unnecessary:
they appear in files that convert 32-bit or 64-bit integers to IEEE
binary128, an operation that can never raise any exceptions.  If this
was intended to enable the compiler to optimize away any FP_FROM_INT
code testing for exceptional cases, we now have a better way of doing
this: defining FP_NO_EXCEPTIONS before including soft-fp.h causes all
code handling exceptions to be stubbed out, and the rounding mode to
be hardwired for round-to-zero, to allow such optimizations for source
files where (a) the operation in question, for the particular types in
question, can never raise exceptions, but (b) some instances of the
operation for other types can, so the macros used in the file do
contain references to rounding or exceptions, albeit dead in that
particular file.

The uses in the Linux kernel are also unnecessary (clearing exceptions
at a point where they are already cleared).

This patch duly removes FP_CLEAR_EXCEPTIONS, making the SPARC code in
question use FP_NO_EXCEPTIONS and stop using exception-related macros.

	* soft-fp/soft-fp.h (FP_CLEAR_EXCEPTIONS): Remove macro.
	* sysdeps/sparc/sparc32/soft-fp/q_itoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_itoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
	* sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_lltoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
	* sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_ulltoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
	* sysdeps/sparc/sparc32/soft-fp/q_utoq.c: Define FP_NO_EXCEPTIONS.
	(_Q_utoq): Do not use FP_DECL_EX, FP_CLEAR_EXCEPTIONS or
	FP_HANDLE_EXCEPTIONS.
2014-10-09 00:58:42 +00:00
Joseph Myers
620f462e88 Don't use INTUSE with __adjtimex (bug 14132).
Bug 14132 is removal of the old INTDEF/INTUSE system of *_internal
aliases as obsoleted by the hidden_proto / hidden_def system.  Various
cases were cleaned up in 2012, but some remain.  This patch removes
the use of this mechanism for __adjtimex.

Tested for x86_64 that stripped installed shared libraries are
unchanged by the patch.

	[BZ #14132]
	* sysdeps/unix/sysv/linux/include/sys/timex.h: New file.
	* sysdeps/unix/sysv/linux/adjtime.c [!ADJTIMEX] (ADJTIMEX): Do not
	use INTUSE.
	[!ADJTIMEX] (INTUSE(__adjtimex)): Remove declaration.
	* sysdeps/unix/sysv/linux/alpha/adjtime.c (__adjtimex_internal):
	Remove alias.
	(__adjtimex): Define using libc_hidden_ver.
	* sysdeps/unix/sysv/linux/ntp_gettime.c (INTUSE(__adjtimex)):
	Remove declaration.
	(ntp_gettime): Call __adjtimex directly.
	* sysdeps/unix/sysv/linux/ntp_gettimex.c (INTUSE(__adjtimex)):
	Remove declaration.
	(ntp_gettimex): Call __adjtimex directly.
	* sysdeps/unix/sysv/linux/syscalls.list (adjtimex): Remove
	__adjtimex_internal alias.
2014-10-08 23:19:32 +00:00
Joseph Myers
f7b425175c Support and use mixed compat/non-compat aliases in syscalls.list.
This patch enables syscalls.list entries to specify both compat and
non-compat symbol versions for the same syscall definition, making use
of this for setrlimit / chown / lchown where the inability to specify
such aliases showed up in the course of work on bug 14138.

The change to make-syscalls.sh is minimal: adding a SHARED conditional
on the compat_symbol calls.  It remains the case that if a compat
symbol version is specified, the syscall is only built for the shared
library at all if an explicit symbol version is given for a non-compat
symbol (so it's necessary to specify "lchown@@GLIBC_2.0
chown@GLIBC_2.0" rather than just "lchown chown@GLIBC_2.0").  It also
remains the case, as already commented in make-syscalls.sh, that no
SHLIB_COMPAT conditionals are generated, so there would be problems if
the same syscalls.list file, with compat symbols, were used for both
configurations that should have those symbols and configurations for
which they should be conditioned out with SHLIB_COMPAT.

Tested for x86.

	* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Condition
	compat_symbol calls on [SHARED].
	* sysdeps/unix/sysv/linux/powerpc/lchown.S: Remove file.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (oldsetrlimit):
	Remove.
	(setrlimit): Add setrlimit@GLIBC_2.0 alias.
	* sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
	(oldsetrlimit): Remove.
	(setrlimit): Add setrlimit@GLIBC_2.0 alias.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
	(lchown): New syscall entry.
	(oldsetrlimit): Remove.
	(setrlimit): Add setrlimit@GLIBC_2.0 alias.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
	(oldsetrlimit): Remove.
	(setrlimit): Add setrlimit@GLIBC_2.0 alias.
2014-10-06 22:58:59 +00:00
Joseph Myers
abb280f799 Move some chown / lchown / fchown definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of chown, lchown and fchown.

In most cases the need for special syscalls.list entries (rather than
existing generic ones) is because these architectures use chown32,
lchown32 and fchown32 as syscall names.  Some architectures also have
symbol versioning compatibility for older versions of chown having
been equivalent to lchown.

In the case of powerpc, chown.c (providing the chown@@GLIBC_2.1
default version) is replaced by a syscalls.list entry (for powerpc32;
powerpc64 has no need for this because of its more recent minimum
symbol version, so can just use the entry in
sysdeps/unix/syscalls.list), but lchown.S is left as-is because it
provides the compat version of chown as an actual alias for __lchown,
which is not yet supported by syscalls.list.  This file can be removed
once such aliases are supported in syscalls.list.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/arm/fchown.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (lchown): Add syscall.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (chown):
	Likewise.
2014-10-06 22:30:54 +00:00
Adhemerval Zanella
47d4623785 powerpc: remove linux lowlevellock.h
This patch remove the powerpc specific lowlevellock.h and adjust some
implementation that rely on __lll_[rel/acq]_instr defines.
2014-10-06 16:08:32 -05:00
Chris Metcalf
563a74d86c tile: fix copyright header blocks in just-committed files
I accidentally committed versions not following the conventions.
2014-10-06 13:47:02 -04:00
Chris Metcalf
845a73434c tile: add clock_gettime support via vDSO 2014-10-06 11:22:14 -04:00
Chris Metcalf
83d641efd1 tile: make the prolog of clone() more conformant
With this change we properly set up the frame first, and tear
it down last, doing argument checking only when the frame is set up.
2014-10-06 11:21:29 -04:00
Chris Metcalf
d9cd52e64d tile: optimize memcmp
Customize memcmp.c for tile, using similar tricks from memcpy:

- replace MERGE macro with dblalign.
- replace memcmp_bytes function with revbytes.
- use __glibc_likely.
- use post-increment addressing.

The schedule is still not perfect: the compiler is not hoisting
code above the comparison branch, which could save a bundle or two.
memcmp speeds up by 30-40% on shorter aligned tests in benchtest,
with some tests with unaligned lengths taking a small performance hit.
2014-10-06 11:20:59 -04:00
Chris Metcalf
4b68ea1162 tile: add support for _SC_LEVEL*CACHE* sysconf() queries 2014-10-06 11:20:30 -04:00
Chris Metcalf
c86f7b80f4 tilegx: provide optimized strnlen, strstr, and strcasestr
strnlen() is based on the existing tile strlen() with length
checking added.  It speeds up by up to 5x, but on average across
the benchtest corpus by around 35%.  No regressions are seen.

strstr() does 8-byte aligned loads and compares using a 2-byte
filter on the first two bytes of the needle and then testing
the remaining bytes in needle using memcmp().  It speeds up
about 5x in the best case (for "found" needles), about 2x looking
at benchtest as a whole, with some slowdowns as much as 45%.
on a few cases (including the "fail" case for 128KB search).

strcasestr() is based on strstr() but uses a SIMD tolower
routine to convert 8-bytes to lower case in 5 instructions.
It also uses a 2-byte filter and then strncasecmp() for the
remaining bytes.  strncasecmp() is not optimized for SIMD, so
there is futher room for improvement.  However, it is still up
to 16x faster for "found" needles, averaging 2x faster on the
whole corpus of benchtests.  It does slow down by up to 35%
on a few cases, similarly to strstr().
2014-10-06 11:19:18 -04:00
Chris Metcalf
1c4c1a6f4d tilegx: optimize string copy_byte() internal function
We can use one "shufflebytes" instruction instead of 3 "bfins"
instructions to optimize the string functions.
2014-10-06 11:18:41 -04:00
Joseph Myers
6268f532b6 Move execve to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where
previous cleanups have made this possible, this patch moves the
definition of execve.  (In this case, it was the removal of bounded
pointers support, rather than old kernel support, which made the move
possible.)

Tested for x86_64.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/execve.c: Remove file.
	* sysdeps/unix/sysv/linux/syscalls.list (execve): Add syscall.
2014-10-01 20:58:20 +00:00
Steve Ellcey
7a34129911 Remove extra whitespace from end of line. 2014-10-01 13:46:51 -07:00
Steve Ellcey
b925285f98 * sysdeps/mips/strcmp.S: New. 2014-10-01 13:45:50 -07:00
Joseph Myers
754a15c61c Move some *at definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves definitions of various *at functions in
sysdeps/unix/sysv/linux/.

These particular moves are straightforward: there are no #includes of
these source files, no special architecture-specific versions, no
special symbol version handling and no aliases.  Each source file can
be replaced by a single line in sysdeps/unix/sysv/linux/syscalls.list.

Tested for x86_64.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/syscalls.list (fchownat): New syscall.
	(linkat): Likewise.
	(mkdirat): Likewise.
	(readlinkat): Likewise.
	(renameat): Likewise.
	(symlinkat): Likewise.
	(unlinkat): Likewise.
	* sysdeps/unix/sysv/linux/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/linkat.c: Likewise.
	* sysdeps/unix/sysv/linux/mkdirat.c: Likewise.
	* sysdeps/unix/sysv/linux/readlinkat.c: Likewise.
	* sysdeps/unix/sysv/linux/renameat.c: Likewise.
	* sysdeps/unix/sysv/linux/symlinkat.c: Likewise.
	* sysdeps/unix/sysv/linux/unlinkat.c: Likewise.
2014-09-30 14:32:08 +00:00
Joseph Myers
b7e02da4e9 Run tst-ld-sse-use.sh with bash.
tst-ld-sse-use.sh is a bash script, not a POSIX shell script, and so
needs to be run with $(BASH) not $(SHELL) to avoid errors of the form:

../sysdeps/x86/tst-ld-sse-use.sh: 41: ../sysdeps/x86/tst-ld-sse-use.sh: declare: not found

(when /bin/sh is dash).  This patch makes that change.

Tested for x86_64.

	* sysdeps/x86/Makefile ($(objpfx)tst-ld-sse-use.out): Run script
	with $(BASH) not $(SHELL).
2014-09-29 23:24:37 +00:00
H.J. Lu
f4a58f0d35 Require autoconf 2.69
* aclocal.m4: Require autoconf 2.69.
	* configure: Regenerated.
	* sysdeps/aarch64/configure: Likewise.
	* sysdeps/alpha/configure: Likewise.
	* sysdeps/arm/armv7/configure: Likewise.
	* sysdeps/arm/configure: Likewise.
	* sysdeps/ia64/configure: Likewise.
	* sysdeps/mach/configure: Likewise.
	* sysdeps/mips/configure: Likewise.
	* sysdeps/s390/configure: Likewise.
	* sysdeps/unix/sysv/linux/mips/configure: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: Likewise.

	* sysdeps/alpha/configure.ac: Avoid empty lines at the end of
	file.
	* sysdeps/ia64/configure.ac: Likewise.
2014-09-29 07:53:36 -07:00
Joseph Myers
1810d3ab71 Remove shlib-versions entries redundant with DEFAULT entries.
When a shlib-versions file has a DEFAULT line, it's not necessary to
specify the same default minimum symbol version on the lines for
individual libraries.  If those lines otherwise duplicate the default
SONAME for the library in question, they can be removed completely.

This patch makes such cleanups: version entries for ld.so are removed
(leaving just the definition of the architecture-specific dynamic
linker name) and entries for libpthread are removed completely (since
the default is libpthread.so.0).

Tested for x86_64 that the installed shared libraries are unchanged by
this patch.

There are various architectures (hppa, ia64, mips, sh, sparc64) that
define minimum symbol versions (or in the case of mips, omission of
symbol versions) only for particular libraries without a DEFAULT line.
None of these are equivalent to something simpler with a DEFAULT line
because all have some other libraries, not explicitly mentioned, with
symbol versions that would be omitted were such a line used.  In the
mips case I'm pretty sure it was a mistake not to omit the 2.1 symbols
for libthread_db; for the others I don't know if it was a mistake or
deliberate that some symbols in various libraries have 2.0 or 2.1
versions despite other libraries having a 2.2 minimum.

This concludes the shlib-versions cleanups I'm aware of.

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions: Do not
	specify symbol version for ld.so.  Do not include entry for
	libpthread.
	* sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Likewise.
2014-09-26 17:34:22 +00:00
Joseph Myers
93ae1ebaa6 Clean up gnu/lib-names.h generation (bug 14171).
This patch eliminates the mixture of SONAME information in
shlib-versions files and SONAME information used to generate
gnu/lib-names.h in makefiles, with the information in the makefiles
being removed so all this information comes from the shlib-versions
files.

So that gnu/lib-names.h supports multiple ABIs, it is changed to be
generated on the same basis as gnu/stubs.h: when there are multiple
ABIs, gnu/lib-names.h is a wrapper header (the same header installed
whatever ABI is being built) and separate headers such as
gnu/lib-names-64.h contain the substantive contents (only one such
header being installed by any glibc build).

The rules for building gnu/lib-names.h were moved from Makeconfig to
Makerules because they need to come after sysdeps makefiles are
included (now that "ifndef abi-variants" is a toplevel conditional on
the rules rather than $(abi-variants) being evaluated later inside the
commands for a rule).

Tested for x86_64 and x86 that the installed shared libraries are
unchanged by this patch, and examined the installed gnu/lib-names*.h
headers by hand.  Also tested the case of a single ABI (where there is
just a single header installed, again like stubs.h) by hacking
abi-variants to empty for x86_64.

	[BZ #14171]
	* Makeconfig [$(build-shared) = yes]
	($(common-objpfx)soversions.mk): Don't handle SONAMEs specified in
	makefiles.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	($(common-objpfx)gnu/lib-names.h): Remove rule.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	($(common-objpfx)gnu/lib-names.stmp): Likewise.  Split and moved
	to Makerules.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	(before-compile): Don't append $(common-objpfx)gnu/lib-names.h
	here.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	(common-generated): Don't append gnu/lib-names.h and
	gnu/lib-names.stmp here.
	* Makerules [$(build-shared) = yes && $(soversions.mk-done) = t]
	(lib-names-h-abi): New variable.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	(lib-names-stmp-abi): Likewise.
	[$(build-shared) = yes && $(soversions.mk-done) = t &&
	abi-variants] (before-compile): Append
	$(common-objpfx)$(lib-names-h-abi).
	[$(build-shared) = yes && $(soversions.mk-done) = t &&
	abi-variants] (common-generated): Append gnu/lib-names.h.
	[$(build-shared) = yes && $(soversions.mk-done) = t &&
	abi-variants] (install-others-nosubdir): Depend on
	$(inst_includedir)/$(lib-names-h-abi).
	[$(build-shared) = yes && $(soversions.mk-done) = t &&
	abi-variants] ($(common-objpfx)gnu/lib-names.h): New rule.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	($(common-objpfx)$(lib-names-h-abi)): New rule.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	($(common-objpfx)$(lib-names-stmp-abi)): Likewise.
	[$(build-shared) = yes && $(soversions.mk-done) = t]
	(common-generated): Append $(lib-names-h-abi) and
	$(lib-names-stmp-abi).
	* scripts/lib-names.awk: Do not handle multi being set.
	* sysdeps/unix/sysv/linux/aarch64/Makefile (abi-lp64-ld-soname):
	Remove variable.
	(abi-lp64_be-ld-soname): Likewise.
	* sysdeps/unix/sysv/linux/arm/Makefile (abi-soft-ld-soname):
	Likewise.
	(abi-hard-ld-soname): Likewise.
	* sysdeps/unix/sysv/linux/i386/shlib-versions: New file.
	* sysdeps/unix/sysv/linux/mips/Makefile (abi-o32_soft-ld-soname):
	Remove variable.
	(abi-o32_hard-ld-soname): Likewise.
	(abi-o32_soft_2008-ld-soname): Likewise.
	(abi-o32_hard_2008-ld-soname): Likewise.
	(abi-n32_soft-ld-soname): Likewise.
	(abi-n32_hard-ld-soname): Likewise.
	(abi-n32_soft_2008-ld-soname): Likewise.
	(abi-n32_hard_2008-ld-soname): Likewise.
	(abi-n64_soft-ld-soname): Likewise.
	(abi-n64_hard-ld-soname): Likewise.
	(abi-n64_soft_2008-ld-soname): Likewise.
	(abi-n64_hard_2008-ld-soname): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/Makefile (abi-64-v1-ld-soname):
	Likewise.
	(abi-64-v2-ld-soname): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions: Add
	ld.so entries.
	* sysdeps/unix/sysv/linux/s390/Makefile (abi-64-ld-soname): Remove
	variable.
	* sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions: Add ld.so
	entry.
	* sysdeps/unix/sysv/linux/x86/Makefile (abi-32-ld-soname): Remove
	variable.
	(abi-64-ld-soname): Likewise.
	(abi-x32-ld-soname): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Add ld.so
	entry.
	* sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Likewise.
2014-09-26 17:33:04 +00:00
Joseph Myers
68870f1253 Move some setrlimit definitions to syscalls.list (bug 14138).
Bug 14138 is followup cleanup after removal of support for old Linux
kernel versions: moving syscalls to syscalls.list where the only
reason for using C definitions was kernel version conditionals that
are no longer present.

This patch deals with the case of setrlimit
(sysdeps/unix/sysv/linux/i386/setrlimit.c, included by various other
architectures).  Where needed (where there is also a compat symbol for
setrlimit@GLIBC_2.0), new syscalls.list entries are added.  Where not
needed (where there is no such compat symbol and the minimum symbol
version for libc is 2.2 or later), no such entries are added as that
in sysdeps/unix/syscalls.list will suffice.  Thus arm and sh need no
such entries, while m68k and powerpc need entries only in a
subdirectory syscalls.list file rather than for all configurations
that previously used setrlimit.c.

(setrlimit@@GLIBC_2.2 and setrlimit@GLIBC_2.0 are now semantically
identical - the new symbol version was about a change of types from
signed to unsigned and the former compatibility code for dealing with
large unsigned arguments on old kernels is no longer needed or
present, having been removed with support for pre-2.4 kernels.
However, making the two versions into aliases doesn't work at present:
the case of having both default and non-default symbol versions on the
same syscalls.list line results in a compat_symbol call in code built
for static libc, which doesn't compile.  I don't suppose it would be
hard to generate SHARED conditionals from make-syscalls.sh to fix
this, but in any case this patch doesn't make things any worse, as the
functions weren't aliases before the patch either.)

Tested for x86, and ran ABI tests for ARM as an example of an
architecture where the setrlimit.c file was just removed without
adding syscalls.list entries.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/arm/setrlimit.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setrlimit.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/setrlimit.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setrlimit.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setrlimit.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (setrlimit): Add
	syscall entry for GLIBC_2.2 symbol version.
	* sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list (setrlimit):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
	(setrlimit): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (setrlimit):
	Likewise.
2014-09-23 14:12:50 +00:00
Will Newton
ea58f20293 ARM: Don't define _SYS_AUXV_H in sysdep.h
sysdep.h was defining _SYS_AUXV_H in order to avoid an include guard check
in hwcap.h. Unfortunately it didn't undefine it so it could leak out into
code and caused a build failure with -Wimplicit-function-declaration
building tst-auxv on ARM.

ChangeLog:

2014-09-23  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/arm/bits/hwcap.h: Check for
	_LINUX_ARM_SYSDEP_H include guard too.
	* sysdeps/unix/sysv/linux/arm/sysdep.h (_SYS_AUXV_H): Remove
	define.
2014-09-23 14:58:49 +01:00
Rasmus Villemoes
69eb9a183c Fix prototype of eventfd. 2014-09-20 14:05:49 +02:00
Ondřej Bílka
20e5a5f773 Sync recvmmsg prototype with kernel usage. 2014-09-20 13:53:44 +02:00
Joseph Myers
af296fcdab Remove bitrotten --enable-oldest-abi (bug 6652).
This patch removes the --enable-oldest-abi configure option, which has
long been bitrotten (as reported in bug 6652).  The principle of
removing this option was agreed in the thread starting at
<https://sourceware.org/ml/libc-alpha/2013-07/msg00174.html>.

Tested for x86_64 and x86 that the installed shared libraries other
than libc.so are unchanged by this patch and that libc.so disassembly
and symbol versions are unchanged (debug info changes because of
changed line numbers in csu/version.c).

	[BZ #6652]
	* Makeconfig (soversions-default-setname): Remove variable.
	($(common-objpfx)soversions.i): Don't pass default_setname to
	soversions.awk.
	* Makerules ($(common-objpfx)abi-versions.h): Don't pass
	oldest_abi to abi-versions.awk.
	* config.h.in (GLIBC_OLDEST_ABI): Remove macro undefine.
	* config.make.in (oldest-abi): Remove variable.
	* configure.ac (--enable-oldest-abi): Remove configure option.
	* configure: Regenerated.
	* csu/version.c (banner) [GLIBC_OLDEST_ABI]: Remove conditional
	text.
	* scripts/abi-versions.awk: Do not handle oldest_abi variable.
	* scripts/soversions.awk: Do not handle default_setname variable.
	* sysdeps/mach/hurd/configure.ac: Do not handle oldest_abi
	variable.
	* sysdeps/mach/hurd/configure: Regenerated.
	* sysdeps/unix/sysv/linux/configure.ac: Do not handle oldest_abi
	variable.
	* sysdeps/unix/sysv/linux/configure: Regenerated.
2014-09-16 17:45:03 +00:00
Andreas Schwab
a7b8726870 Handle zero prefix length in getifaddrs (BZ #17371) 2014-09-15 18:59:37 +02:00
Siddhesh Poyarekar
61fe374a44 Remove _POSIX_REGEX_VERSION
There is no _POSIX_REGEX_VERSION, so don't check for it.
_REGEX_VERSION has been removed as well[1], so only keep the -1 return
for backward compatibility.  I found this when trying to make the
getconf environment variables typo-proof.

	* sysdeps/posix/sysconf.c (__sysconf): Return -1 for
	_SC_REGEX_VERSION.

[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
2014-09-15 10:16:14 +05:30
Joseph Myers
ba90e05052 Remove configuration name patterns from shlib-versions.
This patch removes the first column (patterns matching configuration
names) from shlib-versions, leaving shlib-versions entry selection
based purely on sysdeps directories.

An implication of this removal is that the default for any non-Linux
ports using NPTL will be the same SONAMEs for NPTL libraries as for
Linux (as those defaults, previously limited to .*-.*-linux.*, are
left in nptl/shlib-versions and nptl_db/shlib-versions).

Special host_os handling in configure.ac that was purely for
shlib-versions is removed.  (The host_os setting is still used for
libc-abis - see
<https://sourceware.org/ml/libc-alpha/2014-01/msg00375.html> regarding
that - but no entries there are affected by this change.)

Tested on x86_64 and x86 that the installed shared libraries are
unchanged by this patch.

	* scripts/soversions.awk: Do not handle configuration names.
	* Makeconfig ($(common-objpfx)soversions.i): Do not pass cpu,
	vendor and os variables to soversions.awk.
	* configure.ac: Do not modify gnu-* host_os.
	* configure: Regenerated
	* shlib-versions: Remove first column with configuration names.
	* nptl/shlib-versions: Likewise.
	* nptl_db/shlib-versions: Likewise.
	* sysdeps/hppa/shlib-versions: Likewise.
	* sysdeps/m68k/shlib-versions: Likewise.
	* sysdeps/mach/hurd/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/alpha/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/arm/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/hppa/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/ia64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/mips/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/sh/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/tile/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Likewise.

libidn/ChangeLog:
	* shlib-versions: Remove first column with configuration names.
2014-09-12 12:28:47 +00:00
Joseph Myers
73a391126d Use %ifdef in sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions.
This patch makes
sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions use %ifdef
conditionals around the different symbol version definitions for big
and little endian.  (It doesn't actually change the host patterns used
for those definitions; the point is to make it possible to remove the
first column from shlib-versions by eliminating the last case where it
would be harmful for it to be treated as .*-.*-.*.)  The conditional
is based on the ELFv1/ELFv2 distinction rather than BE/LE, since
that's what's already tested in configure and used for the ld.so
soname in the Makefiles.  (Of course if BE ELFv2 were supported in
future, it would get new symbol versions and so need new
conditionals.)

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
	(HAVE_ELFV2_ABI): AC_DEFINE in ELFv2 case.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure:
	Regenerated.
	* config.h.in (HAVE_ELFV2_ABI): New macro undefine.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions:
	Condition symbol version definitions on [HAVE_ELFV2_ABI].
2014-09-12 12:25:36 +00:00
Joseph Myers
c729e7c13a Move OS-specific shlib-versions entries to sysdeps files.
This patch moves OS-specific entries in the top-level shlib-versions
file to appropriate sysdeps directories.  I left the entries in
nptl/shlib-versions and nptl_db/shlib-versions unchanged; I think it
can be for those doing non-Linux NPTL-using ports to figure out
whether those entries should actually be OS-independent or should move
to sysdeps.

Given these two patches, I think the only further change needed before
the first column of shlib-versions can be eliminated will be changing
sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions to use %ifdef
to distinguish BE and LE configurations, instead of relying on the
powerpc64-.*-linux.* and powerpc.*le-.*-linux.* patterns.

Tested on x86_64 that the installed shared libraries are unchanged by
this patch.

	* shlib-versions: Remove OS-specific entries.  Moved to files in
	sysdeps.
	* sysdeps/mach/hurd/shlib-versions: New file.
	* sysdeps/unix/sysv/linux/shlib-versions: Likewise.
2014-09-12 12:24:00 +00:00
Joseph Myers
dc932a24d9 Move architecture-specific shlib-versions entries to sysdeps files.
This patch eliminates another way in which ex-ports and non-ex-ports
architectures differ, by moving architecture-specific entries from the
top-level shlib-versions file and that in nptl/ to appropriate sysdeps
directories.  As with my previous patch
<https://sourceware.org/ml/libc-alpha/2014-06/msg00949.html>, I do not
change the regular expressions used; even where the present
expressions seem more general, I believe they are in fact specific to
the chosen sysdeps directory, because any port that matches the
expression but not the sysdeps directory does not currently exist, and
so would use different symbol versions if added in future (and an
intended goal of these changes is to eliminate the first column in
shlib-versions completely rather than having two different mechanisms
in use for system-specific configuration).

Tested on x86_64 that this does not change the installed shared
libraries.  (x86_64 of course does not provide much test coverage for
this patch - what should be architecture-specific contents in
shlib-versions for x86_64 is currently abi-*-ld-soname Makefile
settings, until gnu/lib-names.h is generated more like gnu/stubs.h so
those can move back to shlib-versions.)

	* nptl/shlib-versions: Remove architecture-specific entries.
	Moved to files in sysdeps.
	* shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions: New
	file.
	* sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/sh/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions: Likewise.
2014-09-12 12:22:27 +00:00
Joseph Myers
0bd7246803 Add new Linux 3.16 constants to netinet/udp.h.
This patch adds the new constants UDP_NO_CHECK6_TX and
UDP_NO_CHECK6_RX from Linux 3.16 to sysdeps/gnu/netinet/udp.h.  (I
believe the existing constants there are already Linux-specific,
possibly with the intention that other OSes should adopt the same
values if possible if adopting the features in question.)

Tested on x86_64.

	* sysdeps/gnu/netinet/udp.h (UDP_NO_CHECK6_TX): New macro.
	(UDP_NO_CHECK6_RX): Likewise.
2014-09-12 12:13:08 +00:00
Siddhesh Poyarekar
920238e061 Fix typo in macro names in sysconf.c
Spell _POSIX_DEVICE_SPECIFIC and _POSIX_DEVICE_SPECIFIC_R correctly.
Found when trying to make the getconf environment variables
typo-proof.

	* sysdeps/posix/sysconf.c (__sysconf): Spell
	_POSIX_DEVICE_SPECIFIC and _POSIX_DEVICE_SPECIFIC_R correctly.
2014-09-12 16:37:31 +05:30
Siddhesh Poyarekar
5379aebddd Enhance tst-xmmymm.sh to detect zmm register usage in ld.so (BZ #16194)
2d63a517e4 added support to save and
restore zmm register in the dynamic linker, but did not enhance
test-xmmymm.sh to detect accidental usage of these registers.  The
patch below adds that check.

The script has also been renamed to tst-ld-sse-use.sh.  To see the
minimal changes, run `git show -M`.

	[BZ #16194]
	* sysdeps/x86/tst-xmmymm.sh: Rename file to...
	* sysdeps/x86/tst-ld-sse-use.sh: ... this.  Check for zmm
	register usage.
	* sysdeps/x86/Makefile: Adjust.
2014-09-12 12:31:05 +05:30
Chris Metcalf
3daee1076b tile: remove linux lowlevellock.h 2014-09-10 16:57:29 -04:00
Adhemerval Zanella
71ae86478e PowerPC: memset optimization for POWER8/PPC64
This patch adds an optimized memset implementation for POWER8.  For
sizes from 0 to 255 bytes, a word/doubleword algorithm similar to
POWER7 optimized one is used.

For size higher than 255 two strategies are used:

1. If the constant is different than 0, the memory is written with
   altivec vector instruction;

2. If constant is 0, dbcz instructions are used.  The loop is unrolled
   to clear 512 byte at time.

Using vector instructions increases throughput considerable, with a
double performance for sizes larger than 1024.  The dcbz loops unrolls
also shows performance improvement, by doubling throughput for sizes
larger than 8192 bytes.
2014-09-10 07:39:46 -04:00
Adhemerval Zanella
3b473fecdf PowerPC: multiarch bzero cleanup for PPC64
This patch cleanups the multiarch bzero for powerpc64 by remove
the multiarch objects and use instead the the memset embedded
implementation presented in each multiarch optimization.  The
code generate is essentially the same, but the TB_TOCLESS (which
is not essential).
2014-09-10 07:39:46 -04:00
Steve Ellcey
9d3a350b49 Put mips preconfigure code inside mips* case statement.
Fix capitalization of error message.
2014-09-09 10:58:00 -07:00
Steve Ellcey
0febba23dd Modify ABI tests in MIPS preconfigure. 2014-09-09 10:01:51 -07:00
Carlos O'Donell
645a0e9c17 HPPA: Add c++-types.data.
Added c++-types.data to baseline for HPPA. At this point `make check`
completes without error, and the full testing results are summarized.
2014-09-07 22:09:49 -04:00
Carlos O'Donell
d83f0734e1 HPPA: Transition to new non-addon NPTL.
Merge roland/nptl-hppa to master, update and test for hppa-linux-gnu.

This commit squashes and commits the work done by Roland McGrath on
roland/nptl-hppa to migrate hppa to the new non-addon NPTL. Some
additional tweaks were required for tcb-offsets.sym to work correctly
along with clone.S (unique to hppa).
2014-09-07 22:08:36 -04:00
Chris Metcalf
8622092d58 [BZ #17354] tile: Fix up corner cases with signed relocations
Some types of relocations technically need to be signed rather than
unsigned: in particular ones that are used with moveli or movei,
or for jump and branch.  This is almost never a problem.  Jump and
branch opcodes are pretty much uniformly resolved by the static linker
(unless you omit -fpic for a shared library, which is not recommended).
The moveli and movei opcodes that need to be sign-extended generally
are for positive displacements, like the construction of the address of
main() from _start().  However, tst-pie1 ends up with main below _start
(in a different module) and the test failed due to signedness issues in
relocation handling.

This commit treats the value as signed when shifting (to preserve the
high bit) and also sign-extends the value generated from the updated
bundle when comparing with the desired bundle, which we do to make sure
no overflow occurred.  As a result, the tst-pie1 test now passes.
2014-09-06 12:24:03 -04:00
Khem Raj
a78b712d40 Define __GI_fegetenv for e500 libm
generic HAVE_RM_CTX implementation which is used for ppc/e500 as well
has introduced calls to fegetenv which should be resolved internally
with in libm

Signed-off-by: Khem Raj <raj.khem@gmail.com>

	* sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c (fegetenv): Add
	libm_hidden_ver.
2014-09-02 21:39:04 +00:00
Samuel Thibault
17a62de1ff Fix hang on fork
If e.g. a signal is being received while we are running fork(), the signal
thread may be having our SS lock when we make the space copy, and thus in the
child we can not take the SS lock any more.

* sysdeps/mach/hurd/fork.c (__fork): Lock SS->lock around __proc_dostop call.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2014-08-28 22:09:29 +02:00
Mark Wielaard
9570bc53fc i386 TLS_INIT_TP might produce bogus asm changing stack pointer [BZ #17319]
TLS_INIT_TP in sysdeps/i386/nptl/tls.h uses some hand written asm to
generate a set_thread_area that might result in exchanging ebx and esp
around the syscall causing introspection tools like valgrind to loose
track of the user stack. Just use INTERNAL_SYSCALL which makes sure
esp isn't changed arbitrarily.

Before the patch the code would generate:

mov    $0xf3,%eax
movl   $0xfffff,0x8(%esp)
movl   $0x51,0xc(%esp)
xchg   %esp,%ebx
int    $0x80
xchg   %esp,%ebx

Using INTERNAL_SYSCALL instead will generate:

movl   $0xfffff,0x8(%esp)
movl   $0x51,0xc(%esp)
xchg   %ecx,%ebx
mov    $0xf3,%eax
int    $0x80
xchg   %ecx,%ebx

Thanks to Florian Weimer for analysing why the original code generated
the bogus esp usage:

  _segdescr.desc happens to be at the top of the stack, so its address
  is in %esp.  The asm statement says that %3 is an input, so its value
  will not change, and GCC can use %esp as the input register for the
  expression &_segdescr.desc.  But the constraints do not fully describe
  the asm statement because the %3 register is actually modified, albeit
  only temporarily.

	[BZ #17319]
	* sysdeps/i386/nptl/tls.h (TLS_INIT_TP): Use INTERNAL_SYSCALL
	to call set_thread_area instead of hand written asm.
	(__NR_set_thread_area): Removed define.
	(TLS_FLAG_WRITABLE): Likewise.
	(__ASSUME_SET_THREAD_AREA): Remove check.
	(TLS_EBX_ARG): Remove define.
	(TLS_LOAD_EBX): Likewise.
2014-08-28 09:53:08 +02:00
Samuel Thibault
b0f955c9ac Simplify atomicity of socket creation in bind. 2014-08-28 00:46:44 +02:00
Allan McRae
529bf51595 Update x86 ULPs
Using gcc-4.9, i7-2620M, i686 Linux.
2014-08-27 13:36:02 +10:00
Siddhesh Poyarekar
eb72478a28 Remove unnecessary uses of NOT_IN_libc
If a IS_IN_* macro is defined, then NOT_IN_libc is always defined,
except obviously for IS_IN_libc.  There's no need to check for both.
Verified on x86_64 and i686 that the source is unchanged.

       * include/libc-symbols.h: Remove unnecessary check for
       NOT_IN_libc.
       * nptl/pthreadP.h: Likewise.
       * sysdeps/aarch64/setjmp.S: Likewise.
       * sysdeps/alpha/setjmp.S: Likewise.
       * sysdeps/arm/sysdep.h: Likewise.
       * sysdeps/i386/setjmp.S: Likewise.
       * sysdeps/m68k/setjmp.c: Likewise.
       * sysdeps/posix/getcwd.c: Likewise.
       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
       * sysdeps/s390/s390-32/setjmp.S: Likewise.
       * sysdeps/s390/s390-64/setjmp.S: Likewise.
       * sysdeps/sh/sh3/setjmp.S: Likewise.
       * sysdeps/sh/sh4/setjmp.S: Likewise.
       * sysdeps/unix/alpha/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise.
       * sysdeps/unix/sysv/linux/ia64/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/sparc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
       * sysdeps/x86_64/setjmp.S: Likewise.
2014-08-21 10:26:46 +05:30
Joseph Myers
d44a052c49 Fix powerpc32 __get_clockfreq for non-power4 (bug 17263).
In my powerpc32 testing I've observed misc/test-gettimebasefreq
failing.

This is a glibc build (soft-float, though that's not relevant here)
without any --with-cpu and without any special configuration of the
default CPU for GCC either.  In particular, it's one not using
sysdeps/powerpc/powerpc32/power4/hp-timing.h (although in fact the
processor I'm using for testing is POWER4-based), so hp_timing_t is
32-bit not 64-bit.  But the VDSO call being used by
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is generating a 64-bit result
(high part in r3, low part in r4).  The code extracting that result,
however, expects a result of the type hp_timing_t as passed to
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, meaning that only r3 (= 0) is
used and the value in r4 is ignored.  This patch fixes this by always
using uint64_t as the type in INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK -
reflecting the actual ABI (unconditional in the kernel) of that VDSO
call.  This is the minimal change for this issue - no check for
overflow, no change of the type of the timebase_freq variable or the
return type of __get_clockfreq to something other than hp_timing_t
(such a change would simply move the implicit conversions to the over
callers of that function), no change to hp_timing_t itself.

Tested for powerpc32 soft float.

	[BZ #17263]
	* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Include
	<stdint.h>.
	(__get_clockfreq): Use uint64_t instead of hp_timing_t in
	INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK call.
2014-08-13 16:06:18 +00:00
Siddhesh Poyarekar
e44c8b0eb7 Fix comment error that Jakub pointed out but I forgot to fix 2014-08-13 18:46:41 +05:30
Siddhesh Poyarekar
508ce3acd9 Disable x87 inline functions for x86_64 and SSE [BZ #17262]
Since:

commit 409e00bd69
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jan 29 07:51:41 2014 -0800

    Disable x87 inline functions for SSE2 math

    When i386 and x86-64 mathinline.h was merged into a single mathinline.h,
    "gcc -m32" enables x87 inline functions on x86-64 even when -mfpmath=sse
    and SSE2 is enabled.  It is a regression on x86-64.  We should check
    __SSE2_MATH__ instead of __x86_64__ when disabling x87 inline functions.

gcc-3.2 is unable to correctly compile x86_64 routines for llrint
since it gets redefined.  This is because gcc 3.2 does not set
__SSE2_MATH__ for x86_64, thus exposing the duplicate definition.

The correct fix ought to be to check for both __SSE2_MATH__ and
__x86_64__ and enable those bits only when neither are defined.

Tested fix with the reproducer for
409e00bd69 as well as with gcc-3.2.
2014-08-13 14:05:16 +05:30
H.J. Lu
b4acef1ffe Replace cpuid asm statement with __cpuid_count
The compiler doesn't know that the cpuid asm statement in intel_check_word
will trash RBX.  We are lucky that it doesn't cause any problems since
RBX is also used by compiler for other purposes so that RBX is saved and
restored.  This patch replaces it with __cpuid_count.

	[BZ #17259]
	* sysdeps/x86_64/cacheinfo.c (intel_check_word): Replace cpuid
	asm statement with __cpuid_count.
2014-08-12 17:02:51 -07:00
Joseph Myers
898c62f488 Fix powerpc-nofpu __fe_enabled_env and __fe_nonieee_env (bug 17261).
On powerpc, floating-point environment macros are defined as pointers
to constants in the library that contain the bit-patterns of the
desired environment, instead of being magic constants cast to pointer
type.

For soft-float, the bit-patterns used for fenv_t are not laid out the
same as for hard-float.  (e500 has a third layout used; that's not an
ABI issue because these values are only meaningful within a single
process, all of whose glibc libraries must come from the same build of
glibc.)  While the __fe_dfl_env value for soft-float was appropriate
for the soft-float fenv_t representation, the other two constants had
the same bit-patterns as for hard-float.  Those bit patterns had the
effect of having exceptions already raised, causing
math/test-fenv-return to fail; this patch fixes the patterns used.
(__fe_nonieee_env also had exceptions unmasked, though they should be
masked to match hard-float semantics.  Since there is no separate
non-IEEE mode for soft-float, it's most appropriate for
__fe_nonieee_env to be the same as __fe_dfl_env; this patch makes it
an alias.)

Tested for powerpc-nofpu.

	[BZ #17261]
	* sysdeps/powerpc/nofpu/fenv_const.c (__fe_enabled_env): Change
	value to 0.
	(__fe_nonieee_env): Define as an alias for __fe_dfl_env.
2014-08-12 20:31:54 +00:00
Bernard Ogden
4e75751cbb Check value of futex before updating in __lll_timedlock
2014-08-12  Bernard Ogden  <bernie.ogden@linaro.org>

	[BZ #16892]
	* sysdeps/nptl/lowlevellock.h (__lll_timedlock): Use
	atomic_compare_and_exchange_bool_acq rather than atomic_exchange_acq.
2014-08-12 12:57:27 +01:00
Wilco Dijkstra
656b84c2ef This patch adds new function libc_feholdsetround_noex_aarch64_ctx, enabling
further optimization. libc_feholdsetround_aarch64_ctx now only needs to
read the FPCR in the typical case, avoiding a redundant FPSR read.
Performance results show a good improvement (5-10% on sin()) on cores with
expensive FPCR/FPSR instructions.
2014-08-07 16:29:55 +00:00
Wilco
538e9e454d Fix performance issue in misaligned strcpy. 2014-08-07 14:30:31 +00:00
Adhemerval Zanella
d4795e4a43 PowerPC: Fix termios definitions
This patch fixes the incorrect guard by __USE_MISC of struct winsize and
struct termio in powerpc termios header.  Current states leads to build
failures if the program defines _XOPEN_SOURCE, but not _DEFAULT_SOURCE
or either _BSD_SOURCE or _SVID_SOURCE.  Without any definition,
__USE_MISC will not be defined and neither the struct definitions.

This patch copies the default Linux ioctl-types.h by adjusting only the
character control field (c_cc) size in struct termio.
2014-08-06 14:31:54 -04:00
Richard Henderson
27bb6dc0db alpha: Fix exception raising from soft-fp
Use the SSI_IEEE_RAISE_EXCEPTION function as from feraiseexcept,
instead of __ieee_get+set_fp_status.  Always raise the FP exceptions
from float-to-integer conversion.
2014-08-05 13:36:36 -07:00
Richard Henderson
d3f364d3c7 alpha: Remove linux lowlevellock.h
For real this time.
2014-08-05 09:06:36 -07:00
Bernard Ogden
e5292691ea MIPS - Remove mips lowlevellock.h.
* sysdeps/unix/sysv/linux/mips/lowlevellock.h: Remove file.
2014-08-04 22:12:03 +00:00
Will Newton
5b4bd2d4f0 AArch64: Remove lowlevellock.h
Remove lowlevellock.h in favour of the generic implementation. The
generic implementation was tested natively and introduces no
regressions.

ChangeLog:

2014-08-04  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/lowlevellock.h: Remove
	file.
2014-08-04 16:11:51 +01:00
Mike Frysinger
b76ae12144 ia64: define nocancel entry points in PSEUDO
The previous set of not-cancel.h headers (prior to the commit
2fbdf5339a) did not require the
arch to define nocancel entry points, so ia64 never did.
However, after the various files were merged, it became a hard
requirement for arches which mean ia64 failed to build.

Here we add dedicated entry points.  It'd be nice to merge
with the existing stubs like other arches do, but the ia64
asm does not lend itself to interleaving of functions.  If
someone has a suggestion on merging these, that'd be great,
but at least now we build & pass tests again.
2014-08-04 10:05:51 -04:00
Roland McGrath
43a94c647d IA64: Consolidate nptl/ subdirectories under linux/... 2014-08-04 10:00:52 -04:00
Roland McGrath
8f3c1fa42d IA64: Move NPTL public headers to sysdeps/ia64/nptl/. 2014-08-04 09:58:14 -04:00
Roland McGrath
ca08746f9f IA64: Define TLS_DEFINE_INIT_TP 2014-08-04 09:53:49 -04:00
Roland McGrath
9c925ff964 IA64: Consolidate NPTL/non versions of vfork 2014-08-04 09:50:41 -04:00
Roland McGrath
e641054cd8 IA64: Consolidate NPTL/non versions of clone 2014-08-04 09:06:51 -04:00
Andreas Schwab
dacdc86717 Fix missing <math_private.h> in ldbl-96 fma 2014-08-04 10:20:20 +02:00
Roland McGrath
277cfb315b Remove sysdeps/unix/sysv/linux/arm/lowlevellock.h 2014-08-01 18:59:48 -07:00
Richard Henderson
4896f04920 Force eval for fma implementations 2014-08-01 12:13:50 -10:00
Roland McGrath
6f64e7d75f ARM: Move PTR_MANGLE et al out of Linux-specific file. 2014-08-01 11:28:49 -07:00
Roland McGrath
f61a113fe0 Add __safe_fatal and use it in __pthread_unwind forwarder fallback. 2014-07-31 14:00:33 -07:00
Roland McGrath
9fe7e787ad Use __builtin_trap for ABORT_INSTRUCTION. 2014-07-31 13:07:19 -07:00
Roland McGrath
23fe486beb Split nptl-signals.h out from pthreadP.h 2014-07-31 11:37:48 -07:00
Stefan Liebler
f349489e7e [PATCH] S390: Fix remaining ONE_DIRECTION warning messages
This patch fixes the remaining ONE_DIRECTION warnings for s390 specific conversions.
It defines ONE_DIRECTION to 0 like the patch from Steve Ellcey:
https://www.sourceware.org/ml/libc-alpha/2014-05/msg00039.html

    Changelog:
    * sysdeps/s390/s390-64/utf16-utf32-z9.c
    (ONE_DIRECTION): Define.
    * sysdeps/s390/s390-64/utf8-utf16-z9.c
    (ONE_DIRECTION): Define.
    * sysdeps/s390/s390-64/utf8-utf32-z9.c
    (ONE_DIRECTION): Define.
2014-07-31 20:10:47 +02:00
Stefan Liebler
2f438e20ab S/390: Revert the jmp_buf/ucontext_t ABI change. 2014-07-31 20:04:54 +02:00
Ling Ma
05f3633da4 Improve 64bit memcpy performance for Haswell CPU with AVX instruction
In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx instruction.

The CPU2006 403.gcc benchmark indicates this patch improves performance
from 2% to 10%.
2014-07-30 08:02:35 -07:00
Adhemerval Zanella
a53fbd8e6c PowerPC: Fix gprof entry point for LE
This patch fixes the ELFv2 gprof entry point since the ABI
does not define function descriptors.  It fixes BZ#17213.
2014-07-30 09:01:25 -03:00
Jeff Layton
0961f7e1e3 fcntl-linux.h: add new definitions and manual updates for open file description locks
Open file description locks have been merged into the Linux kernel for
v3.15.  Add the appropriate command-value definitions and an update to
the manual that describes their usage.
2014-07-29 23:27:21 -04:00
Marcus Shawcroft
33ef2f0c76 Revert "aarch64: Add hp-timing.h"
This reverts commit 4052993954.

Conflicts:
	sysdeps/aarch64/hp-timing.h
2014-07-22 12:09:44 +01:00
Andreas Schwab
23329dcaf9 m68k: use generic lowlevellock.h 2014-07-18 23:35:11 +02:00
Maciej W. Rozycki
9c82da17b5 [BZ #17078] ARM: R_ARM_TLS_DESC prelinker support
This is a change to the dynamic linker to add prelinker support for the
R_ARM_TLS_DESC relocation.  Two cases can be considered here, the usual
one where lazy binding is in use and the less frequent one, where
immediate binding is requested via the use of the DF_BIND_NOW dynamic
flag (e.g. by using the GNU linker's "-z now" option).

This change only handles the first case.  In this scenario the prelinker
does what the dynamic linker would do, that is it preinitialises
R_ARM_TLS_DESC relocations with a pointer to the lazy specialization as
provided with the DT_TLSDESC_PLT dynamic tag.  A conflict is
additionally created and in the conflict resolution path the dynamic
linker complements the work by initialising the object's pointer as
indicated by the DT_TLSDESC_GOT dynamic tag to the linker's internal
lazy specialization worker function and also providing the associated
link map in the second entry of the GOT.  This step is required, because
if prelinking is successful at the run time, then the dynamic linker's
elf_machine_runtime_setup() function isn't called that would normally do
so.

The second case remains unresolved, because support for that scenario
has not been implemented in the prelinker.  In this case the lazy
specialization is unavailable and the DT_TLSDESC_PLT dynamic tag is not
present.

The prelinker could assume the common case of static specialization and
resolve the relocation, but that would require the exposure of dynamic
linker's specialization worker function.  Furthermore the dynamic linker
would have to handle the relocation in the conflict resolution path and
see if the dynamic specialization should be used instead.  This however
would require access to data structures currently not made available to
the conflict resolution path and therefore a redesign of this part of
the dynamic linker.

Alternatively the prelinker could defer all processing to the dynamic
linker's conflict resolution path, but that would require similar access
to the said data structures.

Therefore the prelinker issues an error instead and the dynamic linker
has assertions to check that DT_TLSDESC_PLT and DT_TLSDESC_GOT are in
use in its conflict resolution path.

This change resolves all TLS failures in the prelinker testsuite, as
noted in the bug report, as well as the small test case provided there.
Unfortunately we don't seem to have any hooks to factor in the prelinker
(if present on a system) to testing, so at this time this fix has to
rely on using the prelinker test suite and enabling TLS descriptors
there for coverage.

	[BZ #17078]
	* sysdeps/arm/dl-machine.h (elf_machine_rela)
	[RESOLVE_CONFLICT_FIND_MAP]: Handle R_ARM_TLS_DESC relocation.
	(elf_machine_lazy_rel): Handle prelinked R_ARM_TLS_DESC entries.
2014-07-17 19:22:05 +01:00
Joseph Myers
b21c2d5020 [PATCH 6/6] Split s390 out of main Linux kernel-features.h.
This patch splits s390 out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/s390/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__s390__]
	(__ASSUME_SOCKETCALL): Do not define.
2014-07-17 17:55:44 +00:00
Joseph Myers
067764ef47 [PATCH 5/6] Split sh out of main Linux kernel-features.h.
This patch splits sh out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/sh/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__sh__]
	(__ASSUME_SOCKETCALL): Do not define.
	(__ASSUME_ST_INO_64_BIT): Define unconditionally.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __sh__]
	(__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __sh__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __sh__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__sh__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
2014-07-17 17:54:43 +00:00
Joseph Myers
642530c1b4 [PATCH 4/6] Split powerpc out of main Linux kernel-features.h.
This patch splits powerpc out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__powerpc__]
	(__ASSUME_SOCKETCALL): Do not define.
	(__ASSUME_IPC64): Define unconditionally.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __powerpc__]
	(__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __powerpc__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __powerpc__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__powerpc__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL):
	Likewise.
2014-07-17 17:53:52 +00:00
Joseph Myers
03f7731518 [PATCH 3/6] Split sparc out of main Linux kernel-features.h.
This patch splits sparc out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/sparc/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__sparc__]
	(__ASSUME_SOCKETCALL): Do not define.
	(__ASSUME_SET_ROBUST_LIST): Define unconditionally.
	(__ASSUME_FUTEX_LOCK_PI): Likewise.
	[__sparc__] (__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__sparc__] (__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL): Likewise.
	(__ASSUME_REQUEUE_PI): Define unconditionally.
	[__LINUX_KERNEL_VERSION >= 0x020621 && __sparc__]
	(__ASSUME_RECVMMSG_SYSCALL): Do not define.
	[__sparc__] (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __sparc__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__sparc__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
2014-07-17 17:52:58 +00:00
Joseph Myers
083b1f7c12 [PATCH 2/6] Split i386 out of main Linux kernel-features.h.
This patch splits i386 out of the main Linux kernel-features.h.

Tested x86 that there are no changes to disassembly of installed
shared libraries.

	* sysdeps/unix/sysv/linux/i386/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__i386__]
	(__ASSUME_SOCKETCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020621 && __i386__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__i386__] (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __i386__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__i386__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
2014-07-17 17:51:52 +00:00
Joseph Myers
5be44ea623 [PATCH 1/6] Split x86_64 out of main Linux kernel-features.h.
This patch splits x86_64 out of the main Linux kernel-features.h.

Tested x86_64 that there are no changes to disassembly of installed
shared libraries.

	* sysdeps/unix/sysv/linux/x86_64/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__x86_64__]
	(__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020621 && __x86_64__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __x86_64__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100]
	(__ASSUME_GETCPU_SYSCALL): Likewise.
2014-07-17 17:49:45 +00:00
Joseph Myers
d95ffd4cfd Refactor handling of /lib64 etc. cases, move out of sysdeps/gnu/configure.ac.
This patch continues removing architecture-specific cases from
non-architecture-specific files by moving the logic to use directories
such as /lib64 out of sysdeps/gnu/configure.ac.

A new macro LIBC_SLIBDIR_RTLDDIR is created that sysdeps configure
scripts can use to declare the library directories to be used; the
logic was previously duplicated in configure fragments for aarch64,
mips and x32 as well as in sysdeps/gnu/configure.ac.  This macro is
used directly in sysdeps/gnu/configure.ac only to provide the /lib
default (the logic saying that with --prefix=/usr shared libraries go
in /lib not /usr/lib); the architecture cases formerly there are moved
into various new or existing configure.ac files.  The new macro is
also used in the various architecture fragments that already had such
logic.  In the x32 there was previously a configure fragment, but it
was a directly written one without a .ac file; now a .ac file is used
there instead to generate configure.

Tested x86_64 that the installed shared libraries, and the directory
structure of the installation, are unchanged by this patch.

There is an old bug report - bug 6441 - about library directories
changing after reconfiguring.  If this is still applicable - and I
haven't attempted to confirm it or review the old patch pointed to in
that bug - then this patch should reduce the number of places needing
changing in any fix.

	* aclocal.m4 (LIBC_SLIBDIR_RTLDDIR): New macro.
	* sysdeps/gnu/configure.ac: Use LIBC_SLIBDIR_RTLDDIR.  Remove
	cases for individual architectures.
	* sysdeps/gnu/configure: Regenerated.
	* sysdeps/unix/sysv/linux/aarch64/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR.
	* sysdeps/unix/sysv/linux/aarch64/configure: Regenerated.
	* sysdeps/unix/sysv/linux/mips/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR.
	* sysdeps/unix/sysv/linux/mips/configure: Regenerated.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure:
	Regenerated.
	* sysdeps/unix/sysv/linux/s390/s390-64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/s390/s390-64/configure: New generated
	file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/configure: New generated
	file.
	* sysdeps/unix/sysv/linux/x86_64/64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/x86_64/64/configure: New generated file.
	* sysdeps/unix/sysv/linux/x86_64/x32/configure.ac: New file.
	* sysdeps/unix/sysv/linux/x86_64/x32/configure: Generate.
2014-07-17 14:35:48 +00:00
Joseph Myers
29c4f53e2a Move architecture shlib-versions files to Linux-specific directories.
Various architectures have files such as sysdeps/<arch>/shlib-versions
whose contents are in fact entirely Linux-specific, relating only to
the symbol / shared library versions for the port to Linux on that
architecture, when any future port to a different OS on that
architecture would use the symbol version of the glibc release it goes
in, as standard for new ports.

This patch moves such files under sysdeps/unix/sysv/linux/, merging in
the contents of sysdeps/<arch>/nptl/shlib-versions in the process.
The only bits not moved are those relating to libgcc_s versions, which
don't appear OS-specific in the same way that glibc's symbol versions
so.  It deliberately does not change the regular expressions given for
matching configurations in each file; some match only Linux although
not Linux-specific, or match other OSes although Linux-specific.  It
is with a view to at least the following further cleanups:

* Move architecture-specific content from the toplevel shlib-versions
  and nptl/shlib-versions into sysdeps shlib-versions files, so
  eliminating another difference between ex-ports and non-ex-ports
  architectures.

* Likewise, for OS-specific content in shlib-versions files.

* At that point, the first field in shlib-versions files (the regular
  expression matching a configuration triplet) should be redundant, so
  eliminate that field and leave shlib-versions selection working
  purely on a sysdeps basis (with limited use of %ifdef in
  shlib-versions files when needed) rather than having its own
  separate mechanism to select what configuration information is
  relevant.

* Move the build of gnu/lib-names.h to a similar mechanism to that
  used for gnu/stubs.h (each library build installing a version of the
  header specifically for that build), so we can eliminate the
  duplication of soname information in the makefiles and get it purely
  from shlib-versions files again.

There may be other cleanups possible as well (in particular, I'm not
sure that all cases where the same "Earliest symbol set" information
is repeated for many different libraries actually should need to
repeat it rather than specifying it just once for DEFAULT for the
given configuration, and separately specifying any non-default choices
of soname).

Tested x86_64 that the installed shared libraries are unchanged by
this patch.

	* sysdeps/aarch64/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/aarch64/shlib-versions: ... here.
	* sysdeps/alpha/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/alpha/shlib-versions: ... here.
	* sysdeps/arm/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/arm/shlib-versions: ... here.
	* sysdeps/hppa/shlib-versions: Move all contents except for
	libgcc_s entry to ...
	* sysdeps/unix/sysv/linux/hppa/shlib-versions: ... here.  Merge in
	entry from ...
	* sysdeps/hppa/nptl/shlib-versions: ... here.  Remove file.
	* sysdeps/ia64/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/ia64/shlib-versions: ... here.  Merge in
	entry from ...
	* sysdeps/ia64/nptl/shlib-versions: ... here.  Remove file.
	* sysdeps/m68k/coldfire/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions: ... here.
	* sysdeps/microblaze/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/microblaze/shlib-versions: ... here.
	* sysdeps/mips/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/mips/shlib-versions: ... here.  Merge in
	entry from ...
	* sysdeps/mips/nptl/shlib-versions: ... here.  Remove file.
	* sysdeps/tile/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/tile/shlib-versions: ... here.
	* sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Merge in entry
	from ...
	* sysdeps/x86_64/64/shlib-versions: ... here.  Remove file.
	* sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Merge in
	entry from ...
	* sysdeps/x86_64/x32/shlib-versions: ... here.  Remove file.
2014-07-17 14:31:12 +00:00
Will Newton
57977c4bf3 ARM: Fix compiler warnings from atomic.h
__arch_compare_and_exchange_bool_*_int return a boolean so in the
dummy implementations for 8, 16 and 64 bits return zero rather than
oldval. Zero is used rather than TRUE or FALSE to avoid needing to
including any headers for these dummy functions.

ChangeLog:

2014-07-17  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/bits/atomic.h
	(__arch_compare_and_exchange_bool_8_int): Evaluate to zero.
	(__arch_compare_and_exchange_bool_16_int): Likewise.
	(__arch_compare_and_exchange_bool_64_int): Likewise.
2014-07-17 11:36:31 +01:00
Roland McGrath
37fccd4192 ARM: Clean up EABI-related configury 2014-07-16 15:18:36 -07:00
Roland McGrath
3df6f22e5f Separate Linuxisms from lowlevellock.h, make a generic one 2014-07-15 15:23:06 -07:00
H.J. Lu
f2fef657d8 Enable AVX2 optimized memset only if -mavx2 works
* config.h.in (HAVE_AVX2_SUPPORT): New #undef.
	* sysdeps/i386/configure.ac: Set HAVE_AVX2_SUPPORT and
	config-cflags-avx2.
	* sysdeps/x86_64/configure.ac: Likewise.
	* sysdeps/i386/configure: Regenerated.
	* sysdeps/x86_64/configure: Likewise.
	* sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
	memset-avx2 only if config-cflags-avx2 is yes.
	* sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
	Tests for memset_chk and memset only if HAVE_AVX2_SUPPORT is
	defined.
	* sysdeps/x86_64/multiarch/memset.S: Define multiple versions
	only if HAVE_AVX2_SUPPORT is defined.
	* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
2014-07-14 07:58:27 -07:00
Andreas Schwab
9d39d517a7 m68k: update libm test ULPs 2014-07-13 11:20:44 +02:00
Richard Henderson
a75b89b776 aarch64: Update libm-test-ulps 2014-07-11 10:57:48 -07:00
Adhemerval Zanella
bc1da1765e PowerPC: Fix build due missing lll_robust_trylock
Commit 887865f remove the lll_robust_trylock definition on all
architectures, however for powerpc both __lll_trylock and
__lll_cond_trylock were based on lll_robust_trylock definition.
This patch restore it with a different name.
2014-07-10 16:46:33 -05:00
Roland McGrath
c0c6bac945 Get rid of lll_robust_dead. 2014-07-10 11:21:54 -07:00
Roland McGrath
887865fcfa Get rid of lll_robust_trylock. 2014-07-10 10:57:57 -07:00
Siddhesh Poyarekar
d62aa75af1 Fix crash when system has no ipv6 address [BZ #17125]
Here's an updated patch to fix the crash in bug-ga2 when the system
has no configured ipv6 address.  I have taken a different approach of
using libc_freeres_fn instead of the libc_freeres_ptr since the former
gives better control over what is freed; we need that since cache may
or may not be allocated using malloc.

Verified that bug-ga2 works correctly in both cases and does not have
memory leaks in either of them.
2014-07-10 14:15:16 +05:30
David S. Miller
7000d82e01 Get rid of sparc specific NPTL internaltypes.h header.
* sysdeps/sparc/nptl/internaltypes.h: Delete.
	* sysdeps/sparc/nptl/sparc-nptl.h: New file.
	* sysdeps/sparc/nptl/pthread_barrier_destroy.c: Include it.
	* sysdeps/sparc/nptl/pthread_barrier_init.c: Likewise.
	* sysdeps/sparc/nptl/pthread_barrier_wait.c: Likewise.
	* sysdeps/sparc/nptl/sem_init.c: Likewise.
	* sysdeps/sparc/nptl/sem_post.c: Likewise.
	* sysdeps/sparc/nptl/sem_timedwait.c: Likewise.
	* sysdeps/sparc/nptl/sem_wait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/pthread_barrier_wait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_post.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_timedwait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_wait.c: Likewise.
2014-07-09 22:19:09 -07:00
David S. Miller
5efe06a176 Update sparc ULPS.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-07-09 17:20:01 -07:00
Andreas Schwab
4a2552c3eb Fix missing newline in test output 2014-07-09 11:07:24 +02:00
Andreas Schwab
c213442ddd Update i386 libm test ULPs 2014-07-09 10:53:46 +02:00
Will Newton
82374e65d7 Fix -Wundef warnings for SHARED
The definition of SHARED is tested with #ifdef pretty much everywhere
apart from these few places. The tlsdesc.c code seems to be copy and
pasted to a few architectures and there is one instance in the hppa
startup code.

ChangeLog:

2014-07-09  Will Newton  <will.newton@linaro.org>

	* sysdeps/aarch64/tlsdesc.c (_dl_unmap): Test SHARED with #ifdef.
	* sysdeps/arm/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/i386/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/x86_64/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/hppa/start.S (_start): Likewise.
2014-07-09 09:26:07 +01:00
Siddhesh Poyarekar
6680738a18 Fix Wundef warning for __cplusplus
All current uses of the __cplusplus macro only check if it is defined
or not.  Fix this #if to use $ifdef like the rest of the code.
2014-07-09 10:36:23 +05:30
Siddhesh Poyarekar
80b5c50588 Fix Wundef warning for ELF_MACHINE_NO_REL on i386 2014-07-08 22:52:45 +05:30
Adhemerval Zanella
27b75f56c9 PowerPC: Cleanup powerpc memmove
Now that MEMCPY_OK_FOR_FWD_MEMMOVE should be define on memcopy.h there
is no need to specialized powerpc memmove implementation.  This patch
moves the define set to powerpc memcopy and cleanup its definition on
powerpc code.
2014-07-08 09:16:15 -05:00
Adhemerval Zanella
e7f95bb5f0 PowerPC: Fix compiler warnings
This patch fixes some compiler due trailing data in #undef directives
and due missing prototypes.
2014-07-08 09:16:12 -05:00
Adhemerval Zanella
91f4b564bd PowerPC: Add ifunc tests for memmove
This patch add the missing ifunc tests definition for memmove ppc32
optimization patch (commit 07aedd7).
2014-07-08 09:16:09 -05:00
Adhemerval Zanella
87868c2418 PowerPC: Align power7 memcpy using VSX to quadword
This patch changes power7 memcpy to use VSX instructions only when
memory is aligned to quardword.  It is to avoid unaligned kernel traps
on non-cacheable memory (for instance, memory-mapped I/O).
2014-07-07 15:41:27 -05:00
Adhemerval Zanella
07aedd78b0 PowerPC: optimized memmove for POWER7/PPC32
This patch adds a optimized memmove for power7 by using the optimized
power7 memcpy for forward copying.
2014-07-07 15:41:27 -05:00
Adhemerval Zanella
17762f6625 PowerPC: optimized memmove for POWER7/PPC64
This patch adds an optimized memmove optimization for POWER7/powerpc64.
Basically the idea is to use the memcpy for POWER7 on non-overlapped
memory regions and a optimized backward memcpy for memory regions
that overlap (similar to the idea of string/memmove.c).

The backward memcpy algorithm used is similar the one use for memcpy for
POWER7, with adjustments done for alignment.  The difference is memory
is always aligned to 16 bytes before using VSX/altivec instructions.
2014-07-07 15:41:21 -05:00
Adhemerval Zanella
d6f68bbef4 PowerPC: memmove default implementation cleanup
This patch removes the powerpc specific logic in memmove and instead
include default implementation with MEMCPY_OK_FOR_FWD_MEMMOVE defined.
This lead in a increase performance, since the constraints to use
memcpy in powerpc code are too restrictive and memcpy can be used for
any forward memmove.
2014-07-07 14:46:44 -05:00
Adhemerval Zanella
3f17b03b09 PowerPC: Guard CALL_ELF check for ppc64 only in link.h
This patch fixes powerpc32 undef compiler warnings for _CALL_ELF,
since it is defined only for powerpc64.
2014-07-07 14:46:22 -05:00
Roland McGrath
f4c4021bc0 Remove old stub lowlevellock.h file. It is not even useful as documentation. 2014-07-07 09:29:34 -07:00
Roland McGrath
f083450f45 NPTL is no longer an add-on! 2014-07-07 09:29:06 -07:00
Roland McGrath
08192659bb Get rid of nptl/sysdeps/ entirely! 2014-07-07 09:28:38 -07:00
Siddhesh Poyarekar
96baf6ffc5 Add comment for MEMCPY_OK_FOR_FWD_MEMMOVE 2014-07-05 01:09:15 +05:30
Will Newton
6b7b14b26f ARM: Define ELF_MACHINE_NO_REL
Fix a -Wundef warning on ARM.

ChangeLog:

2014-07-04  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/dl-machine.h (ELF_MACHINE_NO_REL): Define.
2014-07-04 08:58:21 +01:00
Roland McGrath
3d9eb57c55 Fix ia64 build error in lll_futex_timed_wait_bitset 2014-07-03 22:03:14 -07:00
Roland McGrath
78b984ae2c Fix unwind.h configure check for bare environment. 2014-07-03 21:46:59 -07:00
Roland McGrath
2d5976a580 Add missing #include in sysdeps/alpha/fpu/s_nearbyint.c 2014-07-03 21:15:56 -07:00
Roland McGrath
c1f5acd4f4 Robustify Linux kernel headers configure checks 2014-07-03 20:35:42 -07:00
Roland McGrath
4d614fe5e0 S390: Quash unused variable warning due to no-op THREAD_SET_POINTER_GUARD. 2014-07-03 19:17:00 -07:00
Siddhesh Poyarekar
38851324d8 Restore subdir conditional for tst-timer dependency. 2014-07-03 18:52:51 -07:00
Richard Henderson
69862e2511 alpha: Remove nearbyint and nearbyintf implementations
The original implementation was written for EV5, which does not
record inexact in the status register for /SU (but no /I) insns.
But EV6 does record the inexact status; the lack of /I simply
means that the exception is suppressed.

Adding feholdexcept becomes the bulk of the overhead, so we might
as well use the default implementation.
2014-07-03 10:37:59 -07:00
Richard Henderson
d5e16ade14 alpha: Implement math_opt_barrier and math_force_eval 2014-07-03 08:56:55 -07:00
Richard Henderson
ca7b945c73 alpha: Fix lround implementations
Use chopped rounding to add 0.5.
2014-07-03 08:52:45 -07:00
Richard Henderson
cd1175a373 alpha: Remove round and roundf implementations
Two bugs in these implementations: First is that the add of 0.5
was not done in chopped rounding mode (easily fixable).  Second
is that the method generates incorrect inexact exceptions for
small integral values (not easily fixable).
2014-07-03 08:45:57 -07:00
Richard Henderson
8c682bb22c Rely on HP_TIMING_AVAIL implies HP_SMALL_TIMING_AVAIL 2014-07-03 08:38:41 -07:00
Richard Henderson
05502548e9 Always provide HP_SMALL_TIMING_AVAIL 2014-07-03 08:38:36 -07:00
Richard Henderson
4052993954 aarch64: Add hp-timing.h 2014-07-03 08:38:34 -07:00
Richard Henderson
86e1a7ff92 Unify hp-timing implementations
Provide an hp-timing-common.h for ports to use.
2014-07-03 08:38:30 -07:00
Richard Henderson
428dd03f5a Remove HP_TIMING_DIFF_INIT and dl_hp_timing_overhead
Without HP_TIMING_ACCUM, dl_hp_timing_overhead is write-only.
If we remove it, there's no point in HP_TIMING_DIFF_INIT either.
2014-07-03 08:38:25 -07:00
Richard Henderson
c39323e9d2 Removing HP_TIMING_ACCUM as unused 2014-07-03 08:38:21 -07:00
Richard Henderson
850e0e032b Removing HP_TIMING_ZERO as unused 2014-07-03 08:38:18 -07:00
Richard Henderson
7db48f6aab powerpc: Remove dummy hp-timing.h
It's the same as the generic dummy version.
2014-07-03 08:38:15 -07:00
Siddhesh Poyarekar
99f8dc9220 Fix -Wundef warning on PAGE_COPY_THRESHOLD
The PAGE_COPY_THRESHOLD macro is meant to be overridden by
architecture-specific pagecopy.h, but it is currently done only by
mach; all other architectures use the default.  Check to see if the
macro is defined in addition to whether it is set to a non-zero value.
2014-07-03 01:49:43 +05:30
Vidya Ranganathan
bc8ea38590 PowerPC: strcat optimization for PPC64/POWER7
This patch adds an ifunc power7 strcat symbol that uses the logic on
sysdeps/powerpc/strcat.c but call power7 strlen/strcpy symbols instead
of default ones.
2014-07-02 14:04:21 -05:00
Roland McGrath
fe5f34e470 Add missing #include for MIN use in dl-sysdep.c. 2014-07-02 11:10:08 -07:00
Siddhesh Poyarekar
256aa66596 Fix typo in macro name
It is _POSIX_SIGNALS and not _POSUX_SIGNALS
2014-07-02 15:09:39 +05:30
Carlos O'Donell
d34570a6b8 hppa: Remove GLIBC_2.3 from librt.abilist.
This commit removes the aio_cancel and aio_cancel64 symbols at
GLIBC_2.3 from the ABI baseline. The ABI baseline is now complete
for hppa and considered stable.
2014-07-02 03:18:26 -04:00
Carlos O'Donell
ccf431ffe1 hppa: Add ABI baselines.
The following ABI baselines were tested against several old releases
of debian and gentoo. Several problems were discovered and fixed as
part of developing the ABI baselines.

Firstly, libBrokenLocale on gentoo exports __ctype_get_mb_cur_max
as @@GLIBC_2.0, but it should be @@GLIBC_2.2 since that's the minimum
version defined in shlib-versions for hppa. I don't know when this
broke, but master properly parses hppa's shlib-versions which clearly
lists libBrokenLocale as defaulting to GLIBC_2.2. Therefore I'm
accepting GLBIC_2.2 as the correct version for this symbol and setting
the baseline to that, despite the fact that the present distribution
is wrong. I don't expect that any new applications should be using
libBrokenLocale, so it should match the oldest behaviour which is to
export a GLIBC_2.2 symbol. For example in debian's 2.7 has it at
version GLIBC_2.2.

Secondly, aio_cancel and aio_cancel64 previously had a compat symbol
at version @GLIBC_2.1 with a new symbol at @@GLIBC_2.3[1]. During the
Linuxthreads to NPTL transition the file aio_cancel.c was lost for hppa
and that resulted in just @@GLIBC_2.1 versions of these symbols being
exported. The @@GLIBC_2.1 version works correctly and uses the right
value of ECANCELLED. Therefore if I were to fix this today it might
break correctly working applications using aio_cancel*@GLIBC_2.1 by
causing those to use the old aio_cancel that used the older value
of ECANCELLED. Thus the best option is to accept that the ABI changed
and ignore older applications in favour of newer applications. The
best thing to do is cleanup the version files (included in the patch).

The rest of the ABI was as expected (ignoring __p_type_syms size
change in 2008).
2014-07-01 23:59:47 -04:00
Roland McGrath
ca06321df0 Add missing #include for MIN/MAX users. 2014-07-01 15:01:24 -07:00
Richard Henderson
631021e0aa alpha: Fix isnan
The isunordered formulation raises SIGFPE for SNaN.
2014-07-01 09:54:29 -07:00
Richard Henderson
a1ac3184fa alpha: Update libm-test-ulps 2014-07-01 09:54:27 -07:00
Stefan Liebler
0c1d731ff9 S/390: Regenerate ULPs 2014-07-01 11:04:58 -03:00
Joseph Myers
b0cb309635 MicroBlaze: Update kernel-features.h for syscalls added in 3.15
Now that the MicroBlaze 3.15 kernel has the pselect6, preadv and
pwritev syscalls, this patch updates kernel-features.h so they are
assumed to be present for 3.15 and later kernels.

2014-06-17  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x030f00] (__ASSUME_PSELECT): Do not
	undefine.
	[__LINUX_KERNEL_VERSION >= 0x030f00] (__ASSUME_PREADV): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030f00] (__ASSUME_PWRITEV): Likewise.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-07-01 14:57:59 +10:00
Roland McGrath
4d76cb3935 MicroBlaze: Consolidate nptl/ subdirectories under linux/...
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-07-01 14:57:58 +10:00
Roland McGrath
83d7d24b96 MicroBlaze: Consolidate NPTL/non versions of vfork 2014-07-01 14:57:57 +10:00
Roland McGrath
862e0f2721 MicroBlaze: Move NPTL public headers to sysdeps/microblaze/nptl/. 2014-07-01 14:57:56 +10:00
Roland McGrath
9bca952acb MicroBlaze: Define TLS_DEFINE_INIT_TP 2014-07-01 14:57:56 +10:00
Roland McGrath
8b4b5da7b6 MicroBlaze: Convert fork.c to arch-fork.h 2014-07-01 14:57:50 +10:00
David Holsgrove
0cdcad1769 MicroBlaze: Add missing sysdep-cancel.h implementation
And update socket.S, Makefile to use *_nocancel definitions.

Absence of sysdep-cancel.h was not apparent until Roland's
not-cancel.h unification.

2014-06-30  David Holsgrove  <david.holsgrove@xilinx.com>

  * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: New file
  * sysdeps/unix/sysv/linux/microblaze/socket.S: Update SINGLE_THREAD_P
  * sysdeps/unix/sysv/linux/microblaze/Makefile: Add to libpthread-routines

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-07-01 09:58:03 +10:00
Adhemerval Zanella
9b71d0e38c Update powerpc-fpu ULPs. 2014-06-30 17:38:43 -04:00
Joseph Myers
ae05a9d77f Regenerate MIPS libm-test-ulps.
This patch regenerates libm-test-ulps for MIPS.

	* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
2014-06-30 21:34:20 +00:00
Joseph Myers
a7672a2f81 Regenerate powerpc-nofpu libm-test-ulps.
This patch regenerates libm-test-ulps for powerpc-nofpu.

	* sysdeps/powerpc/nofpu/libm-test-ulps: Regenerated.
2014-06-30 21:26:49 +00:00
Joseph Myers
665390c2e7 Regenerate ARM libm-test-ulps.
This patch regenerates libm-test-ulps for ARM.  As before it may be
useful for someone building for a configuration with VFMA enabled to
do a followup regeneration for any additional ulps in that
configuration.

Committed.

	* sysdeps/arm/libm-test-ulps: Regenerated.
2014-06-30 21:20:35 +00:00
Roland McGrath
46f1d8a6b5 ARM: Split Linuxism out of sysdeps/arm/nptl/tls.h 2014-06-30 11:19:22 -07:00
Joseph Myers
ce9c5b3e95 Fix ldbl-128 expm1l spurious underflow (bug 16539).
This patch fixes spurious underflows from ldbl-128 expm1l, as reported
in <https://sourceware.org/ml/libc-alpha/2014-06/msg00835.html> and
exposed by the tests added for such a bug in the x86 / x86-64
version.  The bug and fix are essentially the same, so no separate bug
is filed in Bugzilla.

Tested for mips64.

	[BZ #16539]
	* sysdeps/ieee754/ldbl-128/s_expm1l.c: Include <float.h>.
	(__expm1l): Return argument unchanged when small but not
	subnormal.
2014-06-30 17:38:16 +00:00
Maciej W. Rozycki
2125f67454 sysdeps/unix/sysv/linux/bits/socket.h: Correct formatting
* sysdeps/unix/sysv/linux/bits/socket.h: Adjust macro formatting
	throughout.
2014-06-30 10:38:49 +01:00
Joseph Myers
edea402804 Fix ldbl-128 powl sign of result in overflow / underflow cases (bug 17097).
This patch fixes bug 17097, ldbl-128 powl producing overflowing /
underflowing results with positive sign when the result should have
been negative.  This was shown up by the tests in non-default rounding
modes added by my patch for bug 16315, but isn't actually limited to
non-default rounding modes: rather, when rounding to nearest the
wrappers produced a result with the correct sign and so always hid the
bug unless -lieee was used to disable the wrappers.  The problem is
that in the cases where Y is large enough that the result overflows or
underflows for X not very close to 1, but not large enough to overflow
or underflow for all X != +/- 1 (in the latter case Y is always an
even integer), a positive overflowing / underflowing result is always
returned, rather than one with the correct sign.  This patch moves the
relevant part of computation of the sign earlier and returns a result
of the correct sign.

Tested for mips64.

	[BZ #17097]
	* sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Return
	result with correct sign in case of exponents that produce
	overflow except for X very close to 1.
2014-06-29 11:49:08 +00:00
Siddhesh Poyarekar
64df73c2ea Fix Wundef warning for MEMCPY_OK_FOR_FWD_MEMMOVE
Define MEMCPY_OK_FOR_FWD_MEMMOVE in memcopy.h and let arch-specific
implementations of that file override the value if necessary.  This
override is only useful for tile and moving this macro to memcopy.h
allows us to remove the tile-specific memmove.c.
2014-06-28 06:05:24 +05:30
Joseph Myers
f1eafb41fa Remove shlib-versions ABI names support.
shlib-versions files can contain ABI lines that map triplets to a
canonical ABI name.  This name was once used for various purposes
where test baseline files for different ABIs went in a single
directory; now these purposes use sysdeps files, generation of headers
which have per-ABI variants uses abi-variants and related Makefile
variables and the shlib-versions ABI names are unused.  This patch
duly removes those lines and associated build system support for them.

Tested for x86_64 (both a full testsuite run and confirming the
installed shared libraries are unchanged by the patch).

	* Makeconfig ($(common-objpfx)soversions.mk): Do not generate
	abi-name definition.
	* scripts/soversions.awk: Do not handle or generate ABI lines.
	* shlib-versions: Remove ABI entries.
	* sysdeps/powerpc/nofpu/shlib-versions: Remove file.
	* sysdeps/x86_64/x32/shlib-versions: Remove ABI entry.
2014-06-27 20:24:23 +00:00
Roland McGrath
37caf178e2 MIPS: Consolidate nptl/ subdirectories under linux/... 2014-06-27 11:41:04 -07:00
Roland McGrath
58eb0862c3 MIPS: Consolidate NPTL/non versions of vfork 2014-06-27 11:18:10 -07:00
Joseph Myers
cb403c34c6 Remove relro configure test.
This patch removes the configure test for working -z relro.

The use of -z relro in Makeconfig became unconditional with

commit 2e6ab1df44c412bb9d30b26a4d8a679150a7e375
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Oct 28 06:44:04 2006 +0000

    Remove conditional code which now is unnecessary.

(commit reference from git://repo.or.cz/glibc/history), so since then
the configure test has not controlled anything about how glibc is
built - simply about whether configure succeeds and allows a build to
be attempted.  The test for whether the option did something useful
(as opposed to whether it exists - which we can certainly just assume
by now) was originally added in
<https://sourceware.org/ml/libc-hacker/2004-09/msg00069.html> to
disable the option in a case when it did nothing useful on ia64 (as a
result of something deliberate in the linker on ia64).  Since 2006
that disabling has been of no effect, and given that the current test
does not set libc_relro_required for ia64, it does nothing whatever
useful for the original motivating case.  Also at around the same time
in 2006 the test was made to give an error for missing or broken -z
relro support on various architectures.

So effectively all the test does now is verify that, on certain
architectures, the linker has not been changed deliberately to make
the option ineffective.  I see no apparent reason why such a change
should be expected, or why the build should be stopped if it were to
be made (any more than we disallow build on ia64); I think we can
trust binutils patch review to point out the consequences of any
change to COMMONPAGESIZE setting.  The only thing that might now make
sense would be disabling the -z relro use on an architecture-specific
basis if there were an architecture-specific reason to consider that
to make sense; it would be for the ia64 maintainer to decide if that
makes sense for ia64 at present, but I think that could be done
through sysdeps Makefiles - no special configure tests needed.

Tested for x86_64 that this patch makes no change to the installed
shared libraries.

Together with
<https://sourceware.org/ml/libc-alpha/2014-06/msg00788.html> (pending
review) this substantially eliminates architecture-specific cases from
architecture-independent configure.ac files.  There remains an i386
case in sysdeps/mach/hurd/configure.ac that should properly move to
the i386 subdirectory.  (There are also OS-specific cases outside
OS-specific directories; in principle I think should should also
move.)

	* configure.ac (libc_commonpagesize): Remove variable.
	(libc_relro_required): Likewise.
	(libc_cv_z_relro): Remove configure test.
	* configure: Regenerated.
	* sysdeps/aarch64/preconfigure (libc_commonpagesize): Do not set
	variable.
	(libc_relro_required): Likewise.
	* sysdeps/alpha/preconfigure (libc_commonpagesize): Likewise.
	(libc_relro_required): Likewise.
	* sysdeps/arm/preconfigure.ac (libc_commonpagesize): Likewise.
	(libc_relro_required): Likewise.
	* sysdeps/arm/preconfigure: Regenerated.
	* sysdeps/ia64/preconfigure: Remove file.
	* sysdeps/tile/preconfigure (libc_commonpagesize): Do not set
	variable.
	(libc_relro_required): Likewise.
2014-06-27 16:51:22 +00:00
Joseph Myers
be25493251 Fix yn overflow handling in non-default rounding modes (bug 16561, bug 16562).
This patch fixes bugs 16561 and 16562, bad results of yn in overflow
cases in non-default rounding modes, both because an intermediate
overflow in the recurrence does not get detected if the result is not
an infinity and because an overflowing result may occur in the wrong
sign.  The fix is to set FE_TONEAREST mode internally for the parts of
the function where such overflows can occur (which includes the call
to y1 - where yn is used to compute a Bessel function of order -1,
negating the result of y1 isn't correct for overflowing results in
directed rounding modes) and then compute an overflowing value in the
original rounding mode if the to-nearest result was an infinity.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 and powerpc32 to test the ldbl-128 and ldbl-128ibm changes.

(The tests for these bugs were added in my previous y1 patch, so the
only thing this patch has to do with the testsuite is enable yn
testing in all rounding modes.)

	[BZ #16561]
	[BZ #16562]
	* sysdeps/ieee754/dbl-64/e_jn.c: Include <float.h>.
	(__ieee754_yn): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/flt-32/e_jnf.c: Include <float.h>.
	(__ieee754_ynf): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-128/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-96/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/i386/fpu/fenv_private.h [!__SSE2_MATH__]
	(libc_feholdsetround_ctx): New macro.
	* math/libm-test.inc (yn_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps : Likewise.
2014-06-27 14:52:13 +00:00
Joseph Myers
b351d85aa2 Fix MIPS64 *_nocancel gp setup.
The 64-bit MIPS ABIs involve the caller setting up t9 ($25) to the
address of the called function, and the called function then using
this in a .cpsetup directive to compute gp.  The .cpsetup directive
needs to name the function to which t9 points for this purpose.  In
the definition of *_nocancel functions, the directive pointed to the
normal entry point rather than the _nocancel one, resulting in
segfaults when the _nocancel functions were used.  This patch corrects
the function name used in the directive.  (It seems the bug was latent
until Roland's not-cancel.h unification, with the _nocancel entry
points not previously being used - so not user-visible in a release,
so no Bugzilla entry required.)

Tested mips64 sufficiently to confirm the previously seen segfaults
are fixed.

	* sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
	[__PIC__] (PSEUDO): Use name of _nocancel entry point in
	corresponding .cpsetup call.
2014-06-26 23:55:46 +00:00
Roland McGrath
3cb4de4741 ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
Roland McGrath
a3dd035d9d Add missing #include <fpu_control.h> to ARM fesetenv/feupdateenv. 2014-06-26 13:35:31 -07:00
Joseph Myers
a8779c28a8 Remove configure tests for assembler CFI support.
This patch removes configure tests for assembler CFI support (and
thereby eliminates an architecture-specific case in the main
configure.ac), instead assuming that support is present
unconditionally.

The main test was added in 2003 around the time CFI support was added
to the assembler.  cfi_personality and cfi_lsda support were added to
the assembler in 2006.  cfi_sections support was added in 2009, a few
weeks before binutils 2.20 was released; it's in 2.20, the minimum
supported version, so even that configure test is obsolete.

Tested x86_64 that the installed shared libraries are unchanged by
this patch.

	* configure.ac (libc_cv_asm_cfi_directives): Remove configure
	test.
	* configure: Regenerated.
	* config.h.in (HAVE_ASM_CFI_DIRECTIVES): Remove macro undefine.
	* sysdeps/arm/configure.ac (libc_cv_asm_cfi_directive_sections):
	Remove configure test.
	* sysdeps/arm/configure: Regenerated.
	* sysdeps/nptl/configure.ac: Do not check
	libc_cv_asm_cfi_directives.
	* sysdeps/nptl/configure: Regenerated.
	* sysdeps/x86_64/nptl/configure.ac: Remove file.
	* sysdeps/x86_64/nptl/configure: Remove generated file.
	* b/sysdeps/generic/sysdep.h [HAVE_ASM_CFI_DIRECTIVES]: Make code
	unconditional.
	[!HAVE_ASM_CFI_DIRECTIVES]: Remove conditional code.
2014-06-26 17:33:32 +00:00
Siddhesh Poyarekar
4cf5b6d0d7 Fix Wundef warning for ELF_MACHINE_NO_RELA
This patch defines ELF_MACHINE_NO_RELA on all architectures.  Tested
only on x86_64 to verify that the sources before and after are
identical except for two instructions that pass the current line
number in dl-machine.h to assert_fail.
2014-06-26 22:30:40 +05:30
Roland McGrath
d8a483f3ef S390: Consolidate nptl/ subdirectories under linux/... 2014-06-26 09:34:34 -07:00
Roland McGrath
52ae23b4bf Move remaining S390 code out of nptl/. 2014-06-26 09:31:11 -07:00
Roland McGrath
39507e4a6c S390: Consolidate NPTL/non versions of vfork 2014-06-26 09:30:52 -07:00
Roland McGrath
e549ee5658 S390: Consolidate NPTL/non versions of clone 2014-06-26 09:30:33 -07:00
Roland McGrath
6ad2df0bda AArch64: Consolidate nptl/ subdirectories under linux/... 2014-06-26 09:29:24 -07:00
Roland McGrath
7c1c1d8ec3 MIPS: Consolidate NPTL/non versions of clone 2014-06-25 14:50:58 -07:00
Joseph Myers
74385da564 Remove __ASSUME_O_CLOEXEC / O_CLOEXEC conditionals in sysdeps/unix/sysv/linux/.
This patch removes conditionals on __ASSUME_O_CLOEXEC, and on
O_CLOEXEC being defined, in sysdeps/unix/sysv/linux/, now that
O_CLOEXEC support can be unconditionally assumed.

The patch is conservative in what it changes and further followup
cleanups may be possible.  It may be possible to remove dl-opendir.c,
but the patch does not do so, just removing a redundant undefine and
redefine of __ASSUME_O_CLOEXEC.  Also, __ASSUME_O_CLOEXEC is defined
unconditionally for Hurd as well as Linux.  Thus, if we decide that
O_CLOEXEC support is a required feature of any glibc port, we could
remove __ASSUME_O_CLOEXEC and all conditionals on it throughout glibc,
rather than just cleaning up sysdeps/unix/sysv/linux/.

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/dl-opendir.c (__ASSUME_O_CLOEXEC): Do
	not undefine and redefine.
	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs)
	[O_CLOEXEC]: Make code unconditional.
	(__get_nprocs) [!O_CLOEXEC]: Remove conditional code.
	* sysdeps/unix/sysv/linux/shm_open.c: Do not include
	<kernel-features.h>.
	[O_CLOEXEC && !__ASSUME_O_CLOEXEC] (have_o_cloexec): Remove
	conditional variable definition.
	(shm_open) [O_CLOEXEC]: Make code unconditional.
	(shm_open) [!O_CLOEXEC || !__ASSUME_O_CLOEXEC]: Remove conditional
	code.
2014-06-25 20:29:45 +00:00
Joseph Myers
c2570a0b35 Move USE_REGPARMS define to sysdeps/i386/configure.ac.
This patch moves the USE_REGPARMS define from the toplevel
configure.ac to sysdeps/i386/configure.ac.

Tested x86 that the disassembly of installed shared libraries is
unchanged by this patch.

	* configure.ac (USE_REGPARMS): Don't define here.
	* configure: Regenerated.
	* sysdeps/i386/configure.ac (USE_REGPARMS): Define here.
	* sysdeps/i386/configure: Regenerated.
2014-06-25 20:26:14 +00:00
Joseph Myers
11b076bbae Remove stray includes of kernel-features.h.
Now that files using __ASSUME_* macros have been made by
<https://sourceware.org/ml/libc-alpha/2014-06/msg00543.html> to
include <kernel-features.h> directly, any include from a file not
using __ASSUME_* macros can safely be removed (as there will no longer
be some other file relying on indirect inclusion via a header from
which the include is being removed).

This patch removes such unnecessary kernel-features.h includes.

Tested x86_64 that disassembly of installed shared libraries is
unchanged by this patch, except for line numbers in calls to
__assert_fail from libc.so and ld.so.

2014-06-23  Joseph Myers  <joseph@codesourcery.com>

	* nptl/createthread.c: Don't include kernel-features.h.
	* nptl/pthread_cancel.c: Likewise.
	* nptl/pthread_condattr_setclock.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pthread_sigqueue.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/raise.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_create.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_delete.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_getoverr.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_gettime.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_routines.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_settime.c: Likewise.
	* nscd/gai.c: Likewise.
	* nss/nss_db/db-open.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Likewise.
	* sysdeps/sh/nptl/tls.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/adjtime.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/check_pf.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_getcpuclockid.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_getres.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_gettime.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_nanosleep.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_settime.c: Likewise.
	* sysdeps/unix/sysv/linux/dl-execstack.c: Likewise.
	* sysdeps/unix/sysv/linux/dl-osinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/futimesat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/poll.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c: Likewise.
	* sysdeps/unix/sysv/linux/getcwd.c: Likewise.
	* sysdeps/unix/sysv/linux/getpagesize.c: Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/mmap64.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/xstat.c: Likewise.
	* sysdeps/unix/sysv/linux/ia64/system.c: Likewise.
	* sysdeps/unix/sysv/linux/if_index.c: Likewise.
	* sysdeps/unix/sysv/linux/ifaddrs.c: Likewise.
	* sysdeps/unix/sysv/linux/ifreq.c: Likewise.
	* sysdeps/unix/sysv/linux/ldsodefs.h: Likewise.
	* sysdeps/unix/sysv/linux/lutimes.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/nptl/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/accept4.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/netlinkaccess.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/prof-freq.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/system.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c: Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.
	* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/system.c: Likewise.
	* sysdeps/unix/sysv/linux/syslog.c: Likewise.
	* sysdeps/unix/sysv/linux/system.c: Likewise.
	* sysdeps/unix/sysv/linux/testrtsig.h: Likewise.
	* sysdeps/unix/sysv/linux/timespec_get.c: Likewise.
	* sysdeps/unix/sysv/linux/ttyname.c: Likewise.
	* sysdeps/unix/sysv/linux/ttyname_r.c: Likewise.
	* sysdeps/unix/sysv/linux/utimensat.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/xstatconv.h: Likewise.
2014-06-25 18:09:01 +00:00
Joseph Myers
3e239be647 Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments.
This patch makes non-ex-ports architectures set base_machine and
machine based on the original configured machine value in preconfigure
fragments, like ex-ports architectures, rather than in the toplevel
configure.ac.

Tested x86 that the disassembly of installed shared libraries is
unchanged by the patch.

	* configure.ac (base_machine): Do not set specially for particular
	machines here.
	* configure: Regenerated.
	* sysdeps/powerpc/preconfigure: Move machine and base_machine
	settings from configure.ac.
	* sysdeps/i386/preconfigure: New file.
	* sysdeps/s390/preconfigure: Likewise.
	* sysdeps/sh/preconfigure: Likewise.
	* sysdeps/sparc/preconfigure: Likewise.
2014-06-25 17:52:56 +00:00
Roland McGrath
74836003ed SPARC: Consolidate unnecessary nptl/ subdirectories. 2014-06-25 10:04:14 -07:00
Roland McGrath
06d50baa34 SPARC: Consolidate nptl/ subdirectories under linux/... 2014-06-25 10:03:52 -07:00
Joseph Myers
a4ccbc9b24 Remove __ASSUME_XFS_RESTRICTED_CHOWN.
This patch removes the __ASSUME_XFS_RESTRICTED_CHOWN macro, now it can
be presumed to be defined unconditionally.  I'm not sure if what's
left of __statfs_chown_restricted is actually useful (if not, a
followup could remove it), but I left it there to keep the patch
conservative and avoid changing the code generated for glibc.

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by the patch.

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_XFS_RESTRICTED_CHOWN): Remove macro.
	* sysdeps/unix/sysv/linux/pathconf.c (__statfs_chown_restricted)
	[__ASSUME_XFS_RESTRICTED_CHOWN]: Make code unconditional.
	(__statfs_chown_restricted) [!__ASSUME_XFS_RESTRICTED_CHOWN]:
	Remove conditional code.
2014-06-25 16:39:33 +00:00
Will Newton
9aea0cb842 ARM: Add support for AT_HWCAP2 in _dl_procinfo
Add support for the new HWCAP2 values for ARMv8 added in the
3.15 kernel. Tested using QEMU which supports these extensions.

ChangeLog:

2014-06-25  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/arm/dl-procinfo.c
	(_dl_arm_cap_flags): Add HWCAP2 values.
	* sysdeps/unix/sysv/linux/arm/dl-procinfo.h
	(_DL_HWCAP_COUNT): Increase to 37.
	(_DL_HWCAP_LAST): New define.
	(_DL_HWCAP2_LAST): New define.
	(_dl_procinfo): Add support for printing
	AT_HWCAP2 entries.
	(_dl_string_hwcap): Use _dl_hwcap_string.
2014-06-25 16:02:04 +01:00
Adhemerval Zanella
6eaa65cefb Update powerpc-fpu ULPs. 2014-06-25 09:57:39 -05:00
Joseph Myers
cecf2ed43a Remove __ASSUME_UTIMENSAT.
This patch removes the __ASSUME_UTIMENSAT macro, now it can be
unconditionally assumed to be true.

This shows that the only live uses of __ASSUME_UTIMES are in utimes.c
and they are only live for hppa.  I intend a followup patch to make
__ASSUME_UTIMES into an hppa-specific macro (not used or defined
outside sysdeps/unix/sysv/linux/hppa/).

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMENSAT):
	Remove macro.
	* sysdeps/unix/sysv/linux/futimes.c: Do not include
	<kernel-features.h>.
	[__NR_utimensat && !__ASSUME_UTIMENSAT] (miss_utimensat): Remove
	conditional variable definition.
	(__futimes): Update comment.
	(__futimes) [__ASSUME_UTIMENSAT]: Make code unconditional.
	(__futimes) [!__ASSUME_UTIMENSAT]: Remove conditional code.
2014-06-25 11:36:10 +00:00
Joseph Myers
a638de828d Fix exp10 spurious underflows (bug 16560).
This patch fixes spurious underflows from exp10 for arguments near 0
(part of bug 16560; that bug also includes spurious underflows from
exp2, which are not fixed by this patch).  The problem is underflows
in the internal computation converting the exp10 argument to arguments
for exp (with extra precision), and the fix is simply to return 1
early for arguments near enough to 0 (just as arguments with large
enough magnitude have their own overflow / underflow logic at the
start of the function).

Tested x86_64 and x86 and ulps updated accordingly; also tested for
powerpc32 and mips64 to validate the ldbl-128ibm and ldbl-128 changes.

	[BZ #16560]
	* sysdeps/ieee754/dbl-64/e_exp10.c (__ieee754_exp10): Return 1 for
	arguments close to 0.
	* sysdeps/ieee754/ldbl-128/e_exp10l.c (__ieee754_exp10l):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_exp10l.c (__ieee754_exp10l):
	Likewise.
	* math/auto-libm-test-in: Add more tests of exp10.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2014-06-25 11:33:22 +00:00
Joseph Myers
0f5b71850e Remove __ASSUME_COMPLETE_READV_WRITEV.
This patch removes the __ASSUME_COMPLETE_READV_WRITEV
kernel-features.h macro, now that it can be unconditionally assumed to
be true.  (The relevant kernel feature was added some time between 2.0
and 2.2, and this macro is only used in sysdeps/unix/sysv/linux/.)

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_COMPLETE_READV_WRITEV): Remove macro.
	* sysdeps/unix/sysv/linux/readv.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
	[!UIO_FASTIOV] (UIO_FASTIOV): Remove macro.
	(__libc_readv) [__ASSUME_COMPLETE_READV_WRITEV]: Make code
	unconditional.
	(__libc_readv) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove
	conditional code.
	* sysdeps/unix/sysv/linux/writev.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
	[!UIO_FASTIOV] (UIO_FASTIOV): Remove macro.
	(__libc_writev) [__ASSUME_COMPLETE_READV_WRITEV]: Make code
	unconditional.
	(__libc_writev) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove
	conditional code.
2014-06-25 11:31:51 +00:00
Will Newton
c7aec4beb1 sysdeps/posix/tempname.c: Merge from gnulib
Partial merge from gnulib which fixes a number of -Wundef warnings.
The parts that differ from gnulib are the header comment, use of
__glibc_unlikely, a #define of __secure_getenv and the use of tabs.
The majority of the patch is cosmetic comment changes, the only runtime
change is an abort if an unknown kind is passed to __gen_tempname.

ChangeLog:

2014-06-25  Will Newton  <will.newton@linaro.org>

	* sysdeps/posix/tempname.c: Merge from gnulib, cosmetic
	comment changes throughout the file.  Remove checks
	for HAVE_*_H definitions that are not required.
	(__gen_tempname): Call abort if an unknown kind value is
	passed.
2014-06-25 10:52:51 +01:00
Andreas Schwab
c5241f9575 m68k: Add compat symbols for scalbln* 2014-06-25 09:38:09 +02:00
Siddhesh Poyarekar
911422da02 Add compat symbols for scalb* in i386
Bring back symbols into libc.so for scalb* functions.  They are no
longer used but unfortunately they're now part of the ABI.
2014-06-25 08:47:13 +05:30
Roland McGrath
0d749bbeba x86: Consolidate unnecessary nptl/ subdirectories. 2014-06-24 19:17:43 -07:00
Joseph Myers
4060283dec Fix x86/x86_64 expm1l spurious underflow exceptions (bug 16539).
This patch fixes bug 16539, spurious underflow exceptions from x86 /
x86-64 expm1l.  The problem is that the computation of a base-2
exponent with extra precision involves spurious underflows for
arguments that are small but not subnormal, so a check is added to
just return the argument in those cases.  (If the argument *is*
subnormal, underflowing is correct and the existing code will always
underflow, so it suffices to keep using the existing code in that
case; some expm1 implementations have a bug (bug 16353) with missing
underflow exceptions, but I don't think there's such a bug in this
particular version.)

Tested x86_64 and x86; no ulps updates needed.

(auto-libm-test-out diffs omitted below.)

	[BZ #16539]
	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Just
	return the argument for normal arguments with exponent below -64.
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]:
	Likewise.
	* math/auto-libm-test-in: Add another test of expm1.
	* math/auto-libm-test-out: Regenerated.
2014-06-24 21:00:08 +00:00
Joseph Myers
e7dd3c8c1d Fix ldbl-128 erfl spurious underflows (bug 16287).
This patch fixes bug 16287, spurious underflows from ldbl-128 erfl
arising from it calling erfcl for arguments with absolute value at
least 1.0, although for large positive arguments erfcl correctly
underflows but erfl shouldn't.  The fix is simply to avoid calling
erfcl, and just return 1, for arguments above a cut-off large enough
that erfl correctly rounds to-nearest as 1 but not so large that erfcl
underflows.

Tested mips64.  Also tested x86_64 and x86 to confirm the new tests
(taken from the tests of erfc) don't cause any problems there; no ulps
updates needed.

	[BZ #16287]
	* sysdeps/ieee754/ldbl-128/s_erfl.c (__erfl): Return 1 without
	calling __erfcl for arguments at least 16.
	* math/auto-libm-test-in: Add more tests of erf.
	* math/auto-libm-test-out: Regenerated.
2014-06-24 20:56:56 +00:00
Joseph Myers
0ea5d373c7 Move architecture cases out of sysdeps/unix/sysv/linux/configure.ac.
Continuing the process of making non-ex-ports architectures follow the
preferred sysdeps practices followed by ex-ports architectures - that
is, putting things in architecture-specific sysdeps files rather than
having architecture-specific cases in architecture-independent files -
this patch moves architecture cases out of
sysdeps/unix/sysv/linux/configure.ac into (new or existing) configure
fragments for each architecture.  (In the case of the
arch_minimum_kernel setting for x32,
sysdeps/unix/sysv/linux/x86_64/x32/configure already has such a
setting so the setting in sysdeps/unix/sysv/linux/configure.ac was a
duplicate that could just be removed - though I haven't tested for
x32.)

Tested for x86_64 and x86 that the patch causes no changes to the
installed shared libraries or ldd (or any part of the installation
except for the parts that always change because the files contain
timestamps - nscd and static libraries).

	* sysdeps/unix/sysv/linux/configure.ac: Remove cases for
	individual architectures.
	* sysdeps/unix/sysv/linux/configure: Regenerated.
	* sysdeps/unix/sysv/linux/i386/configure.ac: New file.
	* sysdeps/unix/sysv/linux/i386/configure: New generated file.
	* sysdeps/unix/sysv/linux/powerpc/configure.ac
	(ldd_rewrite_script): Define variable.
	* sysdeps/unix/sysv/linux/powerpc/configure: Regenerated.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/configure.ac: New
	file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/configure: New
	generated file.
	* sysdeps/unix/sysv/linux/s390/configure.ac: New file.
	* sysdeps/unix/sysv/linux/s390/configure: New generated file.
	* sysdeps/unix/sysv/linux/sh/configure.ac: New file.
	* sysdeps/unix/sysv/linux/sh/configure: New generated file.
	* sysdeps/unix/sysv/linux/sparc/configure.ac: New file.
	* sysdeps/unix/sysv/linux/sparc/configure: New generated file.
	* sysdeps/unix/sysv/linux/x86_64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/x86_64/configure: New generated file.
2014-06-24 20:53:03 +00:00
Siddhesh Poyarekar
2307e1261e Fix namespace violation in pthreadtypes.h (BZ #17084)
This was causing conformtest failures on i386.
2014-06-24 22:43:34 +05:30
Wilco
b8c005732e Optimize fesetenv
Improve fesetenv to use an optimized implementation similar to
feupdateenv.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fesetenv.c (fesetenv): Optimize implementation.
2014-06-24 15:05:23 +00:00
Wilco
b5570d92d6 Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO.
2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fpu_control.h (_FPU_MASK_RM): Define.
	* sysdeps/arm/fenv_private.h (libc_fesetround_vfp)
	(libc_feholdexcept_setround_vfp) (libc_feholdsetround_vfp)
	(libc_feresetround_vfp) (libc_feholdsetround_vfp_ctx)
	(libc_feresetround_vfp_ctx): Use _FPU_MASK_RM.
	* sysdeps/arm/fesetround.c (fesetround): Use _FPU_MASK_RM.
	* sysdeps/arm/get-rounding-mode.h (get_rounding_mode):
	Use _FPU_MASK_RM.
2014-06-24 15:02:51 +00:00
Wilco
947bdca24d Remove an unused include.
2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Remove unused include.
2014-06-24 15:00:01 +00:00
Wilco
00f669edb8 Cleanup fenv implementation
Remove some spaces before libm_hidden_def.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/feholdexcpt.c (feholdexcept): Remove space.
	* sysdeps/arm/fesetenv.c (fesetenv): Remove space.
	* sysdeps/arm/fesetround.c (fesetround): Remove space.
	* sysdeps/arm/fraiseexcpt.c (feraiseexcept): Remove space.
2014-06-24 14:57:32 +00:00
Wilco
db59bad394 Rewrite feupdateenv
This patch rewrites feupdateenv to improve performance by avoiding
unnecessary FPSCR reads/writes. It fixes bug 16918 by passing the
correct return value.

2014-06-24  Wilco  <wdijkstr@arm.com>

	[BZ #16918]
	* sysdeps/arm/feupdateenv.c (feupdateenv):
	Rewrite to reduce FPSCR accesses and fix return value.
2014-06-24 13:53:04 +00:00
Wilco
001f7b773c Speed up the ARM fenv implementation by avoiding unnecessary FPSCR
writes if the FPSCR remains unchanged.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fclrexcpt.c (feclearexcept):
	Optimize to avoid unnecessary FPSCR writes.
	* sysdeps/arm/fedisblxcpt.c (fedisableexcept): Likewise.
	* sysdeps/arm/feenablxcpt.c (feenableexcept): Likewise.
	* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Likewise.
	* sysdeps/arm/setfpucw.c (__setfpucw): Likewise.
2014-06-24 12:04:27 +00:00
Wilco
4841e6a6c2 Use libc calls defined by fenv_private.h to implement several fenv functions
rather than duplicating functionality. To make this work for softfp builds,
ensure functions in fenv_private are not conditionally compiled.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fegetround.c (fegetround): Call get_rounding_mode.
	* sysdeps/arm/feholdexcpt.c (feholdexcept): Call libc_feholdexcept_vfp.
	* sysdeps/arm/fesetround.c (fesetround): Call libc_fesetround_vfp.
	* sysdeps/arm/fgetexcptflg.c (fegetexceptflag):
	Call libc_fetestexcept_vfp.
	* sysdeps/arm/ftestexcept.c (fetestexcept): Call libc_fetestexcept_vfp.
	* sysdeps/arm/fenv_private.h: Move libc_*_vfp functions outside of
	__SOFTFP__ ifdef so that they can be built for softfp.
2014-06-24 11:13:08 +00:00
Siddhesh Poyarekar
08e5862f5f Fix build warning in pthread_rwlock_*
The first argument of elision_adapt and that of ELISION_*LOCK have
different signs since __elision_rwcount is signed char * and the
argument of elision_adapt is uint8_t *.  Modified elision_adapt to
accept signed char * instead of uint8_t *.
2014-06-24 16:12:43 +05:30
Roland McGrath
aba8ef95b5 Add missing #include in get-rounding-mode.h 2014-06-23 14:07:59 -07:00
Roland McGrath
3fc7236a28 Remove an unused variable in fstatvfs. 2014-06-23 14:05:14 -07:00
Joseph Myers
4648909d56 Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061).
This patch fixes bug 16354, spurious underflows from cosh when a tiny
argument is passed to expm1 and expm1 correctly underflows although
the final result of cosh should be 1.  As noted in that bug, some
cases are latent because of expm1 implementations not raising
underflow (bug 16353), but all the implementations are fixed
similarly.  They already contained checks for tiny arguments, but the
checks were too late to avoid underflow from expm1 (although they
would avoid underflow from subsequent squaring of the result of
expm1); they are moved before the expm1 calls.

The thresholds used for considering arguments tiny are not
particularly consistent in how they relate to the precision of the
floating-point format in question.  They are, however, all sufficient
to ensure that the round-to-nearest result of cosh is indeed 1 below
the threshold (although sometimes they are smaller than necessary).
But the previous logic did not return 1, but the previously computed 1
+ expm1(abs(x)) value.  And the thresholds in the ldbl-128 and
ldbl-128ibm code (0x1p-71L - I suspect 0x3f8b was intended in the code
instead of 0x3fb8 - and (roughly) 0x1p-55L) are not sufficient for
that value to be 1.  So by moving the test for tiny arguments, and
consequently returning 1 directly now the expm1 value hasn't been
computed by that point, this patch also fixes bug 17061, the (large
number of ulps) inaccuracy for small arguments in those
implementations.  Tests for that bug are duly added.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 and powerpc32 to validate the ldbl-128 and ldbl-128ibm changes.

	[BZ #16354]
	[BZ #17061]
	* sysdeps/ieee754/dbl-64/e_cosh.c (__ieee754_cosh): Check for
	small arguments before calling __expm1.
	* sysdeps/ieee754/flt-32/e_coshf.c (__ieee754_coshf): Check for
	small arguments before calling __expm1f.
	* sysdeps/ieee754/ldbl-128/e_coshl.c (__ieee754_coshl): Check for
	small arguments before calling __expm1l.
	* sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl):
	Likewise.
	* sysdeps/ieee754/ldbl-96/e_coshl.c (__ieee754_coshl): Likewise.
	* math/auto-libm-test-in: Add more cosh tests.  Do not allow
	spurious underflow for some cosh tests.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
2014-06-23 20:20:10 +00:00
Joseph Myers
46a3d3c7d6 Set errno for y1 overflow (bug 17050).
This patch fixes bug 17050, missing errno setting for y1 overflow (for
small positive arguments).  An appropriate check is added for overflow
directly in the __ieee754_y1 implementation, similar to the check
present for yn (doing it there rather than in the wrapper also avoids
yn needing to repeat the check when called for order 1 or -1 and it
uses __ieee754_y1).

Tested x86_64 and x86; no ulps update needed.  Also tested for mips64
to verify the ldbl-128 fix (the ldbl-128ibm code just #includes the
ldbl-128 file).

	[BZ #17050]
	* sysdeps/ieee754/dbl-64/e_j1.c: Include <errno.h>.
	(__ieee754_y1): Set errno if return value overflows.
	* sysdeps/ieee754/flt-32/e_j1f.c: Include <errno.h>.
	(__ieee754_y1f): Set errno if return value overflows.
	* sysdeps/ieee754/ldbl-128/e_j1l.c: Include <errno.h>.
	(__ieee754_y1l): Set errno if return value overflows.
	* sysdeps/ieee754/ldbl-96/e_j1l.c: Include <errno.h>.
	(__ieee754_y1l): Set errno if return value overflows.
	* math/auto-libm-test-in: Add more tests of y0, y1 and yn.
	* math/auto-libm-test-out: Regenerated.
2014-06-23 20:17:13 +00:00
Joseph Myers
863893ec95 Test cpow in all rounding modes.
This patch enables testing of cpow in all rounding modes using
ALL_RM_TEST.  There were two reasons this was previously deferred:

* MPC has complicated rounding-mode-dependent rules for the signs of
  exact zero real or imaginary parts in the result of mpc_pow.  Annex
  G does not impose any such requirements and I don't think glibc
  should try to implement any particular logic here.  This patch adds
  support for gen-auto-libm-tests passing the IGNORE_ZERO_INF_SIGN
  flag to libm-test.inc.

* Error accumulations in some tests in non-default rounding modes
  exceed the maximum error permitted in libm-test.inc.  This patch
  marks the problem tests with xfail-rounding.  (It might be possible
  to reduce the accumulations a bit by using round-to-nearest when
  cpow calls clog, but I don't think there's much point; the
  implementation approach for cpow is fundamentally deficient, as
  discussed in the existing bug for cpow inaccuracy which can
  reasonably be considered to cover these less-inaccurate cases as
  well.  It's possible that the test "cpow 2 0 10 0" will also need
  xfail-rounding on some platforms.)

Tested x86_64 and x86 and ulps updated accordingly.

	* math/gen-auto-libm-tests.c: Document use of
	ignore-zero-inf-sign.
	(input_flag_type): Add value flag_ignore_zero_inf_sign.
	(input_flags): Add ignore-zero-inf-sign.
	(output_for_one_input_case): Handle flag_ignore_zero_inf_sign.
	* math/gen-libm-test.pl (generate_testfile): Handle
	ignore-zero-inf-sign.
	* math/auto-libm-test-in: Mark some cpow tests with
	ignore-zero-inf-sign and some with xfail-rounding.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (cpow_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-23 20:15:14 +00:00
Joseph Myers
4da6db5188 Fix pow overflow in non-default rounding modes (bug 16315).
This patch fixes bug 16315, bad pow handling of overflow/underflow in
non-default rounding modes.  Tests of pow are duly converted to
ALL_RM_TEST to run all tests in all rounding modes.

There are two main issues here.  First, various implementations
compute a negative result by negating a positive result, but this
yields inappropriate overflow / underflow values for directed
rounding, so either overflow / underflow results need recomputing in
the correct sign, or the relevant overflowing / underflowing operation
needs to be made to have a result of the correct sign.  Second, the
dbl-64 implementation sets FE_TONEAREST internally; in the overflow /
underflow case, the result needs recomputing in the original rounding
mode.

Tested x86_64 and x86 and ulps updated accordingly.

	[BZ #16315]
	* sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Ensure possibly
	overflowing or underflowing operations take place with sign of
	result.
	* sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Likewise.
	* sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise.
	* sysdeps/ieee754/dbl-64/e_pow.c: Include <math.h>.
	(__ieee754_pow): Recompute overflowing and underflowing results in
	original rounding mode.
	* sysdeps/x86/fpu/powl_helper.c: Include <stdbool.h>.
	(__powl_helper): Allow negative argument X and scale negated value
	as needed.  Avoid passing value outside [-1, 1] to f2xm1.
	* sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Ensure possibly
	overflowing or underflowing operations take place with sign of
	result.
	* sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]:
	Include <math.h>.
	* math/auto-libm-test-in: Add more tests of pow.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (pow_test): Use ALL_RM_TEST.
	(pow_tonearest_test_data): Remove.
	(pow_test_tonearest): Likewise.
	(pow_towardzero_test_data): Likewise.
	(pow_test_towardzero): Likewise.
	(pow_downward_test_data): Likewise.
	(pow_test_downward): Likewise.
	(pow_upward_test_data): Likewise.
	(pow_test_upward): Likewise.
	(main): Don't call removed functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-23 20:12:33 +00:00
Roland McGrath
5686b236cc powerpc: Consolidate nptl/ subdirectories under linux/.... 2014-06-23 09:40:01 -07:00
Wilco Dijkstra
e6d90d675d Add generic HAVE_RM_CTX implementation
This patch adds a generic implementation of HAVE_RM_CTX using standard
fenv calls. As a result math functions using SET_RESTORE_ROUND* macros
do not suffer from a large slowdown on targets which do not implement
optimized libc_fe*_ctx inline functions. Most of the libc_fe* inline
functions are now unused and could be removed in the future (there are
a few math functions left which use a mixture of standard fenv calls
and libc_fe* inline functions - they could be updated to use
SET_RESTORE_ROUND or improved to avoid expensive fenv manipulations
across just a few FP instructions).

libc_feholdsetround*_noex_ctx is added to enable better optimization of
SET_RESTORE_ROUND_NOEX* implementations.

Performance measurements on ARM and x86 of sin() show significant gains
over the current default, fairly close to a highly optimized fenv_private:

                        ARM   x86
no fenv_private      : 100%  100%
generic HAVE_RM_CTX  : 250%  350%
fenv_private (CTX)   : 250%  450%

2014-06-23  Will Newton  <will.newton@linaro.org>
	    Wilco  <wdijkstr@arm.com>

	* sysdeps/generic/math_private.h: Add generic HAVE_RM_CTX
	implementation.  Include get-rounding-mode.h.
	[!HAVE_RM_CTX]: Define HAVE_RM_CTX to zero.
	[!libc_feholdsetround_noex_ctx]: Define
	libc_feholdsetround_noex_ctx.
	[!libc_feholdsetround_noexf_ctx]: Define
	libc_feholdsetround_noexf_ctx.
	[!libc_feholdsetround_noexl_ctx]: Define
	libc_feholdsetround_noexl_ctx.
	(libc_feholdsetround_ctx): New function.
	(libc_feresetround_ctx): New function.
	(libc_feholdsetround_noex_ctx): New function.
	(libc_feresetround_noex_ctx): New function.
2014-06-23 17:29:00 +01:00
Roland McGrath
88a4647493 MIPS: Move NPTL public headers to sysdeps/mips/nptl/. 2014-06-23 09:25:41 -07:00
Roland McGrath
15bed4728f m68k: Consolidate nptl/ subdirectories under linux/... 2014-06-23 09:24:18 -07:00
Roland McGrath
d42df55520 SH: Consolidate nptl/ subdirectories under linux/..... 2014-06-23 09:23:12 -07:00
Joseph Myers
76e5216e31 Update headers for Linux 3.15.
This patch updates glibc headers for changes / new definitions in
Linux 3.15.  In the course of my review I noticed that
IPV6_PMTUDISC_INTERFACE was absent from glibc despite the inclusion of
IP_PMTUDISC_INTERFACE; I added it along with IP_PMTUDISC_OMIT and
IPV6_PMTUDISC_OMIT.  I did not add FALLOC_FL_NO_HIDE_STALE given the
kernel header comment that it is reserved.

Tested x86_64.

	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
	(FALLOC_FL_COLLAPSE_RANGE): New macro.
	[__USE_GNU] (FALLOC_FL_ZERO_RANGE): Likewise.
	* sysdeps/unix/sysv/linux/bits/in.h (IP_PMTUDISC_OMIT): Likewise.
	(IPV6_PMTUDISC_INTERFACE): Likewise.
	(IPV6_PMTUDISC_OMIT): Likewise.
2014-06-23 15:48:42 +00:00
Adhemerval Zanella
db22400947 PowerPC: sync hwcap.h capabilities
Linux commit dd58a092c4202f2bd490adab7285b3ff77f8e467 added the
PPC_FEATURE2_VEC_CRYPTO auvx capability to indicate whether to
hardware supports vector crypto hardware instructions.  This patch
adds its definition to powerpc hwcap bits.
2014-06-23 09:40:05 -05:00
Roland McGrath
93a6d08204 Clean up stack-coloring macros. 2014-06-20 19:50:16 -07:00
Roland McGrath
bc4a86fa21 Move linux bits/ files out of nptl/. 2014-06-20 18:36:49 -07:00
Joseph Myers
2272ffc116 Remove ARM __ASSUME_SIGFRAME_V2.
This patch removes ARM __ASSUME_SIGFRAME_V2 now that the
2.6.18-and-later signal frame layout can be assumed, renaming the
affected functions accordingly now only one version of them is needed
in glibc.  (sigrestorer.S did not in fact include <kernel-features.h>
and it appears that, unlike other such cases, it didn't get the header
indirectly, so the v1 functions would have been compiled in even when
sigaction.c didn't reference them.)

(alpha and hppa also have architecture-specific __ASSUME_* macros that
should now be removed: __ASSUME_FDATASYNC and __ASSUME_LWS_CAS
respectively.  I don't have any plans to do anything on that myself.)

Tested on ARM.

	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	(__ASSUME_SIGFRAME_V2): Remove macro.
	* sysdeps/unix/sysv/linux/arm/sigrestorer.S: Update comment.
	[!__ASSUME_SIGFRAME_V2]: Remove conditional code.
	(__default_sa_restorer_v2): Rename to __default_sa_restorer.
	(__default_rt_sa_restorer_v2): Rename to __default_rt_sa_restorer.
	* sysdeps/unix/sysv/linux/arm/sigaction.c (__default_sa_restorer):
	Declare as function.  Remove conditional macro definitions.
	(__default_rt_sa_restorer): Likewise.
	(__default_sa_restorer_v1): Remove declaration.
	(__default_sa_restorer_v2): Likewise.
	(__default_rt_sa_restorer_v1): Likewise.
	(__default_rt_sa_restorer_v2): Likewise.
	* sysdeps/unix/sysv/linux/arm/Versions (GLIBC_PRIVATE): Remove
	__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
	__default_sa_restorer_v2 and __default_rt_sa_restorer_v2.
2014-06-21 00:58:56 +00:00
Roland McGrath
c4eff5625d Missing new file from last commit. 2014-06-20 17:27:16 -07:00
Roland McGrath
4b88139b6f Move remaining SPARC code out of nptl/. 2014-06-20 17:13:47 -07:00
Joseph Myers
9bc6103d04 Include <kernel-features.h> explicitly where required.
This patch makes files using __ASSUME_* macros include
<kernel-features.h> explicitly, rather than relying on some other
header (such as tls.h, lowlevellock.h or pthreadP.h) to include it
implicitly.  (I omitted cases where I've already posted or am testing
the patch that stops the file from needing __ASSUME_* at all.)  This
accords with the general principle of making source files include the
headers for anything they use, and also helps make it safe to remove
<kernel-features.h> includes from any file that doesn't use
__ASSUME_* (some of those may be stray includes left behind after
increasing the minimum kernel version, others may never have been
needed or may have become obsolete after some other change).

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* nptl/pthread_cond_wait.c: Include <kernel-features.h>.
	* nptl/pthread_rwlock_timedrdlock.c: Likewise.
	* nptl/pthread_rwlock_timedwrlock.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
	* nscd/nscd.c: Likewise.
	* sysdeps/i386/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/powerpc/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/sh/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/x86_64/nptl/tcb-offsets.sym: Likewise.
2014-06-20 23:24:00 +00:00
Joseph Myers
d710902750 Remove __ASSUME_SOCK_CLOEXEC / SOCK_CLOEXEC conditionals in Linux-specific code.
This patch removes conditionals on __ASSUME_SOCK_CLOEXEC, and on
SOCK_CLOEXEC being defined, in Linux-specific code, now that all
supported Linux kernel versions can be assumed to have this
functionality.  (The macro is also used in OS-independent code and is
not defined for Hurd.)

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* nptl/sysdeps/unix/sysv/linux/mq_notify.c: Do not include
	<kernel-features.h>.
	(init_mq_netlink): Remove conditional have_sock_cloexec
	definitions.  Remove code conditional on have_sock_cloexec < 0.
	(init_mq_netlink) [!SOCK_CLOEXEC]: Remove conditional code.
	(init_mq_netlink) [!__ASSUME_SOCK_CLOEXEC]: Likewise.
	* sysdeps/unix/sysv/linux/opensock.c: Do not include
	<kernel-features.h>.
	(__opensock) [SOCK_CLOEXEC]: Make code unconditional.
	(__opensock) [!__ASSUME_SOCK_CLOEXEC]: Remove conditional code.
2014-06-20 23:22:08 +00:00
H.J. Lu
d92d8f8a42 Add ifunc tests for x86_64 memset_chk and memset
This patch adds ifunc tests for x86_64 memset_chk and memset.  It also
defines HAS_AVX2 with AVX2_Usable since AVX2 may not be usable even if
processor has AVX2.

	* sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
	Add tests for memset_chk and memset.

	* sysdeps/x86_64/multiarch/init-arch.h (HAS_AVX2): Defined
	with AVX2_Usable.
2014-06-20 14:52:29 -07:00
Joseph Myers
7fd00f9980 Remove __ASSUME_F_GETOWN_EX.
This patch removes __ASSUME_F_GETOWN_EX now it can be assumed to be
true unconditionally.

Tested x86_64 that disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_F_GETOWN_EX): Remove macro.
	* sysdeps/unix/sysv/linux/fcntl.c: Do not include
	<kernel-features.h>.
	(miss_F_GETOWN_EX): Remove variable or macro.
	(do_fcntl): Do not check miss_F_GETOWN_EX.
	(do_fcntl) [!__ASSUME_F_GETOWN_EX]: Remove conditional code.
2014-06-20 20:04:33 +00:00
Joseph Myers
4a103975c4 Remove __ASSUME_AT_RANDOM.
This patch removes __ASSUME_AT_RANDOM now it can be assumed to be true
unconditionally.

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
	Remove macro.
	* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
	[!__ASSUME_AT_RANDOM]: Remove conditional code.
	(_dl_setup_pointer_guard) [!__ASSUME_AT_RANDOM]: Likewise.
2014-06-20 20:02:34 +00:00
Joseph Myers
a2a76afe91 Remove __ASSUME_ADJ_OFFSET_SS_READ.
This patch removes the __ASSUME_ADJ_OFFSET_SS_READ macro (and
conditionals on whether ADJ_OFFSET_SS_READ is defined), now it can be
unconditionally assumed to be true and ADJ_OFFSET_SS_READ can be
assumed to be defined.

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_ADJ_OFFSET_SS_READ): Remove macro.
	* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME)
	[ADJ_OFFSET_SS_READ]: Make code unconditional.
	(ADJTIME) [!ADJ_OFFSET_SS_READ]: Remove conditional code.
2014-06-20 20:00:51 +00:00
Maciej W. Rozycki
90e5dd482f [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC
This fixes the calculation of R_ARM_TLS_DESC relocations for lazy global
symbol references, i.e. created with `-z lazy' in effect with the static
linker, where immediate resolution is requested with LD_BIND_NOW.
2014-06-20 20:22:42 +01:00
Joseph Myers
809fdf0d23 Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.
This patch cleans up for __ASSUME_ATFCTS now always being true for the
supported Linux kernel versions by removing conditional code in
sysdeps/unix/sysv/linux.  Several fchownat.c files that were only
present because of differences in the fallback syscalls used
(depending on the architecture-specific names of chown-related
syscalls for 32-bit uids) are removed.  Files that looks like they
could be replaced by syscalls.list entries have the standard "Consider
moving to syscalls.list." comment (see bug 14138) added.  Conditionals
on the relevant __NR_* syscall numbers being defined are also removed,
since my analysis indicated that the relevant syscalls are always
defined for all relevant kernel versions using any affected file.
Much of the removed fallback code had unbounded stack allocations, so
this reduces the number of cases to consider for anyone reviewing uses
of alloca and VLAs in glibc.

There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine
whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which
also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS
remains in kernel-features.h.  The logical condition relevant there is
whether openat64_not_cancel_3 is known to work.  Hurd doesn't use this
version of getcwd at all, so the conditionals in getcwd.c are always
true in glibc.  However, this code is also used in gnulib.  So the
best way to deal with the conditionals there may be for gnulib people
to deal with merging all relevant changes in both directions between
the glibc and gnulib versions of this file, at the end of which the
openat conditionals should be in whatever form is best for gnulib, and
hardcoded in the _LIBC case to having openat supported.

Tested by comparing before-and-after disassembly of installed
(stripped) shared libraries, on x86_64 and x86.  On x86 the patch made
no change to the disassembly; on x86_64, the only changes were in
readlinkat, where formerly the return value from the readlinkat
syscall was stored in an int variable before being converted to
ssize_t for the return, and now the return value is returned directly
without truncation to int.  I think it's clearly correct not to
truncate the return value (although I also think the truncation would
not have been a user-visible bug because the kernel would never have
returned a value it could have affected).

	* include/fcntl.h (__atfct_seterrno): Remove prototype.
	(__atfct_seterrno_2): Likewise.
	* sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include
	<kernel-features.h>.
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS]
	(__have_atfcts): Remove conditional definition.
	(__fxstatat([__NR_fstatat64]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code
	unreachable if [__ASSUME_ATFCTS].
	* sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do
	not undefine and redefine.
	* sysdeps/unix/sysv/linux/faccessat.c: Do not include
	<kernel-features.h>.
	(faccessat) [__NR_faccessat]: Make code unconditional.
	(faccessat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fchmodat.c: Do not include
	<kernel-features.h>.
	(fchmodat) [__NR_fchmodat]: Make code unconditional.
	(fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fchownat.c: Do not include
	<kernel-features.h>.
	(fchownat) [__NR_fchownat]: Make code unconditional.
	(fchownat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/futimesat.c: Do not include
	<kernel-features.h>.
	(futimesat) [__NR_futimesat]: Make code unconditional.
	(futimesat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fxstatat64.c: Do not include
	<kernel-features.h>.
	(__fxstatat64) [__NR_fstatat64]: Make code unconditional.
	(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_fstatat64]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/linkat.c: Do not include
	<kernel-features.h>.
	(linkat) [__NR_linkat]: Make code unconditional.
	(linkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
	<kernel-features.h>.
	(__fxstatat64) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/mkdirat.c: Do not include
	<kernel-features.h>.
	(mkdirat) [__NR_mkdirat]: Make code unconditional.
	(mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/openat.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function.
	[!__ASSUME_ATFCTS] (__have_atfcts): Remove variable.
	(OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional.
	(OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/readlinkat.c: Do not include
	<kernel-features.h>.
	(readlinkat) [__NR_readlinkat]: Make code unconditional.
	(readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.  Return
	result of INLINE_SYSCALL directly, not via int variable.
	* sysdeps/unix/sysv/linux/renameat.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function.
	(renameat) [__NR_renameat]: Make code unconditional.
	(renameat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/symlinkat.c: Do not include
	<kernel-features.h>.
	(symlinkat) [__NR_symlinkat]: Make code unconditional.
	(symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/unlinkat.c: Do not include
	<kernel-features.h>.
	(unlinkat) [__NR_unlinkat]: Make code unconditional.
	(unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/xmknodat.c: Do not include
	<kernel-features.h>.
	(__xmknodat) [__NR_mknodat]: Make code unconditional.
	(__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.
2014-06-20 15:41:35 +00:00
H.J. Lu
224c6c51c5 Remove sysdeps/x86_64/multiarch/rtld-strlen.S
Since there is no sysdeps/x86_64/multiarch/strlen.S,
sysdeps/x86_64/rtld-strlen.S will be used.

	* sysdeps/x86_64/multiarch/rtld-strlen.S: Removed.
2014-06-20 08:10:07 -07:00
Stefan Liebler
3ef6b85059 [BZ #6803] Set errno for scalbln, scalbn
Errno is not set and the testcases will fail.

Now the scalbln-aliases are removed in i386/m68
and the wrappers are used when calling the scalbln-functions.

On ia64 only scalblnf has its own implementation.
For scalbln and scalblnl the ieee754/dbl-64 and ieee754/ldbl-96 are used, thus
the wrappers are needed, too.
2014-06-20 07:48:20 +05:30
H.J. Lu
c8daec5c7c Use 3 bytes for __pad1 in pthread_rwlock_t for x32
Since long is 4 bytes for x32, we should use 3 bytes for __pad1 when
a long __pad1 is replaced by a byte __rwelision and __pad1.

	* sysdeps/x86/nptl/bits/pthreadtypes.h (pthread_rwlock_t): Use
	3 bytes for __pad1 for x32.
	(__PTHREAD_RWLOCK_ELISION_EXTRA): Likewise.
2014-06-19 15:24:33 -07:00
Ling Ma
5c74e47cd6 Add x86_64 memset optimized for AVX2
In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx & avx2 instruction.

The CPU2006 403.gcc benchmark indicates this patch improves performance
from 26% to 59%.

	* sysdeps/x86_64/multiarch/Makefile: Add memset-avx2.
	* sysdeps/x86_64/multiarch/memset-avx2.S: New file.
	* sysdeps/x86_64/multiarch/memset.S: Likewise.
	* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
	* sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.
2014-06-19 15:14:08 -07:00
Richard Earnshaw
f940b96522 [AArch64] Add optimized strchr.
Implementation of strchr for AArch64.  Speedups taken from micro-bench
show the improvements relative to the standard C code.

The use of LD1 means we have identical code for both big- and
little-endian systems.
2014-06-19 11:03:59 +01:00
Joseph Myers
4ba7a00fe3 Fix __ieee754_logl (-LDBL_MAX) in FE_DOWNWARD mode (bug 17022).
This patch fixes __ieee754_logl (-LDBL_MAX) on x86_64 and x86 not to
subtract 1 from its argument and so cause spurious overflow in
FE_DOWNWARD mode.  (For any argument strictly less than -1, it doesn't
matter whether or not 1 is subtracted before computing log1p, as long
as the result doesn't overflow to -Inf.)

Tested x86_64 and x86.  (This particular case lacks test coverage,
since the testsuite doesn't cover -lieee, but it will be covered by
tests after the following patch to test pow in all rounding modes,
which was the context in which this bug was found.)

	[BZ #17022]
	* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Do not subtract 1
	from arguments -2 or below.
	* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
	* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
2014-06-18 12:32:01 +00:00
Joseph Myers
85d8927856 Use $(rtld-prefix) more consistently.
The glibc makefiles have a standard variable, $(rtld-prefix), to run
the dynamic linker with a default --library-path option; this is used
as the basis of lots of other variables for running programs compiled
with the newly built library.

A few places however use $(elf-objpfx)ld.so or
$(elf-objpfx)${rtld-installed-name} directly, with such a
--library-path option.  This patch makes such places use
$(rtld-prefix) instead.  I'm not aware of any significance in these
cases to the choice of ld.so or ${rtld-installed-name} when running
the dynamic linker, or to whether $(patsubst
%,:%,$(sysdep-library-path)) is included in the library-path as it is
in $(rtld-prefix) and just one of the places being changed.

Tested x86_64.

	* elf/Makefile ($(objpfx)tst-unused-dep.out): Use $(rtld-prefix).
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Likewise.

localedata/ChangeLog:
	* Makefile (LOCALEDEF): Use $(rtld-prefix).
2014-06-18 10:35:29 +00:00
Rajalakshmi Srinivasaraghavan
754c5a08aa PowerPC: Fix nearbyintl failure for few inputs
This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i  The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.

Fixes #17031.
2014-06-17 08:46:25 -05:00
Adhemerval Zanella
556f529dab PowerPC: Move powerpc code out of nptl/ subdirectory 2014-06-17 07:54:22 -05:00
Joseph Myers
91c03c5389 Add CFI to x86 ceil / floor / trunc (bug 16681).
This patch adds CFI to the sysdeps/i386/fpu/ implementations of ceil,
floor and trunc functions, for consistency with other x86 .S files in
glibc which have CFI for stack adjustments.

Tested x86.

	[BZ #16681]
	* sysdeps/i386/fpu/s_ceil.S (__ceil): Add CFI.
	* sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise.
	* sysdeps/i386/fpu/s_ceill.S (__ceill): Likewise.
	* sysdeps/i386/fpu/s_floor.S (__floor): Likewise.
	* sysdeps/i386/fpu/s_floorf.S (__floorf): Likewise.
	* sysdeps/i386/fpu/s_floorl.S (__floorl): Likewise.
	* sysdeps/i386/fpu/s_trunc.S (__trunc): Likewise.
	* sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise.
	* sysdeps/i386/fpu/s_truncl.S (__truncl): Likewise.
2014-06-16 22:54:46 +00:00
Andreas Schwab
a76e63c586 m68k: update libm test ULPs 2014-06-17 00:29:23 +02:00
Andreas Schwab
ea8a15f628 Fix typo in preprocessor conditional 2014-06-16 23:44:34 +02:00
David S. Miller
6957fb3150 Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-06-14 13:14:54 -07:00
Andreas Schwab
1d2a049204 m68k: Consolidate NPTL/non versions of clone 2014-06-14 21:37:49 +02:00
Andreas Schwab
11b9e55b67 m68k: Consolidate NPTL/non versions of vfork 2014-06-14 21:37:34 +02:00
Andi Kleen
0f6901d0a1 Add fallback file for elide.h
Add the missing fallback file for elide.h to fix non x86 builds.
Sorry about that. This is just a noop macro file that makes
all elision code to be optimized out.
2014-06-14 09:27:09 -07:00
Roland McGrath
9a25fd1ed3 S390: Move NPTL public headers to sysdeps/s390/nptl/. 2014-06-13 16:27:11 -07:00
Roland McGrath
4004f7e4bf Move S390 code out of nptl/sysdeps/s390/. 2014-06-13 16:26:56 -07:00
Roland McGrath
45193bb814 S390: Convert fork.c to arch-fork.h 2014-06-13 16:26:38 -07:00
David S. Miller
f6fdf53382 Consolidate sparc clone, fork, and vfork implementations.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Moved ...
	* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: ... here.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Moved ...
	* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: ... here.
	* sysdeps/unix/sysv/linux/sparc/fork.S: Delete.
	* sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__thread_start):
	Remove RESET_PID cpp guards.
	* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__thread_start):
	Remove RESET_PID cpp guards.
	* sysdeps/unix/sysv/linux/sparc/vfork.S: Delete.
2014-06-13 14:47:53 -07:00
Andreas Schwab
f5d71e140d m68k: avoid pointer to integer conversion warning 2014-06-13 23:32:13 +02:00
Andi Kleen
b7aa8caace Remove x86 assembler rwlock code
With the recent tuning the C version of rwlocks is basically the same
performance as the x86 assembler version for uncontended locks (with a
a few cycles near the run-to-run variability). For others it should not
matter anyways.

So remove the assembler code and use the C version like other
architectures.
2014-06-13 13:16:06 -07:00
Andi Kleen
8491ed6d70 Add adaptive elision to rwlocks
This patch relies on the C version of the rwlocks posted earlier.
With C rwlocks it is very straight forward to do adaptive elision
using TSX. It is based on the infrastructure added earlier
for mutexes, but uses its own elision macros. The macros
are fairly general purpose and could be used for other
elision purposes too.

This version is much cleaner than the earlier assembler based
version, and in particular implements adaptation which makes
it safer.

I changed the behavior slightly to not require any changes
in the test suite and fully conform to all expected
behaviors (generally at the cost of not eliding in
various situations). In particular this means the timedlock
variants are not elided.  Nested trylock aborts.
2014-06-13 13:15:28 -07:00
Meador Inge
995a46bbfb get_nprocs: Only return explictly set cache values (BZ #16996)
The implementation of __get_nprocs uses a stactic variable to cache
the value of the current number of processors.  The caching breaks when
'time (NULL) == 0':

  $ cat nproc.c
  #include <stdio.h>
  #include <time.h>
  #include <sys/time.h>

  int main(int argc, char *argv[])
  {
    time_t t;
    struct timeval tv = {0, 0};
    printf("settimeofday({0, 0}, NULL) = %d\n", settimeofday(&tv, NULL));
    t = time(NULL);
    printf("Time: %d, CPUs: %d\n", (unsigned int)t, get_nprocs());
    return 0;
  }
  $ gcc -O3 nproc.c
  $ ./a.out
  settimeofday({0, 0}, NULL) = -1
  Time: 1401311578, CPUs: 4
  $ sudo ./a.out
  settimeofday({0, 0}, NULL) = 0
  Time: 0, CPUs: 0

The problem is with the condition used to check whether a cached
value should be returned or not:

  static int cached_result;
  static time_t timestamp;

  time_t now = time (NULL);
  time_t prev = timestamp;
  atomic_read_barrier ();
  if (now == prev)
    return cached_result;

This patch fixes the problem by ensuring that 'cached_result' has
been set at least once before returning it.
2014-06-13 14:02:04 +05:30
Roland McGrath
febf6cc58c Move SPARC public headers out of nptl/ 2014-06-12 15:04:34 -07:00
Roland McGrath
e26822463f Move SPARC code out of nptl/sysdeps/sparc/. 2014-06-12 14:33:59 -07:00
Roland McGrath
b14368b895 SPARC: Convert fork.c to arch-fork.h 2014-06-12 14:19:50 -07:00
Roland McGrath
c5620eb3a3 Use list.h in posix-timer code. 2014-06-12 14:17:14 -07:00
Roland McGrath
463dc947b4 Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
Roland McGrath
e876b09076 Consolidate NPTL sigprocmask. 2014-06-12 10:32:18 -07:00
Roland McGrath
f6b07b3d48 Move i386 code out of nptl/ subdirectory. 2014-06-12 10:08:24 -07:00
Roland McGrath
45262aeedf Move SH code out of nptl/ subdirectory. 2014-06-12 09:05:54 -07:00
Roland McGrath
14642b8511 Move x86_64 code out of nptl/ subdirectory. 2014-06-11 21:33:32 -07:00
Adhemerval Zanella
31c44fea31 Update powerpc-fpu ULPs. 2014-06-11 21:22:49 -05:00
Chris Metcalf
c3a2ebe1f7 tile: Consolidate NPTL/non versions of vfork 2014-06-11 15:52:53 -04:00
Roland McGrath
c9cab3d2f9 Tile: Define TLS_DEFINE_INIT_TP 2014-06-11 12:25:27 -07:00
Roland McGrath
ba5ec6116c Alpha: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:35 -07:00
Roland McGrath
f12b481486 PowerPC: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:17 -07:00
Roland McGrath
9503784a07 AArch64: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:01 -07:00
Vidya Ranganathan
e23d3d2690 PowerPC: Optimized strcmp for PPC64/POWER7
Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.
2014-06-11 08:39:31 -05:00
Chris Metcalf
2d0fc4dcfc tile: move sysdeps/unix/sysv/linux/tile nptl files. 2014-06-10 14:10:17 -04:00
Joseph Myers
f8ba1b5654 Fix log2 (1) in round-downward mode (bug 17042).
As with other issues of this kind, bug 17042 is log2 (1) wrongly
returning -0 instead of +0 in round-downward mode because of
implementations effectively in terms of log1p (x - 1).  This patch
fixes the issue in the same way used for log and log10.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of log2l is
essentially the same as the ldbl-128 one).

	[BZ #17042]
	* sysdeps/i386/fpu/e_log2.S (__ieee754_log2): Take absolete value
	when x - 1 is zero.
	* sysdeps/i386/fpu/e_log2f.S (__ieee754_log2f): Likewise.
	* sysdeps/i386/fpu/e_log2l.S (__ieee754_log2l): Likewise.
	* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Return
	0.0L for an argument of 1.0L.
	* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l):
	Likewise.
	* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Take absolute
	value when x - 1 is zero.
	* math/libm-test.inc (log2_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-10 12:07:15 +00:00
Bernard Ogden
2c3520d98d hppa: Remove lowlevellock.c.
The hppa port has no need of a custom lowlevellock.c, it should
use the generic version which is updated and correct. This
similarly fixes bug 15119 for hppa.
2014-06-09 23:22:20 -04:00
Roland McGrath
d752f0ccd7 m68k: Define TLS_DEFINE_INIT_TP 2014-06-09 15:54:19 -07:00
Roland McGrath
34eda6d1ba HPPA: Define TLS_DEFINE_INIT_TP 2014-06-09 14:04:45 -07:00
Roland McGrath
50f0a637b7 MIPS: Define TLS_DEFINE_INIT_TP 2014-06-09 13:47:38 -07:00
Roland McGrath
08f41f047c ARM: Define TLS_DEFINE_INIT_TP 2014-06-09 12:53:16 -07:00
Roland McGrath
962b744d06 Start cleaning up TLS initial value for pthread_create. 2014-06-09 12:52:55 -07:00
Joseph Myers
686554bff6 Remove redundant C locale settings.
Various glibc build / install / test code has C locale settings that
are redundant with LC_ALL=C.

LC_ALL takes precedence over LANG, so anywhere that sets LC_ALL=C
(explicitly, or through it being in the default environment for
running tests) does not need to set LANG=C.  LC_ALL=C also takes
precedence over LANGUAGE, since

2001-01-02  Ulrich Drepper  <drepper@redhat.com>

	* intl/dcigettext.c (guess_category_value): Rewrite so that LANGUAGE
	value is ignored if the selected locale is the C locale.
	* intl/tst-gettext.c: Set locale for above change.
	* intl/tst-translit.c: Likewise.

and so settings of LANGUAGE=C are also redundant when LC_ALL=C is
set.  One test also had LC_ALL=C in its -ENV setting, although it's
part of the default environment used for tests.

This patch removes the redundant settings.  It removes a suggestion in
install.texi of setting LANGUAGE=C LC_ALL=C for "make install"; the
Makefile.in target "install" already sets LC_ALL_C so there's no need
for the user to set it (and nor should there be any need for the user
to set it).

If some build machine tool used by "make install" uses a version of
libintl predating that 2001 change, and the user has LANGUAGE set, the
removal of LANGUAGE=C from the Makefile.in "install" rule could in
principle affect the user's installation.  However, I don't think we
need to be concerned about pre-2001 build tools.

Tested x86_64.

	* Makefile (install): Don't set LANGUAGE.
	* Makefile.in (install): Likewise.
	* assert/Makefile (test-assert-ENV): Remove variable.
	(test-assert-perr-ENV): Likewise.
	* elf/Makefile (neededtest4-ENV): Likewise.
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Don't set LANGUAGE.
	* io/ftwtest-sh (LANG): Remove variable.
	* libio/Makefile (tst-widetext-ENV): Likewise.
	* manual/install.texi (Running make install): Don't refer to
	environment settings for make install.
	* INSTALL: Regenerated.
	* nptl/tst-tls6.sh: Don't set LANG.
	* posix/globtest.sh (LANG): Remove variable.
	* string/Makefile (tester-ENV): Likewise.
	(inl-tester-ENV): Likewise.
	(noinl-tester-ENV): Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Don't set LANGUAGE.
	* timezone/Makefile (build-testdata): Use $(built-program-cmd)
	without explicit environment settings.

localedata/ChangeLog:
	* tst-fmon.sh: Don't set LANGUAGE.
	* tst-locale.sh: Likewise.
2014-06-07 19:58:36 +00:00
Roland McGrath
68e6b6b1bf Move NPTL public ABI headers for SH to sysdeps/sh/nptl/. 2014-06-06 23:08:16 -07:00
Adhemerval Zanella
ed36bfa18f PowerPC: Fix optimized strncat strlen call
This patch fixes the optimized ppc64/power7 strncat strlen call for
static build without ifunc enabled.  The strlen symbol to call in such
situation is just strlen, instead of __GI_strlen (since the __GI_
alias is just created for shared objects).
2014-06-06 09:37:07 -05:00
Ondřej Bílka
d89b3d80f9 Fix memory overrun in getifaddrs_internal. Fixes bug 15698. 2014-06-05 19:25:23 +02:00
Richard Henderson
71840409ea aarch64: Remove nptl/vfork.S 2014-06-03 11:28:11 -04:00
Stefan Liebler
cf7bfd28b7 S/390: Regenerate ULPs. 2014-06-03 17:27:13 +02:00
Richard Henderson
89b4bd6b60 aarch64: Consolidate NPTL/non versions of vfork
At the same time, incorporate the 0 -> 0x80000000 mapping
of the pid expected by raise.c.
2014-06-03 11:09:20 -04:00
Richard Henderson
111cc71489 aarch64: Consolidate NPTL/non versions of clone
At the same time, rely on non-clobbered registers across syscall
so that we eliminate the stack frame that we previously ignored
in the unwind info.
2014-06-03 11:04:04 -04:00
Marcus Shawcroft
ccc3991113 [AArch64] Regenerate libm-test-ulps 2014-06-03 12:45:10 +00:00
Wilco
693096cc7b [AArch64] Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASK 2014-06-03 12:44:50 +00:00
Wilco
0b4366bc9b [AArch64] Cleanup declarations in math_private.h. 2014-06-03 12:44:49 +00:00
Roland McGrath
d936d379eb SH: Consolidate NPTL/non versions of vfork 2014-06-02 14:29:19 -07:00
Wilco
a88dadbed5 [AArch64] Remove ISB after FPCR write. 2014-06-02 12:44:21 +01:00
Wilco
c95b301101 [AArch64] Rewrite feupdateenv (BZ 17009). 2014-06-02 12:36:34 +01:00
David S. Miller
6b4d7a909f Update Sparc ULPS.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-06-01 19:19:18 -07:00
David S. Miller
30f3d07cbb Fix excessive ULP for y1_upward (0x2p+0) in test-float and test-ifloat.
* sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Force computations
	to occur in round to nearest mode when |x| >= 2.0
2014-05-31 20:05:00 -07:00
Richard Henderson
f0712b543e aarch64: Remove PSEUDO_RET 2014-05-30 14:11:51 -04:00
Richard Henderson
74f31c1859 aarch64: Fix error return from __ioctl
Forgotten in ca3cfa40c1
where the error branch was moved from PSEUDO_RET.
2014-05-30 14:09:34 -04:00
Marko Myllynen
30477995dc Replace __int128 with __int128_t
* sysdeps/x86_64/link-defines.sym (BND_SIZE): Replace __int128
	with __int128_t.
2014-05-30 10:50:21 -07:00
Roland McGrath
5190c17f22 m68k: Convert fork.c to arch-fork.h 2014-05-30 18:44:55 +02:00
Richard Henderson
1670e207c5 aarch64: Rely on syscalls preserving registers
In several cases we've had asm routines rely on syscalls not clobbering
call-clobbered registers, and that's now deemed ABI.  So take advantage
of this in the INLINE_SYSCALL path as well.

Shrinks libc.so by about 1k.
2014-05-29 12:53:27 -04:00
Richard Henderson
11a28aee60 aarch64: Use tpidr_el0 rather than __errno_location in librt 2014-05-29 12:41:08 -04:00
Richard Henderson
a17e5ffb80 aarch64: Use tpidr_el0 rather than __read_tp in librt 2014-05-29 12:39:03 -04:00
Richard Henderson
b5be459771 aarch64: Improve syscall-cancel stack frame
One push instead of N; use stp/ldp to halve the insns.
2014-05-29 12:37:24 -04:00
Richard Henderson
645d44abe3 aarch64: Pass regno parameter to SINGLE_THREAD_P
Use cbz instead of cmp+b.eq.
2014-05-29 12:33:06 -04:00
Richard Henderson
a8b4f04ad7 aarch64: Share code in syscall-cancel.h
Fold nocancel and error handling paths.
2014-05-29 12:31:07 -04:00
Richard Henderson
af4e8ef944 aarch64: Tabify sysdep-cancel.h 2014-05-29 12:28:59 -04:00
Eric Wong
26b0d2e1a1 Avoid stat/fstat in statvfs/fstatvfs (BZ #15132)
Delay the use of stat/fstat until stat data is required.  When the
kernel returns ST_VALID, stat data is not used by __internal_statvfs.
2014-05-29 09:41:29 +05:30
Roland McGrath
0d3b7a190c SH: Consolidate NPTL/non versions of clone 2014-05-28 17:23:19 -07:00
Roland McGrath
1efe2bd9dc tile: Convert fork.c to arch-fork.h 2014-05-28 14:23:16 -04:00
Roland McGrath
30b6629ede IA64: Convert fork.c to arch-fork.h 2014-05-27 15:43:45 -07:00
Roland McGrath
a6bea3ca7b SH: Convert fork.c to arch-fork.h 2014-05-27 12:58:01 -07:00
Andreas Schwab
774f928582 Remove second argument from TLS_INIT_TP macro 2014-05-27 14:48:46 +02:00
Will Newton
36ffe7398a ARM: Fix handling of concurrent TLS descriptor resolution
The current code for handling concurrent resolution says that the
ABI for _dl_tlsdesc_resolve_hold is the same as that of
_dl_tlsdesc_lazy_resolver. However _dl_tlsdesc_resolve_hold is
called from the trampoline directly rather than the lazy resolver
stub so, for example, r2 has not been pushed so does not needed
to be restored.

This fixes an intermittent failure in nptl/tst-tls3 when building
glibc for arm-linux-gnueabihf with -mtls-dialect=gnu2.

ChangeLog:

2014-05-27  Will Newton  <will.newton@linaro.org>

	[BZ #16990]
	* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_resolve_hold): Save
	and restore r2 rather than just restoring.
2014-05-27 10:39:18 +01:00
Adhemerval Zanella
bab900166e Update powerpc-fpu ULPs. 2014-05-26 12:40:08 -05:00
Adhemerval Zanella
c7a8d66787 PowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files. 2014-05-26 11:45:14 -05:00
Adhemerval Zanella
daee7851e2 PowerPC: Move NPTL ABI headers to sysdeps. 2014-05-26 11:41:47 -05:00
Adhemerval Zanella
50a4081954 PowerPC: Move powerpc64 timer_*.c out of nptl/ 2014-05-26 11:41:46 -05:00
Adhemerval Zanella
8464c2a110 PowerPC: Consolidate NPTL/non versions of clone 2014-05-26 11:41:46 -05:00
Adhemerval Zanella
3d1024e8d1 PowerPC: Consolidate NPTL/non versions of vfork 2014-05-26 11:41:28 -05:00
Adhemerval Zanella
d298c41635 PowerPC: Remove 64 bits instructions in PPC32 code
This patch replaces the insrdi by insrwi in powerpc32 assembly.
2014-05-26 09:09:21 -05:00
Kyle McMartin
75f11331f9 [AARCH64] correct alignment of TLS_TCB_ALIGN (BZ #16796)
This fixes a variety of testsuite failures for me:
tststatic.out Error 1
tststatic2.out Error 1
tst-tls9-static.out Error 1
tst-audit8.out Error 127
tst-audit9.out Error 127
tst-audit1.out Error 127
and also has the added benefit of making LD_AUDIT/sotruss work on
AArch64.

Otherwise, we bail out early in _dl_try_allocate_static_tls as the
alignment requirement of the PT_TLS section in libc is 16.
2014-05-26 12:37:19 +05:30
Richard Henderson
aa2f176d6f arm,aarch64: Remove SINGLE_THREAD_P_PIC
This macro was removed by

2005-11-16  Daniel Jacobowitz  <dan@codesourcery.com>

but not applied to the (still separate) eabi port so necro'd
when the eabi port superceded the old abi.  It was thence
copied into the new AArch64 port.
2014-05-25 12:50:41 -04:00
Richard Henderson
ca3cfa40c1 aarch64: Tidy syscall error check
Move the error branch from the PSEUDO_RET macro to the PSEUDO macro.
This is in line with other architectures, and will enable further improvments.
2014-05-25 12:46:50 -04:00
Richard Henderson
6e6c2d01eb aarch64: Remove DOARGS/UNDOARGS macros
While they do something for AArch32, they're useless for AArch64.
2014-05-25 12:37:29 -04:00
Richard Henderson
c69abcee72 aarch64: Fix DO_CALL block comment 2014-05-25 12:33:00 -04:00
Richard Henderson
82aab97cbf alpha: Do non-default symbols in pt-vfork.S 2014-05-25 09:04:54 -07:00
Richard Henderson
bc89e9625f alpha: Move remaining files out of sysdeps/unix/sysv/linux/alpha/nptl/ 2014-05-23 11:20:48 -07:00
Richard Henderson
e2fa4bc2bb alpha: Consolidate NPTL/non versions of vfork 2014-05-23 11:20:44 -07:00