bionic/x86: Optimization for string routines

Optimized strcpy, strcat,
strncpy, strncat, strlcpy, strlcat,
memchr, memrchr, strchr, strrchr, index,
strnlen, strlen, wcslen, wmemcmp, wcscmp,
wcschr, wcsrchr, wcscpy, wcscat

Change-Id: I82b29132edf9a2e144e0bb3ee4ff5217df8d2a6d
Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Honor p_vaddr if set

(cherry picked from commit 88ff15c2c279d2bbe3569101b36cd2aa0931a0a9)

Change-Id: I4aabbe911d30aea8ace69e29bb6e980a4e89de90
Implement malloc_usable_size for debug impls.

- Implemented chk_memalign.
- Fixed a few bugs in leak_memalign.
- Implemented {leak,fill,check,qemu}_malloc_usable_size.
- Make malloc_usable_size update at run time.
- Add malloc_test.cpp as a small set of tests for the
  malloc debug routines.
- Fix the qemu routines since it's been broken since it moved to C++.
- Add support for the %u format to the out_vformat in libc_logging.cpp.
  This is used by the emulator code.

Tested using the bionic-unit-tests with setprop libc.debug.malloc
set to 1, 5, and 10.

I tested as much as possible on the emulator, but tracing doesn't appear
to be working properly.

Bug: 6143477

Merge change from internal master.

(cherry-picked from commit 3d594c258045783fc9e1956ce7a4d91e302f011e)

Change-Id: I4ae00fffba82315a8c283f35893fd554460722fb
Merge "Implement malloc_usable_size for debug impls."
Revert "libc x86: Remove strcat.S"

This reverts commit 4fe461b3a67148a2f557605e10a34deff9c8773a

Change-Id: Ibeb76e24f054abd7c96ad6899366c2f9bfc2a5ad
Merge "Revert "libc x86: Remove strcat.S""
Merge "bionic/x86: Optimization for string routines"
Merge "Honor p_vaddr if set"
Fix abort(3) to raise SIGABRT rather than causing SIGSEGV.

tgkill() needs the .save stack unwinding directive to get the complete
stack trace.

BUG: https://code.google.com/p/android/issues/detail?id=16672

Change-Id: Ifb447dca2147a592c48baf32769dfc175d8aea72
Merge "Fix abort(3) to raise SIGABRT rather than causing SIGSEGV."
fix unittests.

7e6ce1a3c52d8533fed92c143419fedb0c93988a fixed abort() to raise
SIGABRT rather than causing SIGSEGV. However, the unittests were
not updated.

Fix unittests.

Change-Id: I73db194127b9b9e9440358aa94273863765a736b
Merge "fix unittests."
<stdint.h> should expose SIZE_MAX.

Change-Id: Id27222c24955c83f29ad953933cbdc48b6f1e900
Merge "<stdint.h> should expose SIZE_MAX."
Clean up abort.

* A dlmalloc usage error shouldn't call abort(3) because we want to
  cause a SIGSEGV by writing the address dlmalloc didn't like to an
  address the kernel won't like, so that debuggerd will dump the
  memory around the address that upset dlmalloc.

* Switch to the simpler FreeBSD/NetBSD style of registering stdio
  cleanup. Hopefully this will let us simplify more of the stdio
  implementation.

* Clear the stdio cleanup handler before we abort because of a dlmalloc
  corruption error. This fixes the reported bug, where we'd hang inside
  dlmalloc because the stdio cleanup reentered dlmalloc.

Bug: 9301265
Change-Id: Ief31b389455d6876e5a68f0f5429567d37277dbc
Merge "Clean up abort."
Add SIZE_MAX to <stdint.h> in a way that might actually work.

Take two.

Change-Id: I7d08b6d14c82a171312a7f5898270b4441d5cfa2
Merge "Add SIZE_MAX to <stdint.h> in a way that might actually work."
Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."

This reverts commit d8627af159c6b1bc40296fb29297c61b30a5a8e2 which caused build breakage:

In file included from bionic/libc/include/limits.h:86:0,
                 from bionic/libc/include/stdint.h:33,
                 from bionic/libc/arch-arm/bionic/crtbegin.c:31:
bionic/libc/include/sys/limits.h:30:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [out/target/product/generic/obj/lib/crtbegin_dynamic1.o] Error 1

Change-Id: I128095ecb99df92626e1f57e34c61e08c98a4078
Merge "Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work.""