Commit Graph

28136 Commits

Author SHA1 Message Date
Joseph Myers
4863355ad5 Require GCC 4.6 or later to build glibc.
As discussed in the thread starting at
<https://sourceware.org/ml/libc-alpha/2014-10/msg00792.html>, and
continuing into November, this patch increases the minimum GCC version
for building glibc to 4.6 (there seemed to be no clear consensus for
4.7).  In particular, this allows us to use #pragma GCC diagnostic for
fine-grained warning control with -Werror (subject to establishing a
suitable policy for that use).  The documentation has a statement, as
requested, about the most recent GCC version tested for building
glibc, and I've updated <https://sourceware.org/glibc/wiki/Release> to
refer to updating that statement.  A NEWS entry is added for this
change, although previous such changes didn't get them.

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

	* configure.ac (libc_cv_compiler_ok): Require GCC 4.6 or later.
	* configure: Regenerated.
	* manual/install.texi (Tools for Compilation): Document a
	requirement of GCC 4.6 or later and that GCC 4.9 is the newest
	compiler verified to work.
	* INSTALL: Regenerated.
2014-11-14 18:00:34 +00: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
Joseph Myers
bf438382bd Use prototype definition for __strtol.
This patch fixes those warnings by using a prototype definition for
__strtol.

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

	* stdlib/strtol.c (__strtol): Use prototype definition.
2014-11-13 21:37:53 +00:00
Joseph Myers
2a1cfd94a2 Fix strtoll / strtoull namespace for 32-bit (bug 17594).
For 32-bit platforms, strtoll and strtoull are strong symbols in libc,
but they are not in ISO C90, and are brought in by references to
__strtoll_internal / __strtoull_internal from scanf.  (For 64-bit
platforms, they are properly weak.)  This patch makes them weak for
32-bit (it has a side-effect of making other symbols weak that don't
need to be weak, such as strtol, but that's harmless).

Tested for x86 (testsuite, and that the disassembly of installed
shared libraries is unchanged by the patch).  This fixes all 120
unXFAILed FAILs of the new linknamespace tests seen for x86 (in fact,
there are now seven XPASSes of those tests for x86

XPASS: conform/POSIX2008/fcntl.h/linknamespace
XPASS: conform/UNIX98/libgen.h/linknamespace
XPASS: conform/XOPEN2K/fcntl.h/linknamespace
XPASS: conform/XOPEN2K/libgen.h/linknamespace
XPASS: conform/XOPEN2K8/fcntl.h/linknamespace
XPASS: conform/XOPEN2K8/libgen.h/linknamespace
XPASS: conform/XPG4/libgen.h/linknamespace

so suggesting that the failures seen for those on x86_64 are in some
way architecture-specific or 64-bit-specific).

	[BZ #17594]
	* stdlib/strtol.c (SYM__): New macro.
	(SYM__1): Likewise.
	(__strtol): Likewise.
	(strtol): Rename to __strtol and define as weak alias of
	__strtol.  Use libc_hidden_weak.
2014-11-13 19:50:55 +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
Roland McGrath
c6aab2cb52 NPTL: Move __libc_multiple_threads_ptr defn to nptl-init.c 2014-11-12 14:52:31 -08:00
Joseph Myers
24f4f8253f Add tests for namespace for static linking.
One thing we currently try to ensure manually is that glibc is
namespace-clean for static linking; that is, if you only use features
from a particular standard (including the set of features exposed by
headers given feature test macros such as _DEFAULT_SOURCE that don't
correspond to any written standard), the library objects brought in by
the static linker will not define or use (strong) names that are
reserved to the user in that standard.

This patch implements automatic tests for this, using the same set of
standards as for the header conformance tests (it would, however, be
easy to add more standards for this testing, without them needing to
have the definitions of expected header contents for the header
tests).  The tests are based on the functions declared in each header,
as extracted using GCC's -aux-info option.  The following comment from
linknamespace.pl explains the caveats around this approach:

Here's an example of the output for ISO (C90) assert.h, from before my
recent fixes and whitelisting of cases that seem more complicated to
fix:

[initial] __assert_fail -> [libc.a(assert.o)] free -> [libc.a(malloc.o)] __get_nprocs -> [libc.a(getsysstats.o)] fgets_unlocked
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_archive_subfreeres -> [libc.a(loadarchive.o)] __sysconf -> [libc.a(sysconf.o)] __tzname_max -> [libc.a(tzset.o)] __tzfile_compute -> [libc.a(tzfile.o)] fileno
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_archive_subfreeres -> [libc.a(loadarchive.o)] __sysconf -> [libc.a(sysconf.o)] __tzname_max -> [libc.a(tzset.o)] __tzfile_compute -> [libc.a(tzfile.o)] fread_unlocked
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_archive_subfreeres -> [libc.a(loadarchive.o)] __sysconf -> [libc.a(sysconf.o)] __tzname_max -> [libc.a(tzset.o)] __tzfile_compute -> [libc.a(tzfile.o)] ftello
[initial] __assert_fail -> [libc.a(assert.o)] free -> [libc.a(malloc.o)] malloc_info
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_default_locale_path -> [libc.a(findlocale.o)] memmem
[initial] __assert_perror_fail -> [libc.a(assert-perr.o)] __strerror_r -> [libc.a(_strerror.o)] mempcpy
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] _nl_find_domain -> [libc.a(finddomain.o)] _nl_expand_alias -> [libc.a(localealias.o)] qsort -> [libc.a(msort.o)] qsort_r
[initial] __assert_fail -> [libc.a(assert.o)] _dl_pagesize -> [libc.a(dl-support.o)] __rawmemchr -> [libc.a(rawmemchr.o)] rawmemchr
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __getcwd -> [libc.a(getcwd.o)] rewinddir
[initial] __assert_fail -> [libc.a(assert.o)] stderr
[initial] __assert_fail -> [libc.a(assert.o)] stderr -> [libc.a(stdio.o)] stdin
[initial] __assert_fail -> [libc.a(assert.o)] stderr -> [libc.a(stdio.o)] stdout
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] stpcpy
[initial] __assert_fail -> [libc.a(assert.o)] __fxprintf -> [libc.a(fxprintf.o)] _IO_vfprintf -> [libc.a(vfprintf.o)] __printf_fp -> [libc.a(printf_fp.o)] wmemset

Of the 161 XFAILs, seven are the inevitable varargs.h and ndbm.h
failures; I think the remaining 154 mostly represent genuine bugs in
glibc that should mostly be straightforward to fix (probably rather
fewer than 154 bugs - issues generally affect multiple headers, for
multiple standards).  (When fixing, of course you need to file a bug
in Bugzilla, and check for the possibility that the header
conditionals are what's incorrect - that the first listed symbol
shouldn't have been declared, or that the symbol finally brought in
should have been declared.)

	* conform/GlibcConform.pm: New file.
	* conform/conformtest.pl: Use GlibcConform module.
	* conform/linknamespace.pl: New file.
	* conform/list-header-symbols.pl: Likewise.
	* conform/Makefile (linknamespace-symlists-base): New variable.
	(linknamespace-symlists-tests): Likewise.
	(linknamespace-header-base): Likewise.
	(linknamespace-header-tests): Likewise.
	(tests-special): Add new tests.
	($(linknamespace-symlists-tests)): New rule.
	(linknamespace-libs): New variable.
	($(objpfx)symlist-stdlibs): New rule.
	($(linknamespace-header-tests)): Likewise.
	(test-xfail-XPG3/varargs.h/linknamespace): New variable.
	(test-xfail-XPG4/varargs.h/linknamespace): Likewise.
	(test-xfail-UNIX98/varargs.h/linknamespace): Likewise.
	(test-xfail-XPG4/ndbm.h/linknamespace): Likewise.
	(test-xfail-UNIX98/ndbm.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/ndbm.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/ndbm.h/linknamespace): Likewise.
	(test-xfail-ISO/math.h/linknamespace): Likewise.
	(test-xfail-ISO/signal.h/linknamespace): Likewise.
	(test-xfail-ISO/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO/time.h/linknamespace): Likewise.
	(test-xfail-ISO99/complex.h/linknamespace): Likewise.
	(test-xfail-ISO99/ctype.h/linknamespace): Likewise.
	(test-xfail-ISO99/math.h/linknamespace): Likewise.
	(test-xfail-ISO99/signal.h/linknamespace): Likewise.
	(test-xfail-ISO99/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO99/tgmath.h/linknamespace): Likewise.
	(test-xfail-ISO11/complex.h/linknamespace): Likewise.
	(test-xfail-ISO11/ctype.h/linknamespace): Likewise.
	(test-xfail-ISO11/math.h/linknamespace): Likewise.
	(test-xfail-ISO11/signal.h/linknamespace): Likewise.
	(test-xfail-ISO11/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO11/tgmath.h/linknamespace): Likewise.
	(test-xfail-XPG3/ctype.h/linknamespace): Likewise.
	(test-xfail-XPG3/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XPG3/glob.h/linknamespace): Likewise.
	(test-xfail-XPG3/math.h/linknamespace): Likewise.
	(test-xfail-XPG3/regex.h/linknamespace): Likewise.
	(test-xfail-XPG3/search.h/linknamespace): Likewise.
	(test-xfail-XPG3/stdio.h/linknamespace): Likewise.
	(test-xfail-XPG3/time.h/linknamespace): Likewise.
	(test-xfail-XPG3/unistd.h/linknamespace): Likewise.
	(test-xfail-XPG3/wordexp.h/linknamespace): Likewise.
	(test-xfail-XPG4/ctype.h/linknamespace): Likewise.
	(test-xfail-XPG4/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XPG4/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XPG4/glob.h/linknamespace): Likewise.
	(test-xfail-XPG4/grp.h/linknamespace): Likewise.
	(test-xfail-XPG4/libgen.h/linknamespace): Likewise.
	(test-xfail-XPG4/math.h/linknamespace): Likewise.
	(test-xfail-XPG4/netdb.h/linknamespace): Likewise.
	(test-xfail-XPG4/pwd.h/linknamespace): Likewise.
	(test-xfail-XPG4/regex.h/linknamespace): Likewise.
	(test-xfail-XPG4/search.h/linknamespace): Likewise.
	(test-xfail-XPG4/stdio.h/linknamespace): Likewise.
	(test-xfail-XPG4/stdlib.h/linknamespace): Likewise.
	(test-xfail-XPG4/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XPG4/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XPG4/syslog.h/linknamespace): Likewise.
	(test-xfail-XPG4/time.h/linknamespace): Likewise.
	(test-xfail-XPG4/unistd.h/linknamespace): Likewise.
	(test-xfail-XPG4/wordexp.h/linknamespace): Likewise.
	(test-xfail-POSIX/aio.h/linknamespace): Likewise.
	(test-xfail-POSIX/fnmatch.h/linknamespace): Likewise.
	(test-xfail-POSIX/glob.h/linknamespace): Likewise.
	(test-xfail-POSIX/math.h/linknamespace): Likewise.
	(test-xfail-POSIX/mqueue.h/linknamespace): Likewise.
	(test-xfail-POSIX/pthread.h/linknamespace): Likewise.
	(test-xfail-POSIX/regex.h/linknamespace): Likewise.
	(test-xfail-POSIX/sched.h/linknamespace): Likewise.
	(test-xfail-POSIX/semaphore.h/linknamespace): Likewise.
	(test-xfail-POSIX/sys/mman.h/linknamespace): Likewise.
	(test-xfail-POSIX/time.h/linknamespace): Likewise.
	(test-xfail-POSIX/unistd.h/linknamespace): Likewise.
	(test-xfail-POSIX/wordexp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/aio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/ctype.h/linknamespace): Likewise.
	(test-xfail-UNIX98/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-UNIX98/fnmatch.h/linknamespace): Likewise.
	(test-xfail-UNIX98/glob.h/linknamespace): Likewise.
	(test-xfail-UNIX98/grp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/libgen.h/linknamespace): Likewise.
	(test-xfail-UNIX98/math.h/linknamespace): Likewise.
	(test-xfail-UNIX98/mqueue.h/linknamespace): Likewise.
	(test-xfail-UNIX98/netdb.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pthread.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pwd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/regex.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sched.h/linknamespace): Likewise.
	(test-xfail-UNIX98/search.h/linknamespace): Likewise.
	(test-xfail-UNIX98/semaphore.h/linknamespace): Likewise.
	(test-xfail-UNIX98/stdio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/stdlib.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sys/mman.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-UNIX98/syslog.h/linknamespace): Likewise.
	(test-xfail-UNIX98/time.h/linknamespace): Likewise.
	(test-xfail-UNIX98/unistd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/wchar.h/linknamespace): Likewise.
	(test-xfail-UNIX98/wordexp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/aio.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fcntl.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/glob.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/grp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/libgen.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/mqueue.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/net/if.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/netdb.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/pthread.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/pwd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/regex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/search.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/semaphore.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/signal.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/spawn.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/stdlib.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/wait.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/syslog.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/tgmath.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/time.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/ucontext.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/unistd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/wordexp.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/aio.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/complex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/ctype.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/dirent.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/fcntl.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/grp.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/math.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/mqueue.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/net/if.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/netdb.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/pthread.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/regex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/semaphore.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/spawn.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/sys/mman.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/tgmath.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/time.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/unistd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/aio.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/dirent.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/fcntl.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/grp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/libgen.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/mqueue.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/net/if.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/netdb.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/pthread.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/pwd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/regex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/search.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/semaphore.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/spawn.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/syslog.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/tgmath.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/time.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
2014-11-12 22:45:25 +00:00
Joseph Myers
cc67478e28 Fix localealias.c fgets_unlocked namespace (bug 17589).
intl/localealias.c is brought in by ISO C functions, but uses
fgets_unlocked, which is not an ISO C function.  This patch changes
this to use __fgets_unlocked.

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

	[BZ #17589]
	* intl/localealias.c [_LIBC] (FGETS): Use __fgets_unlocked instead
	of fgets_unlocked.
2014-11-12 22:42:22 +00:00
Joseph Myers
9975e3d37d Fix locale memmem namespace (bug 17585).
Locale code, brought in by ISO C functions, calls memmem, which is not
an ISO C function.  This isn't an ISO C conformance bug, because all
mem* names are reserved, but glibc practice is not to rely on that
reservation (thus, memmem is only declared in string.h if __USE_GNU
even though ISO C would allow it to be declared unconditionally, for
example).  This patch changes that code to use __memmem.

Note: there are uses of memmem elsewhere in glibc that I didn't
change, although it may turn out some of those also need to use
__memmem.

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

	[BZ #17585]
	* string/memmem.c [!_LIBC] (__memmem): Define to memmem.
	(memmem): Rename to __memmem and define as weak alias of
	__memmem.  Use libc_hidden_weak.
	(__memmem): Use libc_hidden_def.
	* include/string.h (__memmem): Declare.  Use libc_hidden_proto.
	* locale/findlocale.c (valid_locale_name): Use __memmem instead of
	memmem.
2014-11-12 22:41:03 +00: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
01cad84e19 Fix __printf_fp wmemset namespace (bug 17574).
__printf_fp calls wmemset, but that is not an ISO C90 function.  This
patch fixes it to call a new __wmemset name instead (with wmemset
being a weak alias).

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

	[BZ #17574]
	* wcsmbs/wmemset.c (wmemset): Rename to __wmemset and define as
	weak alias of __wmemset.  Use libc_hidden_weak.
	(__wmemset): Use libc_hidden_def.
	* include/wchar.h (__wmemset): Declare.  Use libc_hidden_proto.
	* stdio-common/printf_fp.c (___printf_fp): Call __wmemset instead
	of wmemset.
2014-11-12 22:38:11 +00:00
Joseph Myers
939da41143 Fix stpcpy / mempcpy namespace (bug 17573).
Various glibc functions call __stpcpy and __mempcpy for namespace
reasons instead of plain stpcpy and mempcpy.  But __stpcpy and
__mempcpy are macros that call __builtin_stpcpy and __builtin_mempcpy,
and unless GCC optimizes the calls, they end up calling the C
functions stpcpy and mempcpy.

For calls from within shared libc, libc_hidden_builtin_proto ensures
that calls to those C functions are in turn mapped to call __GI_stpcpy
and __GI_mempcpy.  However, for static libc, and for calls from shared
libraries other than libc, the ELF symbols stpcpy and mempcpy end up
getting called, breaking the ISO C namespace (in the case of stpcpy)
or glibc conventions about not relying on the "future library
directions" reservations (in the case of mempcpy).

This patch fixes this by adding declarations of these functions to
include/string.h, under an appropriate condition, with __asm__ used to
change the assembler name used for calls (the mempcpy case was
previously discussed, and the approach for the fix is as I suggested
in <https://sourceware.org/ml/libc-alpha/2013-02/msg00063.html>).

Tested for x86_64 with the testsuite; also checked that dcigettext.o
(an example previously noted of undesired calls to stpcpy and mempcpy)
now calls __stpcpy and __mempcpy instead, as do non-libc shared
libraries (__stpcpy and __mempcpy were already exported from shared
libc).  Disassembly of installed shared libraries isn't easy to
compare because of reordered PLT entries resulting from the change in
functions called (libnsl, libnss_compat, libnss_dns, libnss_files,
libnss_hesiod, libnss_nis, libnss_nisplus, libpthread, librt all have
such changes).

	[BZ #17573]
	* include/string.h [NOT_IN_libc || !SHARED] (mempcpy): Declare
	with asm name __mempcpy.
	[NOT_IN_libc || !SHARED] (stpcpy): Declare with asm name __stpcpy.
2014-11-12 22:36:34 +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
c52ff39e8e Fix malloc_info namespace (bug 17570).
malloc_info is defined in the same file as malloc and free, but is not
an ISO C function, so should be a weak symbol.  This patch makes it
so.

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

	[BZ #17570]
	* malloc/malloc.c (malloc_info): Rename to __malloc_info and
	define as weak alias of __malloc_info.
2014-11-12 22:31:38 +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
Joseph Myers
5a6fa4d7ed Fix tzfile.c namespace (bug 17583).
tzfile.c is brought in by various ISO C functions, but calls fileno,
fread_unlocked and ftello, which are not ISO C functions.  This patch
adds names __fileno, __fread_unlocked and __ftello for those
functions, making tzfile.c use those new names.

Note: there are various uses of fileno elsewhere in glibc that I
didn't change, although it may turn out that some of those also need
to use __fileno.

Tested for x86_64 with the glibc testsuite.  Changed line numbers in
tzfile.c cause changes in assertions, and for some reason this ends up
with different instruction choice and register allocation, affecting
the size of __tzfile_read and so making comparison of disassembly for
libc.so problematic.

	[BZ #17583]
	* libio/fileno.c (fileno): Rename to __fileno and define as weak
	alias of __fileno.  Use libc_hidden_weak.
	(__fileno): Use libc_hidden_def.
	[weak_alias] (fileno_unlocked): Define as weak alias of __fileno.
	* libio/ftello.c (ftello): Rename to __ftello and define as weak
	alias of __ftello.
	[__OFF_T_MATCHES_OFF64_T] (ftello64): Define as weak alias of
	__ftello.
	* libio/iofread.c [weak_alias && !_IO_MTSAFE_IO]
	(__fread_unlocked): Define as strong alias of _IO_fread.  Use
	libc_hidden_def.
	(fread_unlocked): Don't use libc_hidden_ver.
	* libio/iofread_u.c (fread_unlocked): Rename to __fread_unlocked
	and define as weak alias of __fread_unlocked.  Don't use
	libc_hidden_def.
	(__fread_unlocked): Use libc_hidden_def.
	* include/stdio.h (__fileno): Declare.  Use libc_hidden_proto.
	(ftello): Don't use libc_hidden_proto.
	(__ftello): Declare.  Use libc_hidden_proto.
	(fread_unlocked): Don't use libc_hidden_proto.
	(__fread_unlocked): Declare.  Use libc_hidden_proto.
	* time/tzfile.c (__tzfile_read): Use __fileno, __fread_unlocked
	and __ftello instead of fileno, fread_unlocked and ftello.
2014-11-12 16:22:51 +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
Leonhard Holz
fffa1cf8a7 Fix tst-strcoll-overflow returning before timeout (BZ #17506)
Modifies the test examination in test-skeleton.c so that a test can be
successful if it is interrupted or it returns uninterrupted with the
expected status. For this both EXPECTED_SIGNAL and EXPECTED_STATUS
have to be set, as is done in tst-strcoll-overflow.c.
2014-11-12 17:10:21 +05:30
Tatiana Udalova
fb89b46d1d New Bhilodi and Tulu locales (BZ #17475) 2014-11-12 17:06:39 +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
Marcus Shawcroft
b17fe01b63 Fix ChangeLog formatting of previous commit. 2014-11-11 15:51:55 +00:00
Renlin Li
80085defb8 [AArch64] End frame record chain correctly. 2014-11-11 15:02:02 +00:00
Andrew Senkevich
bd80507166 Update minimal required bunutils version to 2.22 2014-11-10 11:16:46 -08: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
a2887bdb27 manual/llio.texi: Comment on write atomicity.
We add Linux-realted comments about the atomicity of
write with respect to file offsets. As of Linux 3.14
the file offset update is atomic. That means that
multiple threads calling the write syscall can not possibly
get the same file offset. Therefore the writes should
not overlap and data should not be lost as is required
by POSIX.
2014-11-06 15:58:52 -05: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
Adhemerval Zanella
af83568d3f libio: Refactor tst-fmemopen to use test-skeleton.c
This patch refactor tst-fmemopen.c to use test-skeleton.c.  No logic
changes are added.
2014-11-05 12:19:40 -02:00
Will Newton
b01ee67cb5 benchtests: Add malloc microbenchmark
Add a microbenchmark for measuring malloc and free performance with
varying numbers of threads. The benchmark allocates and frees buffers
of random sizes in a random order and measures the overall execution
time and RSS. Variants of the benchmark are run with 1, 8, 16 and
32 threads.

The random block sizes used follow an inverse square distribution
which is intended to mimic the behaviour of real applications which
tend to allocate many more small blocks than large ones.

ChangeLog:

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

	* benchtests/Makefile: (bench-malloc): Add malloc thread
	scalability benchmark.
	* benchtests/bench-malloc-threads.c: New file.
2014-11-05 14:13:00 +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
Joseph Myers
2004e7fb76 soft-fp: Add _FP_TO_INT_ROUND.
Continuing the series of patches adding soft-fp features from the
kernel version of soft-fp to glibc so that glibc's version is able to
replace the old fork of soft-fp in the kernel, this patch adds the
last major such feature: _FP_TO_INT_ROUND, converting a floating-point
number to an integer with rounding according to the current rounding
direction (as opposed to truncating towards zero, which _FP_TO_INT
does).

The general structure of the implementation follows that of
_FP_TO_INT, but of course is more complicated.  As with glibc's
_FP_TO_INT it works with raw input (the kernel versions of these
macros predate the conversion of _FP_TO_INT and many other macros to
raw or semi-raw input).  I have not tried to work out what bugs there
might be in the kernel version that this might fix; it's a
from-scratch implementation based on _FP_TO_INT.

Tested for powerpc (soft-float) that there is no change to the
installed shared libraries; also tested with the libm tests with lrint
/ lrintf / llrint / llrintf made to use _FP_TO_INT_ROUND, to provide
some test of the functionality.  As we don't have benchmarks for those
functions, I haven't actually included the soft-fp versions of them,
although I expect them to be faster than the existing code (given that
the existing code involves adding and subtracting numbers such as
0x1p52 to achieve the desired rounding, which is not particularly
efficient when the underlying floating point is software floating
point).

2014-11-04  Joseph Myers  <joseph@codesourcery.com>

	* soft-fp/op-common.h (_FP_TO_INT_ROUND): New macro.
	* soft-fp/double.h [_FP_W_TYPE_SIZE < 64] (FP_TO_INT_ROUND_D): New
	macro.
	[_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_ROUND_D): Likewise.
	* soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_TO_INT_ROUND_E):
	New macro.
	[_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_ROUND_E): Likewise.
	* soft-fp/quad.h [_FP_W_TYPE_SIZE < 64] (FP_TO_INT_ROUND_Q): New
	macro.
	[_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_ROUND_Q): Likewise.
	* soft-fp/single.h (FP_TO_INT_ROUND_S): New macro.
2014-11-04 16:34:49 +00:00
Andreas Schwab
97827bfc5f Remove unused include 2014-11-04 15:32:07 +01: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
Andreas Schwab
04b76b5aa8 Don't error out writing a multibyte character to an unbuffered stream (bug 17522) 2014-11-03 09:58:24 +01: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
Joseph Myers
2626c18374 Make aclocal.m4 comment mention updating install.texi for autoconf version.
* aclocal.m4 (GLIBC_AUTOCONF_VERSION): Mention need to update
	install.texi in comment.
2014-10-31 22:44:17 +00:00
Torvald Riegel
7f981fc24a powerpc: Change atomic_write_barrier to have release semantics. 2014-10-31 23:26:22 +01:00
Matthew Fortune
d6f373d21b Add a hook to enable load-time inspection of program headers
This hook can be used to perform additional compatibility checks
between shared libraries by inspecting custom program header
information.

	* elf/dl-machine-reject-phdr.h: New file.
	* elf/dl-load.c: #include that.
	(open_verify): Call elf_machine_reject_phdr_p and ignore the file
	if that returned true.
2014-10-31 22:19:23 +00:00