Fix dns searchdomain use in gethostbyname.

Need to load search domain data before we attempt to use it.
This is a cherry pick of an AOSP change c11f6f0f393e472984b5ac2934e2485855a319c9.

bug:6799630

Change-Id: I4ea1131f06ffdf4037fe67f82af5a0349469b609
Clean up some ARMv4/ARMv5 cruft.

Change-Id: I29e836fea4b53901e29f96c6888869c35f6726be
Clean up the pthread-only atomic stuff a little.

It looks like we can probably just use the generic GCC stuff instead;
the generated code looks pretty similar. We should come back to that.

These routines are only used by the pthread implementation, and
__bionic_atomic_inc isn't used, so we can remove it.

Change-Id: I8b5b8cb30a1b159f0e85c3675aee06ddef39b429
ARM: Change dmb domain for bionic_atomic_barrier()

This patch changes the domain that the memory barrier operates on. Assumes
that the scope of bionic_atomic_barrier() does not include device memory,
memory shared with the GPU or any other memory external to the processor
cluster.

Change-Id: I291e741c98a64c86f3a3cf99811bbf1e714ac9aa
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Remove harmful attempts to be helpful in pthread_mutex functions.

Most callers won't check for EINVAL, so it's best to fail early.
GCC takes the nonnull attribute as a guarantee that an argument
won't be NULL, so these hacks were already ineffective, which is
how we found that at least one commercial game was using NULL
as if it's a mutex, but actually getting no-op behavior.

Bug: 11971278
Change-Id: I89646e043d931778805a8b692e07a34d076ee6bf
Revert "Remove harmful attempts to be helpful in pthread_mutex functions."

This reverts commit 53f15d0325feeaf7e58dc79fce4ddf55e0a64b7a.
libc: krait: support KINGFISHER optimized memcpy

When defined use the KINGFISHER optimized
cortex-a9 memcpy instead to improve performance.

Change-Id: Idcfb94cc1e10d8326d7a9e623baed91125d7caf6
Upgrade to tzdata2013i.

From the release notes:

  Changes affecting near-future time stamps:

    Jordan switches back to standard time at 00:00 on December 20, 2013.
    The 2006-2011 transition schedule is planned to resume in 2014.
    (Thanks to Steffen Thorsen.)

  Changes affecting past time stamps:

    In 2004, Cuba began DST on March 28, not April 4.
    (Thanks to Steffen Thorsen.)

Bug: 13193205
Change-Id: I8f26cc50f6b571804a18ff2113b4a47a22bc56dd
Import memchr implementation from cortex-strings for Cortex A15

Benchmarks on a Nexus 10 have shown the cortex-strings implementation
of memchr to be 60%-70% faster (depending on input)

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

Change-Id: I72b119905234570e54068375e5c3593d0647c67c
Replace Cortex A15 strlen implementation with cortex-strings

Benchmarks on a Nexus 10 have shown this implementation to be 5%-20%
faster (depending on input)

Change-Id: I4331a390c404a77b1e13909d713c4258a3776bca
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
libc: Fix memchr inclusion

Change-Id: I6f374f16b08e19851a375a4abad3e8235f8da59c
libc: Fix memchr inclusion on scorpion

Change-Id: I0f4d31c85c8671be9790feab03469f89520763b7
Merge "Fix dns searchdomain use in gethostbyname." into klp-dev
Upgrade to tzdata2014a.

From the release notes:

  Changes affecting near-future time stamps

    Turkey begins DST on 2014-03-31, not 03-30.  (Thanks to Faruk Pasin
    for the heads-up, and to Tim Parenti for simplifying the update.)

  Changes affecting past time stamps

    Fiji ended DST on 2014-01-19 at 02:00, not the previously-scheduled
    03:00.  (Thanks to Steffen Thorsen.)

    Ukraine switched from Moscow to Eastern European time on 1990-07-01
    (not 1992-01-01), and observed DST during the entire next winter.
    (Thanks to Vladimir in Moscow via Alois Treindl.)

    In 1988 Israel observed DST from 04-10 to 09-04, not 04-09 to
    09-03.  (Thanks to Avigdor Finkelstein.)

(cherry picked from commit 159b28eb46f03cb1dae6484059e2559f1e42e208)

Bug: 13193205
Change-Id: I3d302039f7e057a97c9d307ce8d32efa056481ed
libc: krait: Fix memmove half-word atomicity

In tailing case of less than 7, if even number of bytes are left, then
use half word load/store to make sure the whole routine is half-word
atomic

Change-Id: I54948ac050ff866986a7e144d4240652981ea87a
Allow overlap in resolv uid => DNS iface mapping

When multiple rules exist covering a given uid the one added most
recently will be used.

This allows us to handle the simultaneous tuns case where a new tun is
coming online for an already running VPN.

_resolv_clear_iface_for_uid_range now also takes the iface and removes
only that matching (iface, uid range) entry.

Bug: 12134439
Change-Id: I9b9cfcfae2f38c409022a8c76ccadad7e2babd78
Fix pthread_detach for already-exited threads.

This fix handles the case when pthread_detach is
called for threads which have already exited.
This is required to avoid any memory leak

Change-Id: I2bf7f41234d93b226132a4c51705f4186f4961c3
Reported-by: Paresh Nakhe <pnakhe@codeaurora.org>
Merge tag 'android-4.4.3_r1' into HEAD

Android 4.4.3 release 1
bionic: update memmove for 32 bits atomic

When src/dst are 32bits aligned, the updated memmove will guarantee
32bits atomic.

Change-Id: I21cb77451270d061b32e3e2d2fda22e7e373b7ff
Fix build for x86. Remove duplicate mcmchr from Android.mk. Other implemented in arch-x86/x86.mk

Change-Id: I90a562960b214dd02b015d3e2715f711907ae9e8