Commit Graph

29373 Commits

Author SHA1 Message Date
Paul Pluzhnikov 2ba30a182c Add #include <unistd.h> to libio/oldfileops.c for write. 2015-08-06 08:51:31 -07:00
Mike Frysinger 283c873654 fix missing ctype.h include
This file uses isspace but doesn't include ctype.h leading to:
isomac.c: In function 'get_null_defines':
isomac.c:305:30: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
	for (end = start + 1; !isspace (*end) && *end != '\0'; ++end)
2015-08-06 02:59:52 -04:00
Arjun Shankar c1f4108352 Modify several tests to use test-skeleton.c
These tests were skipped by the use-test-skeleton conversion done in
commit 29955b5d because they did not have an `int main (void)'
declaration. Instead their `main' functions were declared with arguments
(i.e. argc, argv) even though they didn't use them.

Remove these arguments and include the test skeleton in these tests.
2015-08-06 02:59:04 -04:00
Zack Weinberg a03ba36305 Correct comments about the history of <regexp.h>
In the "Kill regexp.h" thread, Joseph dug up more accurate information
about exactly which editions of the Single Unix Standard included and
deprecated this header.
2015-08-05 22:38:22 -04:00
Andreas Schwab bb1d31d06e Properly terminate FDE in makecontext for m68k (bug 18635) 2015-08-05 23:35:28 +02:00
H.J. Lu 72354ab5e1 Align stack to 16 bytes when calling __errno_location
We should align stack to 16 bytes when calling __errno_location.

	[BZ #18661]
	* sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
	when calling __errno_location.
	* sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
	* sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.
2015-08-05 08:36:27 -07:00
H.J. Lu b4425b95ad Align stack to 16 bytes when calling __gettimeofday
Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
to 16 bytes when calling __gettimeofday.

	[BZ #18661]
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
	(__lll_timedwait_tid): Align stack to 16 bytes when calling
	__gettimeofday.
2015-08-05 08:36:18 -07:00
H.J. Lu 8e1f346462 Align stack to 16 bytes when calling __setcontext
Don't use pop to restore %rdi so that stack is aligned to 16 bytes
when calling __setcontext.

	[BZ #18661]
	* sysdeps/unix/sysv/linux/x86_64/__start_context.S
	(__start_context): Don't use pop to restore %rdi so that stack
	is aligned to 16 bytes when calling __setcontext.
2015-08-05 08:36:12 -07:00
H.J. Lu 3b8d2eb7f8 Compile {memcpy,strcmp}-sse2-unaligned.S only for libc
{memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

	* sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
	only for libc.
	* sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.
2015-08-05 08:28:37 -07:00
Wilco Dijkstra 05a910f7b4 Improve performance of mempcpy by inlining and using memcpy. Enable
this for all targets except sparc which has an optimized mempcpy
implementation.
2015-08-05 16:24:04 +01:00
Wilco Dijkstra f29ac72eff Improve memccpy performance by using memchr/memcpy/mempcpy rather than
a byte loop. Overall performance on bench-memccpy is > 2x faster when
using the C implementation of memchr and an optimized memcpy.
2015-08-05 16:24:03 +01:00
Wilco Dijkstra f6482cf29d This patch improves strncpy performance by using strnlen/memcpy rather than a byte loop. Performance
on bench-strncpy is 1.9-2.1x faster on average. I tried several variations, and using a tailcall and
calling memset conditionally gave the best overall results.
2015-08-05 16:24:02 +01:00
Wilco Dijkstra 7b1c56e483 Improve feenableexcept performance - avoid an unnecessary FPCR read in case
the FPCR does not change. Also improve the logic of the return value.
2015-08-05 16:24:02 +01:00
Wilco Dijkstra 3136eb7abd Improve fesetenv performance by avoiding unnecessary FPSR/FPCR reads/writes.
It uses the same logic as the ARM version. The common case removes 1 FPSR
and 1 FPCR read. For FE_DFL_ENV and FE_NOMASK_ENV a FPCR read is avoided in
case the FPCR does not change.
2015-08-05 16:24:01 +01:00
H.J. Lu 782723d6d8 Also check dead->data[category] != NULL
_nl_load_locale_from_archive (int category, const char **namep)

has

 for (cnt = 0; cnt < __LC_LAST; ++cnt)
    if (cnt != LC_ALL)
      {
        lia->data[cnt] = _nl_intern_locale_data (cnt,
                                                 results[cnt].addr,
                                                 results[cnt].len);
        if (__glibc_likely (lia->data[cnt] != NULL))
          {
...
          }
      }

lia->data[cnt] can be NULL, which happens to en_US.UTF-8 with
LC_COLLATE.  But this won't happen if glibc is configured with
--enable-hardcoded-path-in-tests.  We should also check
dead->data[category] != NULL.

	* locale/loadarchive.c (_nl_archive_subfreeres): Also check
	dead->data[category] != NULL.
2015-08-05 08:15:51 -07:00
Joseph Myers cf36e5034f Fix powf (close to -1, large) (bug 18647).
The flt-32 implementation of powf wrongly uses x-1 instead of |x|-1
when computing log (x) for the case where |x| is close to 1 and y is
large.  This patch fixes the logic accordingly.  Relevant tests
existed for x close to 1, and corresponding tests are added for x
close to -1, as well as for some new variant cases.

Tested for x86_64 and x86.

	[BZ #18647]
	* sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): For large y
	and |x| close to 1, use absolute value of x when computing log.
	* math/auto-libm-test-in: Add more tests of pow.
	* math/auto-libm-test-out: Regenerated.
2015-08-05 15:01:58 +00:00
Adhemerval Zanella 2aa6c8af26 arm: Assembly implementation cleanup
This patch removes arm assembly implementation of mmap and mmap64.
The new implementation used is the wordsize-32 generic linux one.

Tested on armhf.
2015-08-05 10:41:03 -03:00
Marko Myllynen 42eaa27fac localedata: remove timezone information [BZ #18525]
as discussed in the thread starting at

https://sourceware.org/ml/libc-alpha/2015-06/msg00098.html

it looks like the best options is to remove locale timezone information
from locales which currently provide it (in incomplete or incorrect
fashion) rather than to start duplicating tzdata info in glibc.
2015-08-05 05:02:18 -04:00
Daniel Marjamäki aeb47bbc06 Updated __nonnull annotations for wcscat, wcsncat, wcscmp and wcsncmp [BZ #18265]
This patch adds __nonnull annotations for wcscat, wcsncat, wcscmp and wcsncmp.

These added annotations match the annoations for strcat, strncat, strcmp, strncmp in glibc.
2015-08-05 04:43:42 -04:00
Mike Frysinger 496405af79 test-skeleton: add usage information
I keep trying to run tests with --help and then remembering that does
nothing when it throws an error.  That means I have to dig into the
source when I want to refer to flags or env vars and re-read a good
amount of code to find the nested locations.

Make this all much more user friendly with a usage screen that gets
printed out whenever an unknown option is specified.
2015-08-05 04:40:00 -04:00
Mike Frysinger 182d6096fe mmap64: fix undef warnings
The only target that defines this is m68k, so move the existing fallback
define up to avoid warnings on other systems.
2015-08-05 04:38:56 -04:00
Mike Frysinger 3fad53ec87 nptl: fix set-but-unused warning w/_STACK_GROWS_UP
On arches that set _STACK_GROWS_UP, the stacktop variable is declared
and set, but never actually used.  Refactor the code a bit so that the
variable is only declared/set under _STACK_GROWS_DOWN settings.
2015-08-05 04:27:03 -04:00
Carlos O'Donell 1b15ff4810 Open development for 2.23. 2015-08-05 03:01:50 -04:00
Carlos O'Donell 78bd7499af Update version.h and include/features.h for 2.22 release 2015-08-05 02:42:21 -04:00
Chris Metcalf 0d261f406d tilepro: fix warnings in sysdeps/tile/tilepro/bits/atomic.h
Using a ({ }) structure avoids the "value computed is not used"
that a simple () structure causes.
2015-08-04 12:07:53 -04:00
Andreas Schwab bbab82c25d Properly terminate FDE in makecontext for ix86 (bug 18635) 2015-08-04 17:46:56 +02:00
Carlos O'Donell 8cf0ac959d Updated translations for 2.22. 2015-08-01 14:48:31 -04:00
Zack Weinberg 2ec11c2b6e Deprecate the use of regexp.h
<regexp.h> (not to be confused with <regex.h>) is an obsolete and
frankly horrible regular expression-matching API.  It was part of SVID
but was withdrawn in Issue 5 (for reference, we're on Issue 7 now).
It doesn't do anything you can't do with <regex.h>, and using it
involves defining a bunch of macros before including the header.
Moreover, the code in regexp.h that uses those macros has been buggy
since its creation (in 1996) and no one has noticed, which indicates
to me that there are no users.  (Specifically, RETURN() is used in a
whole bunch of cases where it should have been ERROR().)

The header is given a warning and marked deprecated for 2.22.

See:
https://sourceware.org/ml/libc-alpha/2015-07/msg00862.html and
https://sourceware.org/ml/libc-alpha/2015-07/msg00871.html.
2015-08-01 14:38:05 -04:00
Carlos O'Donell f4ddb3557e Regenerate libc.pot for 2.22 release. 2015-07-31 00:13:33 -04:00
Andrew Senkevich a9e8ea51cc Prevent runtime fail of SSE vector math tests on non SSE4.1 machine.
[BZ #18740]
    * sysdeps/x86_64/fpu/Makefile (double-vlen2-arch-ext-cflags,
    float-vlen4-arch-ext-cflags): Removed.
    * math/Makefile (CFLAGS-test-double-vlen2-wrappers.c,
    CFLAGS-test-float-vlen4-wrappers.c): Likewise.
2015-07-30 18:00:24 +03:00
Mike Frysinger 0e569d30e3 hppa: add bz entry for pthreadtypes.h fix 2015-07-30 10:08:35 -04:00
Mike Frysinger 243cc404ca hppa: fix pthreadtypes.h namespace failures
The conform tests flag the "aligned" symbol used inside the attributes,
so rename it to __aligned__ like other headers.
2015-07-30 05:03:43 -04:00
Torvald Riegel 87ab9d55f7 hppa: Remove custom lowlevellock.h.
This untested patch removes the custom lowlevellock.h on hppa.  It seems
to contain an implementation equivalent to the generic lowlevellock.h.
2015-07-30 03:37:27 -04:00
Mike Frysinger 827e01851f hppa: sigaction.h: change sa_flags to an int
This fixes the conform test for the sigaction.h header and makes it match
all the other arches.
2015-07-29 23:14:03 -04:00
Mike Frysinger 979900af98 hppa: fix sysdep.h header setup
The semi-recent SYSCALL_CANCEL inclusion broke hppa due to the sysdep.h
headers not including the unix/sysdep.h headers.  Rework the includes so
we match the other ports:
* hppa/sysdep.h:
	- Do not include sys/syscall.h as the unix sysdep.h headers do it.
	- Do not include config.h as libc-symbols.h does it, and it has no
	#ifdef multiple-include protection, and it breaks when some files
	do things like #undef __OPTIMIZE__.
* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h:
	- Drop the generic/sysdep.h as the unix sysdep.h headers include it.
* sysdeps/unix/sysv/linux/hppa/sysdep.h:
	- Change to the unix & core hppa sysdep header stacks.
	- Undef a few defines that the core headers already set up for us.
2015-07-29 23:09:16 -04:00
Mike Frysinger a822b0187a hppa: rewrite INLINE_SYSCALL
The semi-recent SYSCALL_CANCEL macro imposes a slight nuance on the
implementation of INLINE_SYSCALL: the nr argument cannot be expanded
directly but must be passed on to another macro which may expand it.
Most arches don't notice because INLINE_SYSCALL is defined in terms
of INTERNAL_SYSCALL which has the additional layer of expansion, but
on hppa, it was attempting to expand it directly.  That causes build
errors like so:
../sysdeps/unix/sysv/linux/sigsuspend.c: In function '__sigsuspend':
../sysdeps/unix/sysv/linux/sigsuspend.c:31:62: error:
	implicit declaration of function 'LOAD_ARGS___SYSCALL_NARGS'
../sysdeps/unix/sysv/linux/sigsuspend.c:31:304: error:
	called object 'LOAD_ARGS___SYSCALL_NARGS(set, 8)' is not a function

So rewrite hppa's INLINE_SYSCALL to use INTERNAL_SYSCALL like other
arches do.  This is also a nice clean up as the two macros had quite
a bit of duplicated logic.
2015-07-29 23:08:15 -04:00
H.J. Lu 9637d8a253 Extend local PLT reference check
On x86, linker in binutils 2.26 and newer consolidates R_*_JUMP_SLOT with
R_*_GLOB_DAT relocation against the same symbol.  This patch extends
local PLT reference check to support alternate relocations.

	[BZ #18078]
	* scripts/check-localplt.awk: Support alternate relocations.
	* scripts/localplt.awk: Also check relocations in DT_RELA/DT_REL
	sections.
	* sysdeps/unix/sysv/linux/i386/localplt.data: Mark free and
	malloc entries with + REL R_386_GLOB_DAT.
	* sysdeps/x86_64/localplt.data: New file.
2015-07-29 11:58:06 -07:00
Andrew Senkevich febce2ac5f Added runtime check for AVX vector math tests.
[BZ #18731]
    * sysdeps/x86_64/fpu/math-tests-arch.h: Added AVX runtime check.
    * sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
    * sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2015-07-29 19:47:29 +03:00
Mike Frysinger 95d8f022bf ia64: drop __tls_get_addr from expected ld.so plt usage
This file was updated with an educated guess as to the symbols needed,
but on ia64, we don't have __tls_get_addr calls, so drop it from the
list.
2015-07-28 05:30:14 -04:00
Mike Frysinger cf31a2c799 ia64: atomic.h: fix atomic_exchange_and_add 64bit handling
Way back in 2005 the atomic_exchange_and_add function was cleaned up to
avoid the explicit size checking and instead let gcc handle things itself.
Unfortunately that change ended up leaving beyond a cast to int, even when
the incoming value was a long.  This has flown under the radar for a long
time due to the function not being heavily used in the tree (especially as
a full 64bit field), but a recent change to semaphores made some nptl tests
fail reliably.  This is due to the code packing two 32bit values into one
64bit variable (where the high 32bits contained the number of waiters), and
then the whole variable being atomically updated between threads.  On ia64,
that meant we never atomically updated the count, so sometimes the sem_post
would not wake up the waiters.
2015-07-28 02:30:15 -04:00
Mike Frysinger 18855eca32 ia64: clean up old kernel headers cruft
This define made more sense in the pre-sanitized kernel headers days,
but since we require kernel versions that are sanitized, we don't need
this hack anymore.
2015-07-28 02:29:30 -04:00
Mike Frysinger 1eb8bf8049 pwd.h: revert __nonnull markings on putpwent [BZ #18641]
This function actually checks for NULL arguments and the API has been
tenatively documented as using EINVAL in that case.  We can debate
leaving it this way, but it should be done after the pending release.
2015-07-27 23:45:49 -04:00
Joseph Myers 3df5cd9837 Mark bug 2981 (elf/tst-audit* fail on MIPS) as fixed.
Changes in support of -fno-plt also cause the elf/tst-audit* tests to
start passing on MIPS.  This patch duly marks the relevant bug as
fixed in ChangeLog and NEWS.
2015-07-27 23:59:08 +00:00
Andreas Schwab fddb87425a Fix spurious conform test failures 2015-07-27 16:13:55 +02:00
Chung-Lin Tang ae5eae7cfc Fixes extern protected data handling testcases elf/tst-protected1a
and elf/tst-protected1b for Nios II.
2015-07-26 05:27:18 -07:00
Chung-Lin Tang 34e3f83fe1 Add #include <string.h> to nptl/tst-join7mod.c to silence GCC warnings. 2015-07-26 00:54:27 -07:00
Chung-Lin Tang 1d4bbc54bd Update Nios II ulps file. 2015-07-25 07:14:29 -07:00
Chung-Lin Tang 3f96834346 Fix order of arguments to rt_sigprocmask syscall when setting the signal mask
in setcontext/swapcontext.
2015-07-24 23:19:50 -07:00
Roland McGrath 6b183b8339 NaCl: Remove bogus O_SHLOCK, O_EXLOCK definitions. 2015-07-24 12:31:23 -07:00
Siddhesh Poyarekar e400f3ccd3 Use IE model for static variables in libc.so, libpthread.so and rtld
The recently introduced TLS variables in the thread-local destructor
implementation (__cxa_thread_atexit_impl) used the default GD access
model, resulting in a call to __tls_get_addr.  This causes a deadlock
with recent changes to the way TLS is initialized because DTV
allocations are delayed and hence despite knowing the offset to the
variable inside its TLS block, the thread has to take the global rtld
lock to safely update the TLS offset.

This causes deadlocks when a thread is instantiated and joined inside
a destructor of a dlopen'd DSO.  The correct long term fix is to
somehow not take the lock, but that will need a lot deeper change set
to alter the way in which the big rtld lock is used.

Instead, this patch just eliminates the call to __tls_get_addr for the
thread-local variables inside libc.so, libpthread.so and rtld by
building all of their units with -mtls-model=initial-exec.

There were concerns that the static storage for TLS is limited and
hence we should not be using it.  Additionally, dynamically loaded
modules may result in libc.so looking for this static storage pretty
late in static binaries.  Both concerns are valid when using TLSDESC
since that is where one may attempt to allocate a TLS block from
static storage for even those variables that are not IE.  They're not
very strong arguments for the traditional TLS model though, since it
assumes that the static storage would be used sparingly and definitely
not by default.  Hence, for now this would only theoretically affect
ARM architectures.

The impact is hence limited to statically linked binaries that dlopen
modules that in turn load libc.so, all that on arm hardware.  It seems
like a small enough impact to justify fixing the larger problem that
currently affects everything everywhere.

This still does not solve the original problem completely.  That is,
it is still possible to deadlock on the big rtld lock with a small
tweak to the test case attached to this patch.  That problem is
however not a regression in 2.22 and hence could be tackled as a
separate project.  The test case is picked up as is from Alex's patch.

This change has been tested to verify that it does not cause any
issues on x86_64.

ChangeLog:

	[BZ #18457]
	* nptl/Makefile (tests): New test case tst-join7.
	(modules-names): New test case module tst-join7mod.
	* nptl/tst-join7.c: New file.
	* nptl/tst-join7mod.c: New file.
	* Makeconfig (tls-model): Pass -ftls-model=initial-exec for
	all translation units in libc.so, libpthread.so and rtld.
2015-07-24 19:13:38 +05:30