external/glibc.git
8 years agoAlso check dead->data[category] != NULL
H.J. Lu [Wed, 5 Aug 2015 15:15:51 +0000 (08:15 -0700)]
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.

8 years agoFix powf (close to -1, large) (bug 18647).
Joseph Myers [Wed, 5 Aug 2015 15:01:58 +0000 (15:01 +0000)]
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.

8 years agoarm: Assembly implementation cleanup
Adhemerval Zanella [Mon, 6 Jul 2015 13:00:29 +0000 (13:00 +0000)]
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.

8 years agolocaledata: remove timezone information [BZ #18525]
Marko Myllynen [Fri, 12 Jun 2015 14:05:25 +0000 (17:05 +0300)]
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.

8 years agoUpdated __nonnull annotations for wcscat, wcsncat, wcscmp and wcsncmp [BZ #18265]
Daniel Marjamäki [Fri, 22 May 2015 08:00:26 +0000 (08:00 +0000)]
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.

8 years agotest-skeleton: add usage information
Mike Frysinger [Tue, 4 Aug 2015 11:26:46 +0000 (07:26 -0400)]
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.

8 years agommap64: fix undef warnings
Mike Frysinger [Wed, 29 Jul 2015 15:35:37 +0000 (11:35 -0400)]
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.

8 years agonptl: fix set-but-unused warning w/_STACK_GROWS_UP
Mike Frysinger [Thu, 30 Jul 2015 02:53:28 +0000 (22:53 -0400)]
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.

8 years agoOpen development for 2.23.
Carlos O'Donell [Wed, 5 Aug 2015 07:01:50 +0000 (03:01 -0400)]
Open development for 2.23.

8 years agoUpdate version.h and include/features.h for 2.22 release
Carlos O'Donell [Wed, 5 Aug 2015 06:42:21 +0000 (02:42 -0400)]
Update version.h and include/features.h for 2.22 release

8 years agotilepro: fix warnings in sysdeps/tile/tilepro/bits/atomic.h
Chris Metcalf [Tue, 4 Aug 2015 16:02:10 +0000 (12:02 -0400)]
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.

8 years agoProperly terminate FDE in makecontext for ix86 (bug 18635)
Andreas Schwab [Tue, 4 Aug 2015 10:35:50 +0000 (12:35 +0200)]
Properly terminate FDE in makecontext for ix86 (bug 18635)

8 years agoUpdated translations for 2.22.
Carlos O'Donell [Sat, 1 Aug 2015 18:48:31 +0000 (14:48 -0400)]
Updated translations for 2.22.

8 years agoDeprecate the use of regexp.h
Zack Weinberg [Sat, 1 Aug 2015 18:38:05 +0000 (14:38 -0400)]
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.

8 years agoRegenerate libc.pot for 2.22 release.
Carlos O'Donell [Fri, 31 Jul 2015 04:13:33 +0000 (00:13 -0400)]
Regenerate libc.pot for 2.22 release.

8 years agoPrevent runtime fail of SSE vector math tests on non SSE4.1 machine.
Andrew Senkevich [Thu, 30 Jul 2015 15:00:24 +0000 (18:00 +0300)]
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.

8 years agohppa: add bz entry for pthreadtypes.h fix
Mike Frysinger [Thu, 30 Jul 2015 14:08:35 +0000 (10:08 -0400)]
hppa: add bz entry for pthreadtypes.h fix

8 years agohppa: fix pthreadtypes.h namespace failures
Mike Frysinger [Thu, 30 Jul 2015 09:02:15 +0000 (05:02 -0400)]
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.

8 years agohppa: Remove custom lowlevellock.h.
Torvald Riegel [Wed, 17 Dec 2014 22:52:06 +0000 (23:52 +0100)]
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.

8 years agohppa: sigaction.h: change sa_flags to an int
Mike Frysinger [Wed, 22 Jul 2015 02:49:22 +0000 (22:49 -0400)]
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.

8 years agohppa: fix sysdep.h header setup
Mike Frysinger [Thu, 30 Jul 2015 02:55:43 +0000 (22:55 -0400)]
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.

8 years agohppa: rewrite INLINE_SYSCALL
Mike Frysinger [Thu, 30 Jul 2015 03:01:01 +0000 (23:01 -0400)]
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.

8 years agoExtend local PLT reference check
H.J. Lu [Wed, 29 Jul 2015 18:57:54 +0000 (11:57 -0700)]
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.

8 years agoAdded runtime check for AVX vector math tests.
Andrew Senkevich [Wed, 29 Jul 2015 16:47:29 +0000 (19:47 +0300)]
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.

8 years agoia64: drop __tls_get_addr from expected ld.so plt usage
Mike Frysinger [Tue, 28 Jul 2015 09:28:57 +0000 (05:28 -0400)]
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.

8 years agoia64: atomic.h: fix atomic_exchange_and_add 64bit handling
Mike Frysinger [Tue, 28 Jul 2015 06:19:49 +0000 (02:19 -0400)]
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.

8 years agoia64: clean up old kernel headers cruft
Mike Frysinger [Tue, 28 Jul 2015 04:15:18 +0000 (00:15 -0400)]
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.

8 years agopwd.h: revert __nonnull markings on putpwent [BZ #18641]
Mike Frysinger [Tue, 28 Jul 2015 03:43:09 +0000 (23:43 -0400)]
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.

8 years agoMark bug 2981 (elf/tst-audit* fail on MIPS) as fixed.
Joseph Myers [Mon, 27 Jul 2015 23:59:08 +0000 (23:59 +0000)]
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.

8 years agoFix spurious conform test failures
Andreas Schwab [Mon, 27 Jul 2015 14:04:40 +0000 (16:04 +0200)]
Fix spurious conform test failures

8 years agoFixes extern protected data handling testcases elf/tst-protected1a
Chung-Lin Tang [Sun, 26 Jul 2015 12:27:18 +0000 (05:27 -0700)]
Fixes extern protected data handling testcases elf/tst-protected1a
and elf/tst-protected1b for Nios II.

8 years agoAdd #include <string.h> to nptl/tst-join7mod.c to silence GCC warnings.
Chung-Lin Tang [Sun, 26 Jul 2015 07:54:27 +0000 (00:54 -0700)]
Add #include <string.h> to nptl/tst-join7mod.c to silence GCC warnings.

9 years agoUpdate Nios II ulps file.
Chung-Lin Tang [Sat, 25 Jul 2015 14:14:29 +0000 (07:14 -0700)]
Update Nios II ulps file.

9 years agoFix order of arguments to rt_sigprocmask syscall when setting the signal mask
Chung-Lin Tang [Sat, 25 Jul 2015 06:19:50 +0000 (23:19 -0700)]
Fix order of arguments to rt_sigprocmask syscall when setting the signal mask
in setcontext/swapcontext.

9 years agoNaCl: Remove bogus O_SHLOCK, O_EXLOCK definitions.
Roland McGrath [Fri, 24 Jul 2015 19:31:23 +0000 (12:31 -0700)]
NaCl: Remove bogus O_SHLOCK, O_EXLOCK definitions.

9 years agoUse IE model for static variables in libc.so, libpthread.so and rtld
Siddhesh Poyarekar [Fri, 24 Jul 2015 13:43:38 +0000 (19:13 +0530)]
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.

9 years agoUpdate powerpc-fpu libm-test-ulps.
Adhemerval Zanella [Fri, 24 Jul 2015 13:21:56 +0000 (10:21 -0300)]
Update powerpc-fpu libm-test-ulps.

9 years agoFixed several libmvec bugs found during testing on KNL hardware.
Andrew Senkevich [Fri, 24 Jul 2015 11:47:23 +0000 (14:47 +0300)]
Fixed several libmvec bugs found during testing on KNL hardware.

AVX512 IFUNC implementations, implementations of wrappers to
AVX2 versions and KNL expf implementation fixed.

    * sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core.S: Fixed AVX512 IFUNC.
    * sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_d_log8_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core.S: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core.S: Likewise.
    * sysdeps/x86_64/fpu/svml_d_wrapper_impl.h: Fixed wrappers to AVX2.
    * sysdeps/x86_64/fpu/svml_s_wrapper_impl.h: Likewise.
    * sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S: Fixed KNL
    implementation.

9 years ago[ARM][BZ #17711] Fix extern protected data handling
Szabolcs Nagy [Fri, 24 Jul 2015 09:05:07 +0000 (10:05 +0100)]
[ARM][BZ #17711] Fix extern protected data handling

Fixes elf/tst-protected1a and elf/tst-protected1b tests.

Depends on a gcc patch that makes protected visibility data non-local:
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01871.html
and on a binutils patch so R_*_GLOB_DAT relocs are used for it:
https://sourceware.org/ml/binutils/2015-07/msg00247.html

9 years ago[AArch64][BZ #17711] Fix extern protected data handling
Szabolcs Nagy [Fri, 24 Jul 2015 08:57:32 +0000 (09:57 +0100)]
[AArch64][BZ #17711] Fix extern protected data handling

Fixes elf/tst-protected1a and elf/tst-protected1b tests.

Depends on a gcc patch that makes protected visibility data non-local:
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01871.html
and on a binutils patch so R_*_GLOB_DAT relocs are used for it:
https://sourceware.org/ml/binutils/2015-07/msg00246.html

9 years agoMention dl_load_lock by name in the comments
Siddhesh Poyarekar [Fri, 24 Jul 2015 00:39:47 +0000 (06:09 +0530)]
Mention dl_load_lock by name in the comments

Mention dl_load_lock by name instead of just 'load lock' in the
comments.  This makes it unambigious which lock we're talking about.

9 years agoMake sysdeps/posix bring in login subdir.
Roland McGrath [Fri, 24 Jul 2015 00:04:22 +0000 (17:04 -0700)]
Make sysdeps/posix bring in login subdir.

9 years agoAdd SIGWINCH to generic <bits/signum.h>.
Roland McGrath [Thu, 23 Jul 2015 23:44:47 +0000 (16:44 -0700)]
Add SIGWINCH to generic <bits/signum.h>.

9 years agoNaCl: Fix missing getdtablesize symbol.
Roland McGrath [Thu, 23 Jul 2015 22:54:21 +0000 (15:54 -0700)]
NaCl: Fix missing getdtablesize symbol.

9 years agoconform/linknamespace: whitelist matherrf/matherrl
Mike Frysinger [Thu, 23 Jul 2015 03:11:10 +0000 (23:11 -0400)]
conform/linknamespace: whitelist matherrf/matherrl

glibc supports the deprecated matherr hook for math error reporting.  The
conform tests take this into consideration and whitelist this symbol when
running linknamespace tests.

The ia64 libm code has long provided two additional hooks in this space:
matherrf (for floats)
matherrl (for long doubles)

Which causes the conform tests to fail with chains that all look like:
[initial] __atan2 ->
[libm.a(e_atan2.o)] __libm_error_support ->
[libm.a(libm_error.o)] matherrf

We can't (losslessly) redirect existing usage of these funcs to matherr
because the structure passed in is different -- matherr uses a struct with
doubles while matherrf/matherrl use floats and long doubles respectively.
Plus, this has been part of the exported ABI since glibc-2.2.3, so it
doesn't feel right to change it so late.

Until we get around to obsoleting matherr entirely, whitelist these two
additional ia64 symbols.

9 years agoia64: sigaction.h: fix sa_flags ordering
Mike Frysinger [Thu, 23 Jul 2015 07:27:04 +0000 (03:27 -0400)]
ia64: sigaction.h: fix sa_flags ordering

Since ia64 is little endian, sa_flags has to come before the padding
when splitting it from 64bits to 32bits.

Reported-by: Joseph Myers <joseph@codesourcery.com>
9 years agoAlso use l_tls_dtor_count to decide on object unload (BZ #18657)
Siddhesh Poyarekar [Thu, 23 Jul 2015 05:46:18 +0000 (11:16 +0530)]
Also use l_tls_dtor_count to decide on object unload (BZ #18657)

When an TLS destructor is registered, we set the DF_1_NODELETE flag to
signal that the object should not be destroyed.  We then clear the
DF_1_NODELETE flag when all destructors are called, which is wrong -
the flag could have been set by other means too.

This patch replaces this use of the flag by using l_tls_dtor_count
directly to determine whether it is safe to unload the object.  This
change has the added advantage of eliminating the lock taking when
calling the destructors, which could result in a deadlock.  The patch
also fixes the test case tst-tls-atexit - it was making an invalid
dlclose call, which would just return an error silently.

I have also added a detailed note on concurrency which also aims to
justify why I chose the semantics I chose for accesses to
l_tls_dtor_count.  Thanks to Torvald for his help in getting me
started on this and (literally) teaching my how to approach the
problem.

Change verified on x86_64; the test suite does not show any
regressions due to the patch.

ChangeLog:

[BZ #18657]
* elf/dl-close.c (_dl_close_worker): Don't unload DSO if there
are pending TLS destructor calls.
* include/link.h (struct link_map): Add concurrency note for
L_TLS_DTOR_COUNT.
* stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
Don't touch the link map flag.  Atomically increment
l_tls_dtor_count.
(__call_tls_dtors): Atomically decrement l_tls_dtor_count.
Avoid taking the load lock and don't touch the link map flag.
* stdlib/tst-tls-atexit-nodelete.c: New test case.
* stdlib/Makefile (tests): Use it.
* stdlib/tst-tls-atexit.c (do_test): dlopen
tst-tls-atexit-lib.so again before dlclose.  Add conditionals
to allow tst-tls-atexit-nodelete test case to use it.

9 years agoia64: msg.h: fix msg_qnum/msg_qbytes types
Mike Frysinger [Wed, 22 Jul 2015 02:44:48 +0000 (22:44 -0400)]
ia64: msg.h: fix msg_qnum/msg_qbytes types

These two fields have dedicated types, so change the ia64 header to match
all the other arches.  This fixes the conform test for msg.h.

9 years agoia64: stat.h: rename pad0 to __glibc_reserved0
Mike Frysinger [Wed, 22 Jul 2015 02:42:37 +0000 (22:42 -0400)]
ia64: stat.h: rename pad0 to __glibc_reserved0

This fixes the conform test for the stat.h header and makes it match
all the other arches.

9 years agoia64: sifaction.h: change sa_flags to an int
Mike Frysinger [Wed, 22 Jul 2015 02:40:25 +0000 (22:40 -0400)]
ia64: sifaction.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.

9 years agoia64: siginfo.h: delete siginfo name
Mike Frysinger [Wed, 22 Jul 2015 02:34:48 +0000 (22:34 -0400)]
ia64: siginfo.h: delete siginfo name

This fixes the conform test for the siginfo.h header and makes it match
all the other arches.

9 years agoNaCl: Use only nacl_irt_dev_filename, never nacl_irt_filename.
Roland McGrath [Tue, 21 Jul 2015 22:48:56 +0000 (15:48 -0700)]
NaCl: Use only nacl_irt_dev_filename, never nacl_irt_filename.

9 years agoAdd abilist files and NEWS item for arm-nacl port.
Roland McGrath [Tue, 21 Jul 2015 20:31:21 +0000 (13:31 -0700)]
Add abilist files and NEWS item for arm-nacl port.

9 years agotile: Fix BZ #18508 (makecontext yield infinite backtrace)
Chris Metcalf [Tue, 21 Jul 2015 16:04:52 +0000 (12:04 -0400)]
tile: Fix BZ #18508 (makecontext yield infinite backtrace)

It turns out tile suffered from the same problem as S390.  However,
disabling CFI information for the __startcontext on tile was not
sufficient to fix the problem; I think the backtracer will just
blindly try to follow the link register (lr) in that case.

Instead, the change adds a cfi_undefined directive for "lr"
and then arranges to call __startcontext directly when the new
context starts, rather than just synthesizing a return to it.
In addition to being a bit easier now to understand the control
flow, this also allows the cfi_undefined directive to be placed in
a way that causes it to be in force at the address that the "lr"
from the called function points to.

9 years agolocale: Remove obsolete repertoire map references
Marko Myllynen [Wed, 13 May 2015 08:41:43 +0000 (11:41 +0300)]
locale: Remove obsolete repertoire map references

repertoire maps and character mnemonics were used early in the glibc
i18n/l10n effort but were quickly deprecated in favor of Unicode code
points. According to ChangeLog, the in-tree repertoire maps were
removed 2000-07-07 but some stray references remain even today. The
patch below removes them.

9 years agolocale: Do not define lang_ab for tcy_IN and bhb_IN
Khem Raj [Tue, 21 Jul 2015 06:39:42 +0000 (23:39 -0700)]
locale: Do not define lang_ab for tcy_IN and bhb_IN

After renaming localedef now complains and build fails

LC_ADDRESS: field `lang_ab' must not be defined

earlier the names were similar to lang_ab definitions 'tu' or 'bh'
but after rename they are not.

9 years agoReflect renaming of bh_IN and tu_IN in SUPPORTED file [BZ #17475]
Khem Raj [Fri, 17 Jul 2015 09:16:59 +0000 (02:16 -0700)]
Reflect renaming of bh_IN and tu_IN in SUPPORTED file [BZ #17475]

9 years agosparc: fix sigaction for 32bit builds [BZ #18694]
Mike Frysinger [Mon, 20 Jul 2015 11:29:15 +0000 (07:29 -0400)]
sparc: fix sigaction for 32bit builds [BZ #18694]

Commit a059d359d86130b5fa74e04a978c8523a0293f77 changed the sigaction
struct to pass conform tests, but it ended up also changing the ABI for
32 bit builds.  For 64 bit builds, changing the long to two ints works,
but for 32 bit builds, it inserts 4 extra bytes.  This leads to many
packages randomly failing like bash that spews things like:
configure: line 471: wait_for: No record of process 0

Bracket the new member by a wordsize check to fix the ABI for 32bit.

9 years agoRemove Linuxism from tst-tls-atexit
Siddhesh Poyarekar [Tue, 21 Jul 2015 01:44:16 +0000 (07:14 +0530)]
Remove Linuxism from tst-tls-atexit

The tst-tls-atexit test case searches for its module in /proc/PID/maps
to verify that it is unloaded, which is a Linux-specific test.  This
patch makes the test generic by looking for the library in the link
map list in the _r_debug structure.

Verified that the test continues to succeed on x86_64.  There is a bug
in the test case where it calls dlclose once again, which is actually
incorrect but still manages to unload the DSO thanks to an existing
bug in __tls_call_dtors.  This will be fixed in a later patch which
also fixes up the __cxa_thread_atexit_impl implementation.  I have
added a FIXME comment to that call momentarily, which I will remove
when I fix the problem.

* stdlib/tst-tls-atexit-lib.c (do_foo): Rename to reg_dtor.
* stdlib/tst-tls-atexit.c: (is_loaded): New function.
(spawn_thread): New function.
(load): Rename to reg_dtor_and_close.  Move dlopen to...
(do_test): ... here.  Use IS_LOADED to test for its
availability.

9 years agom68k: update libm test ULPs
Andreas Schwab [Mon, 20 Jul 2015 22:16:24 +0000 (00:16 +0200)]
m68k: update libm test ULPs

9 years agotst-leaks: raise timeout to 5 seconds
Chris Metcalf [Mon, 20 Jul 2015 21:32:34 +0000 (17:32 -0400)]
tst-leaks: raise timeout to 5 seconds

This test takes about 2.3 seconds on my tilegx system, and so
times out.  Bump it up to 5 seconds instead.

9 years agoAdd si_addr_bnd to _sigfault in x86 struct siginfo
H.J. Lu [Mon, 20 Jul 2015 18:54:39 +0000 (11:54 -0700)]
Add si_addr_bnd to _sigfault in x86 struct siginfo

X86 struct siginfo in kernel 3.19 has been changed by

commit ee1b58d36aa1b5a79eaba11f5c3633c88231da83
Author: Qiaowei Ren <qiaowei.ren@intel.com>
Date:   Fri Nov 14 07:18:19 2014 -0800

    mpx: Extend siginfo structure to include bound violation information

    This patch adds new fields about bound violation into siginfo
    structure. si_lower and si_upper are respectively lower bound
    and upper bound when bound violation is caused.

This patch updates x86 struct siginfo to enable GDB with MPX support.

[BZ #18696]
* sysdeps/unix/sysv/linux/x86/bits/siginfo.h (_sigfault): Add
si_addr_bnd.
(si_lower): New.
(si_upper): Likewise.

9 years agoRegenerate SPARC ULPs.
David S. Miller [Thu, 16 Jul 2015 19:03:33 +0000 (12:03 -0700)]
Regenerate SPARC ULPs.

* sysdeps/sparc/fpu/libm-test-ulps: Regenerated.

9 years agolibio: Fix fmemopen 'w' mode with provided buffer
Adhemerval Zanella [Wed, 15 Jul 2015 19:15:47 +0000 (16:15 -0300)]
libio: Fix fmemopen 'w' mode with provided buffer

If 'w' mode is used with a provided buffer the fmemopen will try to find
the first null byte to set as maximum internal stream size.  It should be
done only for append mode ('a').

Kudos for Stefan Liebler for finding this error on s390-32.

* libio/fmemopen.c (__fmemopen): Fix 'w' openmode with provided
buffer.
* stdio-common/tst-fmemopen2.c (do_test_with_buffer): Fix typo and
fail output information.

9 years agopowerpc: strstr optimization
Rajalakshmi Srinivasaraghavan [Wed, 24 Jun 2015 06:08:21 +0000 (02:08 -0400)]
powerpc: strstr optimization

This patch optimizes strstr function for power >= 7 systems.  Performance
gain is obtained using aligned memory access and usage of cmpb
instruction for quicker comparison.  The average improvement of this
optimization is ~40%.  Tested on ppc64 and ppc64le.

2015-07-16  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>

* sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strstr().
* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise.
* sysdeps/powerpc/powerpc64/power7/strstr.S: New File.
* sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: New File.
* sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c: New File.
* sysdeps/powerpc/powerpc64/multiarch/strstr.c: New File.

9 years agohppa/ia64: _dl_unmap: make it hidden
Mike Frysinger [Wed, 15 Jul 2015 11:40:56 +0000 (07:40 -0400)]
hppa/ia64: _dl_unmap: make it hidden

This symbol is only used by DL_UNMAP which in turn is only used by
_dl_close_worker in dl-close.c, and _dl_close_worker itself is marked
hidden as it is only used by the ldso.  That means _dl_unmap should
be marked hidden.  Without this, the elf/check-localplt test fails.

9 years agohppa/ia64: _dl_symbol_address: add PLT bypass for rtld
Mike Frysinger [Wed, 15 Jul 2015 11:37:47 +0000 (07:37 -0400)]
hppa/ia64: _dl_symbol_address: add PLT bypass for rtld

This symbol is defined in the ldso, and is used both there and libc.so.
There is no hidden symbol for it though which leads to relocations in
the ldso and the elf/check-localplt test failing.  Add a hidden def for
rtld to fix all of that.

This function/file is only used by hppa & ia64, so no testing is needed
for other arches.

9 years agoAdd comment to clarify how the test can fail
Siddhesh Poyarekar [Thu, 16 Jul 2015 05:08:29 +0000 (10:38 +0530)]
Add comment to clarify how the test can fail

9 years agoWhitespace fixup in cxa_thread_atexit_impl.c
Siddhesh Poyarekar [Thu, 16 Jul 2015 03:24:39 +0000 (08:54 +0530)]
Whitespace fixup in cxa_thread_atexit_impl.c

9 years agoSet NODELETE flag when opening already open objects with RTLD_NODELETE
Siddhesh Poyarekar [Thu, 16 Jul 2015 03:23:28 +0000 (08:53 +0530)]
Set NODELETE flag when opening already open objects with RTLD_NODELETE

The DF_1_NODELETE flag is set too late when opening a DSO, due to
which, if a DSO is already open, subsequently opening it with
RTLD_NODELETE fails to set the DF_1_NODELETE flag.  This patch fixes
this by setting the flag immediately after bumping the opencount.

Verified on x86_64.

[BZ #18676]
* elf/tst-nodelete-opened.c: New test case.
* elf/tst-nodelete-opened-lib.c: New test case module.
* elf/Makefile (tests, modules-names): Use them.
* elf/dl-open.c (dl_open_worker): Set DF_1_NODELETE flag
early.

9 years agoFix sparc build.
David S. Miller [Wed, 15 Jul 2015 22:22:48 +0000 (15:22 -0700)]
Fix sparc build.

* sysdeps/sparc/nptl/pthread_barrier_init.c: Include
futex-intenal.h
* sysdeps/sparc/sparc32/sparcv9/Makefile (nscd): Add cpu_relax.
* sysdeps/sparc/sparc64/Makefile: Likewise.
* sysdeps/sparc/sparc32/sparcv9/bits/atomic.h (atomic_spin_nop):
Remove space from macro define.
* sysdeps/sparc/sparc64/bits/atomic.h (atomic_spin_nop): Likewise.

9 years agoSort NEWS
H.J. Lu [Wed, 15 Jul 2015 12:38:01 +0000 (05:38 -0700)]
Sort NEWS

9 years agoCorrecting language code for Bhili and Tulu locales (bug 17475)
Pravin Satpute [Wed, 15 Jul 2015 10:36:17 +0000 (16:06 +0530)]
Correcting language code for Bhili and Tulu locales (bug 17475)

Bhili [1] and Tulu [2] language does not have iso-639-1 codes. Patch
moves locale file with correct code and also fix iso-639.def.

1. http://www-01.sil.org/iso639-3/documentation.asp?id=bhb
2. http://www-01.sil.org/iso639-3/documentation.asp?id=tcy

localedata/ChangeLog:

2015-07-02  Pravin Satpute  <psatpute@redhat.com>

[BZ #17475]
        * locales/tu_IN: renamed to tcy_IN
* locales/bh_IN: renamed to bhb_IN

Changelog:

2015-03-05  Pravin Satpute  <psatpute@redhat.com>

[BZ #17475]
* locale/iso-639.def: Update Bhili and Tulu language codes as
per iso639-3.

9 years agoModify several tests to use test-skeleton.c
Arjun Shankar [Thu, 9 Jul 2015 15:29:17 +0000 (15:29 +0000)]
Modify several tests to use test-skeleton.c

These tests were skipped by the use-test-skeleton conversion done in
commit 29955b5d because they were reused in other tests via the #include
directive, and so deemed worth an inspection before they were modified.
This has now been done.

ChangeLog:

2015-07-09  Arjun Shankar  <arjun.is@lostca.se>

* elf/tst-leaks1.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* localedata/tst-langinfo.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* math/test-fpucw.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* math/test-tgmath.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* math/test-tgmath2.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* setjmp/tst-setjmp.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* stdio-common/tst-sscanf.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.
* sysdeps/x86_64/tst-audit6.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.

9 years agoModify elf/tst-audit9.c to use test-skeleton.c
Arjun Shankar [Thu, 9 Jul 2015 14:51:30 +0000 (14:51 +0000)]
Modify elf/tst-audit9.c to use test-skeleton.c

This test was skipped by the use-test-skeleton conversion script
[29955b5d] because the definition of `main' did not begin according to
the GNU formatting style that the script assumed.

ChangeLog:

2015-07-09  Arjun Shankar  <arjun.is@lostca.se>

* elf/tst-audit9.c (main): Converted to ...
(do_test): ... this.
(TEST_FUNCTION): New macro.
Include test-skeleton.c.

9 years agotst-tzset: raise timeout to 5 seconds
Mike Frysinger [Wed, 15 Jul 2015 07:46:03 +0000 (03:46 -0400)]
tst-tzset: raise timeout to 5 seconds

This test is reliably taking 2.3 seconds on my system, and the default
is 2 seconds, so it always times out.  Bump it up to 5 seconds instead.

9 years agoi686: Mark stdlib/tst-makecontext as XFAIL.
Stefan Liebler [Wed, 15 Jul 2015 07:33:15 +0000 (09:33 +0200)]
i686: Mark stdlib/tst-makecontext as XFAIL.

The testcase stdlib/tst-makecontext fails on i686 because
_Unwind_Backtrace from libgcc produces a segmentation fault if it was
called within a context created by makecontext. See Bug 18635.

ChangeLog:

* sysdeps/i386/i686/Makefile (test-xfail-tst-makecontext):
New variable.

9 years agoS390: Regenerate ULPs
Stefan Liebler [Wed, 15 Jul 2015 07:33:14 +0000 (09:33 +0200)]
S390: Regenerate ULPs

I've regenerated the ulps for s390 from scratch.

ChangeLog:

* sysdeps/s390/fpu/libm-test-ulps: Regenerated.

9 years agoFactor file identity rules out of generic rtld code.
Roland McGrath [Tue, 14 Jul 2015 20:15:26 +0000 (13:15 -0700)]
Factor file identity rules out of generic rtld code.

9 years agoFix up typo in tst-tls-atexit
Siddhesh Poyarekar [Tue, 14 Jul 2015 14:57:09 +0000 (20:27 +0530)]
Fix up typo in tst-tls-atexit

9 years agoAvoid C++ tests when the C++ cannot be linked
Adhemerval Zanella [Tue, 14 Jul 2015 13:50:05 +0000 (10:50 -0300)]
Avoid C++ tests when the C++ cannot be linked

* elf/Makefile [ifeq (yes,$(build-shared)) (tests)] (tst-nodelete):
Add iff $CXX is set.
[ifeq (yes,$(build-shared)) (modules-names)] (tst-nodelete-rtldmod):
Likewise.
(tst-nodelete-zmodiff): Likewise.
* nptl/Makefile [[ifeq (,$(CXX))] (tests-unsupported)]: Add tst-once5.

9 years agoFix up ChangeLog
Siddhesh Poyarekar [Tue, 14 Jul 2015 14:15:16 +0000 (19:45 +0530)]
Fix up ChangeLog

9 years agoWhitespace fix in tst-tls-atexit.c
Siddhesh Poyarekar [Tue, 14 Jul 2015 14:14:55 +0000 (19:44 +0530)]
Whitespace fix in tst-tls-atexit.c

9 years agoAdd AArch64 versions of math_opt_barrier and math_force_eval that avoid going via...
Wilco Dijkstra [Mon, 13 Jul 2015 11:48:33 +0000 (12:48 +0100)]
Add AArch64 versions of math_opt_barrier and math_force_eval that avoid going via memory.

9 years agoOptimize the strlen implementation by using a page cross check and a fast check
Wilco Dijkstra [Mon, 13 Jul 2015 11:38:12 +0000 (12:38 +0100)]
Optimize the strlen implementation by using a page cross check and a fast check
for nul bytes which reverts to separate loop when a non-ASCII char is encountered.
Speedup on test-strlen is ~10%, long ASCII strings are processed ~60% faster,
and on random tests it is ~80% better.

9 years agoReplace %ld with %jd and cast to intmax_t
H.J. Lu [Sat, 11 Jul 2015 20:41:47 +0000 (13:41 -0700)]
Replace %ld with %jd and cast to intmax_t

On x32, GCC 5.1 complains:

tst-fmemopen2.c: In function ‘do_test_without_buffer’:
tst-fmemopen2.c:124:15: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘off_t {aka long long int}’ [-Werror=format=]
       printf ("FAIL: first ftello returned %ld, expected %zu\n", o, nstr);
               ^
tst-fmemopen2.c:135:15: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘off_t {aka long long int}’ [-Werror=format=]
       printf ("FAIL: second ftello returned %ld, expected %zu\n", o, nbuf);
               ^
tst-fmemopen2.c:148:15: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘off_t {aka long long int}’ [-Werror=format=]
       printf ("FAIL: third ftello returned %ld, expected %zu\n", o, nstr2);
               ^
tst-fmemopen2.c: In function ‘do_test_length_zero’:
tst-fmemopen2.c:183:15: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘off_t {aka long long int}’ [-Werror=format=]
       printf ("FAIL: first ftello returned %ld, expected 0\n", o);
               ^

This patch silences GCC.

* stdio-common/tst-fmemopen2.c (do_test_without_buffer): Replace
%ld with %jd and cast to intmax_t.
(do_test_length_zero): Likewise.

9 years agoNaCl: Make pthread_condattr_setclock reject CLOCK_MONOTONIC.
Roland McGrath [Fri, 10 Jul 2015 21:18:14 +0000 (14:18 -0700)]
NaCl: Make pthread_condattr_setclock reject CLOCK_MONOTONIC.

9 years agotile: Regenerate ULPs.
Chris Metcalf [Fri, 10 Jul 2015 20:16:37 +0000 (16:16 -0400)]
tile: Regenerate ULPs.

Regenerated from scratch on tilegx.

9 years agomath/test-fenvinline: avoid compiler warning
Chris Metcalf [Fri, 10 Jul 2015 20:11:40 +0000 (16:11 -0400)]
math/test-fenvinline: avoid compiler warning

On tile (and any other machine with no FP exceptions) the
feenable_test() function will generate a "function defined but
not used" warning because all of the callers are commented out.
We already were ifdef'ing out the body of the function, so instead
just ifdef out the entire function if FE_ALL_EXCEPT == 0.

9 years agoRemove unnecessary mutex locks from tst-tls-atexit test case
Siddhesh Poyarekar [Fri, 10 Jul 2015 17:53:57 +0000 (23:23 +0530)]
Remove unnecessary mutex locks from tst-tls-atexit test case

The locks don't synchronize with anything - they were likely
introduced initially to synchronize with some main thread code, but
that is no longer evident.

9 years agoAvoid boolean coercion in tst-tls-atexit test case
Siddhesh Poyarekar [Fri, 10 Jul 2015 17:50:28 +0000 (23:20 +0530)]
Avoid boolean coercion in tst-tls-atexit test case

9 years agoClean up semaphore EINTR handling after Linux futex docs clarification.
Torvald Riegel [Mon, 8 Jun 2015 21:14:20 +0000 (23:14 +0200)]
Clean up semaphore EINTR handling after Linux futex docs clarification.

The Linux kernel futex documentation now states that since Linux 2.6.22,
FUTEX_WAIT does return EINTR only when interrupted by a signal, and not
spuriously anymore.  We only support more recent kernels, so clean up
EINTR handling in the semaphore and update the comments.

9 years agoAdd and use new glibc-internal futex API.
Torvald Riegel [Thu, 4 Dec 2014 13:12:23 +0000 (14:12 +0100)]
Add and use new glibc-internal futex API.

This adds new functions for futex operations, starting with wait,
abstimed_wait, reltimed_wait, wake.  They add documentation and error
checking according to the current draft of the Linux kernel futex manpage.

Waiting with absolute or relative timeouts is split into separate functions.
This allows for removing a few cases of code duplication in pthreads code,
which uses absolute timeouts; also, it allows us to put platform-specific
code to go from an absolute to a relative timeout into the platform-specific
futex abstractions..

Futex operations that can be canceled are also split out into separate
functions suffixed by "_cancelable".

There are separate versions for both Linux and NaCl; while they currently
differ only slightly, my expectation is that the separate versions of
lowlevellock-futex.h will eventually be merged into futex-internal.h
when we get to move the lll_ functions over to the new futex API.

9 years agoThe patch committed to fix bug #18435 caused regressions on aarch64
Martin Sebor [Thu, 9 Jul 2015 23:25:38 +0000 (19:25 -0400)]
The patch committed to fix bug #18435 caused regressions on aarch64
and also powerpc64 and powerpc64le. See the discussion in the thread
below for details. This change reverts the problematic bits leaving
the added test in place and marking XFAIL in anticipation of fixing
the bug in the near future.
https://sourceware.org/ml/libc-alpha/2015-07/msg00141.html

[BZ #18435]
* nptl/pthreadP.h (pthread_cleanup_push, pthread_cleanup_pop):
Revert commit ed225df3ad9cbac3c22ec3f0fbbed1f9c61d1c54.
* nptl/Makefile (test-xfail-tst-once5): Define.

9 years agoProvide __libc_fatal for rtld.
Roland McGrath [Thu, 9 Jul 2015 22:32:32 +0000 (15:32 -0700)]
Provide __libc_fatal for rtld.

9 years agoPLT avoidance for _exit in rtld.
Roland McGrath [Thu, 9 Jul 2015 22:25:47 +0000 (15:25 -0700)]
PLT avoidance for _exit in rtld.

9 years agoImprove bndmov encoding with zero displacement
H.J. Lu [Thu, 9 Jul 2015 16:30:09 +0000 (09:30 -0700)]
Improve bndmov encoding with zero displacement

If x86-64 assembler doesn't support MPX, we encode bndmov instruction by
hand.  When displacement is zero, assembler generates shorter encoding.
This patch improves bndmov encoding with zero displacement so that ld.so
is identical when using assemblers with and without MPX support.

* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Improve
bndmov encoding with zero displacement.

9 years agoPreserve bound registers for pointer pass/return
Igor Zamyatin [Thu, 9 Jul 2015 13:50:12 +0000 (06:50 -0700)]
Preserve bound registers for pointer pass/return

We need to save/restore bound registers and add a BND prefix before
branches in _dl_runtime_profile so that bound registers for pointer
pass and return are preserved when LD_AUDIT is used.

[BZ #18134]
* sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
* sysdeps/i386/configure: Regenerated.
* sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
(_dl_runtime_profile): Save and restore Intel MPX return bound
registers when calling _dl_call_pltexit.  Add
PRESERVE_BND_REGS_PREFIX before return.
* sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
(LRV_BND1_OFFSET): Likewise.
* sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
lrv_bnd1.
* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
typo in bndmov encoding.
* sysdeps/x86_64/dl-trampoline.h: Properly save and restore
Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
branch instructions to preserve bounds.

9 years agolibio: Update powerpc64le libc.abilist
Adhemerval Zanella [Thu, 9 Jul 2015 13:27:02 +0000 (13:27 +0000)]
libio: Update powerpc64le libc.abilist

This patch adds the missing fmemopen entry for powerpc64le libc abilist
check file.

* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist

9 years agohurd: permit to use mlock from non-root process
Samuel Thibault [Thu, 9 Jul 2015 11:56:30 +0000 (13:56 +0200)]
hurd: permit to use mlock from non-root process

* sysdeps/mach/hurd/mlock.c (mlock): When __get_privileged_ports
returns an error, also try to use host port from __mach_host_self for
the __vm_wire call.
* sysdeps/mach/hurd/munlock.c (munlock): Likewise.