Stefan Liebler [Thu, 13 Nov 2014 09:44:11 +0000 (10:44 +0100)]
S/390: Get rid of warning unused variable in dl-machine.h.
Stefan Liebler [Thu, 13 Nov 2014 09:42:31 +0000 (10:42 +0100)]
S/390: Get rid of warning: the comparision will always evaluate as false.
Roland McGrath [Wed, 12 Nov 2014 22:50:09 +0000 (14:50 -0800)]
NPTL: Move __libc_multiple_threads_ptr defn to nptl-init.c
Joseph Myers [Wed, 12 Nov 2014 22:45:25 +0000 (22:45 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:42:22 +0000 (22:42 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:41:03 +0000 (22:41 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:39:36 +0000 (22:39 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:38:11 +0000 (22:38 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:36:34 +0000 (22:36 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:35:12 +0000 (22:35 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:33:41 +0000 (22:33 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 22:31:38 +0000 (22:31 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 16:24:16 +0000 (16:24 +0000)]
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.
Joseph Myers [Wed, 12 Nov 2014 16:22:51 +0000 (16:22 +0000)]
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.
Siddhesh Poyarekar [Wed, 12 Nov 2014 09:02:41 +0000 (14:32 +0530)]
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.
Siddhesh Poyarekar [Wed, 12 Nov 2014 14:00:24 +0000 (19:30 +0530)]
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.
Leonhard Holz [Wed, 12 Nov 2014 11:40:21 +0000 (17:10 +0530)]
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.
Tatiana Udalova [Wed, 12 Nov 2014 11:36:39 +0000 (17:06 +0530)]
New Bhilodi and Tulu locales (BZ #17475)
Alan Hayward [Tue, 11 Nov 2014 16:32:34 +0000 (16:32 +0000)]
[AArch64] Add ipc.h.
Adding ipc.h for AArch64 adjusted to behave correctly on big endian
targets.
Marcus Shawcroft [Tue, 11 Nov 2014 15:51:55 +0000 (15:51 +0000)]
Fix ChangeLog formatting of previous commit.
Renlin Li [Tue, 11 Nov 2014 15:02:02 +0000 (15:02 +0000)]
[AArch64] End frame record chain correctly.
Andrew Senkevich [Mon, 10 Nov 2014 19:16:46 +0000 (11:16 -0800)]
Update minimal required bunutils version to 2.22
Andreas Schwab [Fri, 7 Nov 2014 16:36:36 +0000 (17:36 +0100)]
m68k: don't expect PLT reference to __tls_get_addr
Joseph Myers [Fri, 7 Nov 2014 01:27:16 +0000 (01:27 +0000)]
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.
Carlos O'Donell [Thu, 6 Nov 2014 20:58:52 +0000 (15:58 -0500)]
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.
Carlos O'Donell [Thu, 6 Nov 2014 20:48:44 +0000 (15:48 -0500)]
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
Joseph Myers [Wed, 5 Nov 2014 23:35:36 +0000 (23:35 +0000)]
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.
Adhemerval Zanella [Wed, 11 Jun 2014 18:00:14 +0000 (15:00 -0300)]
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.
Will Newton [Wed, 11 Sep 2013 14:47:12 +0000 (15:47 +0100)]
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.
Richard Earnshaw [Wed, 5 Nov 2014 13:51:56 +0000 (13:51 +0000)]
[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.
Adhemerval Zanella [Wed, 5 Nov 2014 13:01:09 +0000 (08:01 -0500)]
powerpc: Simplify encoding of POWER8 instruction
Arjun Shankar [Wed, 5 Nov 2014 09:54:08 +0000 (15:24 +0530)]
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.
Joseph Myers [Wed, 5 Nov 2014 01:02:47 +0000 (01:02 +0000)]
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.
Joseph Myers [Tue, 4 Nov 2014 23:26:39 +0000 (23:26 +0000)]
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.
Joseph Myers [Tue, 4 Nov 2014 17:39:39 +0000 (17:39 +0000)]
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.
Joseph Myers [Tue, 4 Nov 2014 16:34:49 +0000 (16:34 +0000)]
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.
Andreas Schwab [Wed, 17 Sep 2014 10:34:24 +0000 (12:34 +0200)]
Remove unused include
Adhemerval Zanella [Mon, 3 Nov 2014 12:26:33 +0000 (07:26 -0500)]
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.
Andreas Schwab [Thu, 30 Oct 2014 11:18:48 +0000 (12:18 +0100)]
Don't error out writing a multibyte character to an unbuffered stream (bug 17522)
Jose E. Marchesi [Sat, 1 Nov 2014 20:45:02 +0000 (13:45 -0700)]
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.
Joseph Myers [Sat, 1 Nov 2014 12:26:09 +0000 (12:26 +0000)]
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.
Joseph Myers [Fri, 31 Oct 2014 22:44:17 +0000 (22:44 +0000)]
Make aclocal.m4 comment mention updating install.texi for autoconf version.
* aclocal.m4 (GLIBC_AUTOCONF_VERSION): Mention need to update
install.texi in comment.
Torvald Riegel [Fri, 17 Oct 2014 23:01:58 +0000 (01:01 +0200)]
powerpc: Change atomic_write_barrier to have release semantics.
Matthew Fortune [Wed, 1 Oct 2014 16:08:51 +0000 (17:08 +0100)]
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.
Roland McGrath [Fri, 31 Oct 2014 22:07:36 +0000 (15:07 -0700)]
BZ#17496: Fix gnu/lib-names.h dependency.
Joseph Myers [Fri, 31 Oct 2014 21:49:35 +0000 (21:49 +0000)]
Update autoconf version requirement in install.texi.
I noticed that install.texi was out of date with regard to the actual
autoconf version requirement for regenerating configure scripts. This
patch updates the documentation.
* manual/install.texi (Tools for Compilation): Update autoconf
version requirements.
* INSTALL: Regenerated.
Joseph Myers [Fri, 31 Oct 2014 21:22:35 +0000 (21:22 +0000)]
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.
Joseph Myers [Fri, 31 Oct 2014 21:21:15 +0000 (21:21 +0000)]
Add bug 15215 to NEWS; move bug 17344 to correct version's list in NEWS.
Joseph Myers [Fri, 31 Oct 2014 21:13:32 +0000 (21:13 +0000)]
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.
Torvald Riegel [Wed, 29 Oct 2014 18:14:14 +0000 (19:14 +0100)]
Fix SPARC atomic_write_barrier.
Roland McGrath [Thu, 30 Oct 2014 20:19:34 +0000 (13:19 -0700)]
Clean up internal ctype.h header.
Joseph Myers [Thu, 30 Oct 2014 20:56:34 +0000 (20:56 +0000)]
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.
Roland McGrath [Thu, 30 Oct 2014 19:56:51 +0000 (12:56 -0700)]
Clean up wchar_t conversion code in iconv program.
Joseph Myers [Thu, 30 Oct 2014 19:44:31 +0000 (19:44 +0000)]
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.
Carlos O'Donell [Thu, 30 Oct 2014 00:39:07 +0000 (20:39 -0400)]
manual/llio.texi: Add Linux-specific comments for write().
Add Linux-specific comments about the atomicity of write() and
the POSIX requirements.
2014-10-29 Carlos O'Donell <carlos@redhat.com>
* manual/llio.texi: Add comments discussing why write() may be
considered MT-unsafe on Linux.
Carlos O'Donell [Tue, 28 Oct 2014 23:37:07 +0000 (19:37 -0400)]
elf/dl-load.c: Use __strdup.
During a refactoring pass several repeated blocks of code in dl-load.c
were turned into a call to a local function named local_strdup. There
is no need for local_strdup, and the routines should instead call
__strdup. This change does just that. We call the internal symbol
__strdup because calling strdup is unsafe. The user might be
using a standard that doesn't include strdup and may have defined this
symbol in their application. During a static link we might reference
the user defined symbol and crash if it doesn't implement a standards
conforming strdup. The resulting code is simpler to understand, and
makes it easier to debug.
No regressions on x86_64.
2014-10-28 Carlos O'Donell <carlos@redhat.com>
* dl-load.c (local_strdup): Remove.
(expand_dynamic_string_token): Use __strdup.
(decompose_rpath): Likewise.
(_dl_map_object): Likewise.
Joseph Myers [Tue, 28 Oct 2014 17:12:57 +0000 (17:12 +0000)]
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.
Gratian Crisan [Mon, 27 Oct 2014 22:45:43 +0000 (22:45 +0000)]
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.
Joseph Myers [Mon, 27 Oct 2014 12:24:42 +0000 (12:24 +0000)]
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.
Andreas Schwab [Tue, 21 Oct 2014 09:09:19 +0000 (11:09 +0200)]
Fix misdetected Slow_SSE4_2 cpu feature bit (bug 17501)
Roland McGrath [Fri, 24 Oct 2014 21:45:47 +0000 (14:45 -0700)]
Rework compiler version check in configure.
Roland McGrath [Fri, 24 Oct 2014 19:37:36 +0000 (12:37 -0700)]
Prototypify htonl and htons definitions.
Wilco Dijkstra [Fri, 24 Oct 2014 16:12:12 +0000 (16:12 +0000)]
This patch improves strncat performance by using strlen. Strlen has a fast C implementation, so
this
will improve performance even on targets which don't have an optimized strlen. It is about twice
as
fast as the original strncat in bench-strncat.
Wilco Dijkstra [Fri, 24 Oct 2014 16:08:42 +0000 (16:08 +0000)]
This patch improves strcat performance by using strlen and strcpy. Strlen has a fast C
implementation, so this improves performance even on targets which don't have an optimized
strlen and strcpy - it is 25% faster in bench-strcat. On targets which don't provide an
optimized strcat but which do have an optimized strlen and strcpy, performance gain is > 2x.
Wilco Dijkstra [Fri, 24 Oct 2014 13:23:12 +0000 (13:23 +0000)]
Call libc_fetestexcept_aarch64 from math_private.h rather than duplicating functionality.
Wilco Dijkstra [Fri, 24 Oct 2014 13:21:27 +0000 (13:21 +0000)]
Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating functionality.
Wilco Dijkstra [Fri, 24 Oct 2014 13:19:24 +0000 (13:19 +0000)]
Call get_rounding_mode rather than duplicating functionality.
Wilco Dijkstra [Fri, 24 Oct 2014 13:07:17 +0000 (13:07 +0000)]
Cleanup feenableexcept to use the same logic as the ARM version. No functional changes.
Wilco Dijkstra [Fri, 24 Oct 2014 13:06:04 +0000 (13:06 +0000)]
Cleanup fedisableexcept to use the same logic as the ARM version. No functional changes.
Wilco Dijkstra [Fri, 24 Oct 2014 13:01:38 +0000 (13:01 +0000)]
Cleanup feclearexcept to use the same logic as the ARM version. No functional changes.
Wilco Dijkstra [Fri, 24 Oct 2014 12:59:44 +0000 (12:59 +0000)]
Cleanup fesetexceptflag to use the same logic as the ARM version. No functional changes.
Wilco Dijkstra [Fri, 24 Oct 2014 12:57:49 +0000 (12:57 +0000)]
Remove an unused include.
Joseph Myers [Fri, 24 Oct 2014 13:01:17 +0000 (13:01 +0000)]
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.
Joseph Myers [Fri, 24 Oct 2014 12:57:59 +0000 (12:57 +0000)]
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.
Wilco Dijkstra [Fri, 24 Oct 2014 12:53:19 +0000 (12:53 +0000)]
Remove spaces.
Carlos O'Donell [Fri, 24 Oct 2014 03:14:12 +0000 (23:14 -0400)]
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.
Joseph Myers [Thu, 23 Oct 2014 21:43:41 +0000 (21:43 +0000)]
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.
Roland McGrath [Wed, 22 Oct 2014 20:17:20 +0000 (13:17 -0700)]
Rework some nscd code not to use variable-length struct types.
Roland McGrath [Wed, 22 Oct 2014 21:20:35 +0000 (14:20 -0700)]
ARM: Use movw/movt more when available
Maciej W. Rozycki [Wed, 22 Oct 2014 14:20:37 +0000 (15:20 +0100)]
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.
Joseph Myers [Tue, 21 Oct 2014 23:11:49 +0000 (23:11 +0000)]
Don't use INTDEF with __ldexpf (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch removes the use of INTDEF for __ldexpf. As far as I can tell,
the resulting alias is completely unused.
Tested for x86_64 that stripped installed shared libraries are
unchanged by this patch.
[BZ #14132]
* math/s_ldexpf.c (__ldexpf): Do not use INTDEF.
Roland McGrath [Tue, 21 Oct 2014 17:18:17 +0000 (10:18 -0700)]
Avoid local PLT reference in __nptl_main.
Roland McGrath [Mon, 20 Oct 2014 22:32:26 +0000 (15:32 -0700)]
Tiny refactoring in fts to eliminate a warning.
Roland McGrath [Mon, 20 Oct 2014 21:54:12 +0000 (14:54 -0700)]
NPTL: Clean up gratuitous Linuxism in libpthread.so entry point.
Roland McGrath [Mon, 20 Oct 2014 21:46:00 +0000 (14:46 -0700)]
NPTL: Add some missing #include's
Roland McGrath [Mon, 20 Oct 2014 21:13:14 +0000 (14:13 -0700)]
Make internal lock-init macros return void.
Torvald Riegel [Sun, 19 Oct 2014 19:59:26 +0000 (21:59 +0200)]
pthread_once: Add fast path and remove x86 variants.
Torvald Riegel [Fri, 11 Oct 2013 15:58:04 +0000 (18:58 +0300)]
pthread_once: Clean up constants.
[BZ #15215] This just gives a name to the integer constants being used.
Joseph Myers [Mon, 20 Oct 2014 15:49:08 +0000 (15:49 +0000)]
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.
Roland McGrath [Fri, 17 Oct 2014 22:40:36 +0000 (15:40 -0700)]
Remove obsolete TLS_DEFINE_INIT_TP fallback.
Roland McGrath [Fri, 17 Oct 2014 22:03:00 +0000 (15:03 -0700)]
NPTL: Clean up THREAD_SYSINFO macros.
Roland McGrath [Fri, 17 Oct 2014 21:30:16 +0000 (14:30 -0700)]
NPTL: Conditionalize direct futex syscall uses.
Roland McGrath [Fri, 17 Oct 2014 20:40:46 +0000 (13:40 -0700)]
NPTL: Conditionalize more uses of SIGCANCEL and SIGSETXID.
Roland McGrath [Fri, 17 Oct 2014 18:30:15 +0000 (11:30 -0700)]
Fix NPTL build error when missing __NR_set_robust_list.
Siddhesh Poyarekar [Fri, 17 Oct 2014 10:22:46 +0000 (15:52 +0530)]
Fix up incorrect formatting in last commit
Leonhard Holz [Fri, 17 Oct 2014 10:17:23 +0000 (15:47 +0530)]
strcoll: improve performance by removing the cache (#15884)
this is a path that should solve bug 15884. It complains about the performance
of strcoll(). It was found out that the runtime of strcoll() is actually bound
to strlen which is needed for calculating the size of a cache that was
installed to improve the comparison performance.
The idea for this patch was that the cache is only useful in rare cases
(strings of same length and same first-level-chars) and that it would be
better to avoid memory allocation at all. To prove this I wrote a performance
test bench-strcoll.c with test data in benchtests-strcoll.tar.gz. Also
modifications in benchtests/Makefile and localedata/Makefile are necessary to
make it work.
After removing the cache the strcoll method showed the predicted behavior
(getting slightly faster) in all but the test case for hindi word sorting.
This was due the hindi text having much more equal words than the other ones.
For equal strings the performance was worse since all comparison levels were
run through and from the second level on the cache improved the comparison
performance of the original version.
Therefore I added a bytewise test via strcmp iff the first level comparison
found that both strings did match because in this case it is very likely that
equal strings are compared. This solved the problem with the hindi test case
and improved the performance of the others.
Performance comparison:
glibc files -33.77%
vi_VN.UTF-8 -34.12%
en_US.UTF-8 -42.42%
ar_SA.UTF-8 -27.49%
zh_CN.UTF-8 +07.90%
cs_CZ.UTF-8 -29.67%
en_GB.UTF-8 -28.50%
da_DK.UTF-8 -36.57%
pl_PL.UTF-8 -39.31%
fr_FR.UTF-8 -28.57%
pt_PT.UTF-8 -22.82%
el_GR.UTF-8 -26.77%
ru_RU.UTF-8 -35.81%
iw_IL.UTF-8 -35.34%
es_ES.UTF-8 -34.46%
hi_IN.UTF-8 -00.38%
sv_SE.UTF-8 -36.99%
hu_HU.UTF-8 -16.35%
tr_TR.UTF-8 -27.80%
is_IS.UTF-8 -33.24%
it_IT.UTF-8 -24.39%
sr_RS.UTF-8 -37.55%
ja_JP.UTF-8 +02.84%
Roland McGrath [Thu, 16 Oct 2014 16:54:45 +0000 (09:54 -0700)]
Remove sysdeps/arm/soft-fp directory.
Joseph Myers [Tue, 14 Oct 2014 17:00:11 +0000 (17:00 +0000)]
conformtest: clean up POSIX expections for sys/utsname.h, sys/wait.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/utsname.h and
sys/wait.h. Tested x86_64; a new XFAIL for sys/wait.h is added.
* conform/data/sys/utsname.h-data (*_t): Allow.
* conform/data/sys/wait.h-data [POSIX] (uid_t): Do not define.
[POSIX] (WEXITED): Do not expect constant.
[POSIX] (WSTOPPED): Likewise.
[POSIX] (WNOHANG): Likewise.
[POSIX] (WNOWAIT): Likewise.
[POSIX] (siginfo_t): Do not expect type or elements.
[POSIX] (pid_t): Do not expect type.
[POSIX] (signal.h): Do not allow header.
[POSIX] (sys/resource.h): Likewise.
[POSIX] (si_*): Do not allow pattern.
[POSIX] (W*): Likewise.
[POSIX] (P_*): Likewise.
[POSIX] (BUS_*): Likewise.
[POSIX] (CLD_*): Likewise.
[POSIX] (FPE_*): Likewise.
[POSIX] (ILL_*): Likewise.
[POSIX] (POLL_*): Likewise.
[POSIX] (SEGV_*): Likewise.
[POSIX] (SI_*): Likewise.
[POSIX] (TRAP_*): Likewise.
* conform/Makefile (test-xfail-POSIX/sys/wait.h/conform): New
variable.
Siddhesh Poyarekar [Tue, 14 Oct 2014 15:35:33 +0000 (21:05 +0530)]
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.
Joseph Myers [Fri, 10 Oct 2014 17:05:58 +0000 (17:05 +0000)]
Remove CANCEL-FCT-WAIVE and CANCEL-FILE-WAIVE.
As far as I can tell, CANCEL-FCT-WAIVE and CANCEL-FILE-WAIVE are old
notes from the addition of cancellation support to glibc and are not
currently used by any glibc testcases or otherwise in the build
process, and it does not seem useful to me to keep them around. This
patch removes them.
Tested for x86_64.
* CANCEL-FCT-WAIVE: Remove file.
* CANCEL-FILE-WAIVE: Likewise.