ARM: Define ELF_MACHINE_NO_REL

Fix a -Wundef warning on ARM.

ChangeLog:

2014-07-04  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/dl-machine.h (ELF_MACHINE_NO_REL): Define.
string/memchr.c: Merge from gnulib

Merge most of the gnulib implementation of memchr. The changes that
remain are:

 - copyright header
 - bp-sym.h removed
 - reg_char removed
 - allow MEMCHR to be redefined
 - non-conforming whitespace changes

The merged code fixes a number of -Wundef warnings and also introduces
an optimized algorithm. I haven't detected any performance difference
in the new code which I believe is down to the quite specific
circumstances required to hit it. However the new code is approximately
half the size of the old code on AArch64 (which uses generic memchr).

ChangeLog:

2014-07-04  Will Newton  <will.newton@linaro.org>

	* string/memchr.c: Merge from gnulib.
	[_LIBC]: Remove conditionals.
	(__ptr_t): Remove define.
	(LONG_MAX_32_BITS): Likewise.
	(LONG_MAX): Likewise.
	(MEMCHR): Use ANSI prototype and optimize algorithm.
Add comment for MEMCPY_OK_FOR_FWD_MEMMOVE
Get rid of nptl/sysdeps/ entirely!
NPTL is no longer an add-on!
Remove old stub lowlevellock.h file.  It is not even useful as documentation.
PowerPC: Guard CALL_ELF check for ppc64 only in link.h

This patch fixes powerpc32 undef compiler warnings for _CALL_ELF,
since it is defined only for powerpc64.
PowerPC: memmove default implementation cleanup

This patch removes the powerpc specific logic in memmove and instead
include default implementation with MEMCPY_OK_FOR_FWD_MEMMOVE defined.
This lead in a increase performance, since the constraints to use
memcpy in powerpc code are too restrictive and memcpy can be used for
any forward memmove.
PowerPC: optimized memmove for POWER7/PPC64

This patch adds an optimized memmove optimization for POWER7/powerpc64.
Basically the idea is to use the memcpy for POWER7 on non-overlapped
memory regions and a optimized backward memcpy for memory regions
that overlap (similar to the idea of string/memmove.c).

The backward memcpy algorithm used is similar the one use for memcpy for
POWER7, with adjustments done for alignment.  The difference is memory
is always aligned to 16 bytes before using VSX/altivec instructions.
PowerPC: optimized memmove for POWER7/PPC32

This patch adds a optimized memmove for power7 by using the optimized
power7 memcpy for forward copying.
PowerPC: Align power7 memcpy using VSX to quadword

This patch changes power7 memcpy to use VSX instructions only when
memory is aligned to quardword.  It is to avoid unaligned kernel traps
on non-cacheable memory (for instance, memory-mapped I/O).
Fix Wundef warning with SHOJI_IS_RIGHT

The macro is not defined anywhere, so it looks like we're convinced
that Shoji is wrong :)
PowerPC: Add ifunc tests for memmove

This patch add the missing ifunc tests definition for memmove ppc32
optimization patch (commit 07aedd7).
PowerPC: Fix compiler warnings

This patch fixes some compiler due trailing data in #undef directives
and due missing prototypes.
PowerPC: Cleanup powerpc memmove

Now that MEMCPY_OK_FOR_FWD_MEMMOVE should be define on memcopy.h there
is no need to specialized powerpc memmove implementation.  This patch
moves the define set to powerpc memcopy and cleanup its definition on
powerpc code.
Fix Wundef warning for ELF_MACHINE_NO_REL on i386
Check value at resplen2 if it is not NULL

There was a typo in the previous patch due to which resplen2 was
checked for non-zero instead of the value at resplen2.  Fix that and
improve the condition by checking resplen2 for non-NULL (instead of
answerp2) and also adding the check in a third place.
Fix Wundef warning for __cplusplus

All current uses of the __cplusplus macro only check if it is defined
or not.  Fix this #if to use $ifdef like the rest of the code.
Fix -Wmaybe-uninitialized warning in xdr.c

While we're at fixing build warnings, here's one unnecessary warning
that can be fixed fairly easily.  The SIZE variable is never actually
use uninitialized, but the compiler cannot make that out and thinks
(correctly) that there is a potential for accessing SIZE without
initializing it.  Make this safe by initializing SIZE to 0.

Tested on x86_64.
Fix -Wundef warnings for SHARED

The definition of SHARED is tested with #ifdef pretty much everywhere
apart from these few places. The tlsdesc.c code seems to be copy and
pasted to a few architectures and there is one instance in the hppa
startup code.

ChangeLog:

2014-07-09  Will Newton  <will.newton@linaro.org>

	* sysdeps/aarch64/tlsdesc.c (_dl_unmap): Test SHARED with #ifdef.
	* sysdeps/arm/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/i386/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/x86_64/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/hppa/start.S (_start): Likewise.