59a13c122e
This change creates assembler versions of __memcpy_chk/__memset_chk that is implemented in the memcpy/memset assembler code. This change avoids an extra call to memcpy/memset, instead allowing a simple fall through to occur from the chk code into the body of the real implementation. Testing: - Ran the libc_test on __memcpy_chk/__memset_chk on all nexus devices. - Wrote a small test executable that has three calls to __memcpy_chk and three calls to __memset_chk. First call dest_len is length + 1. Second call dest_len is length. Third call dest_len is length - 1. Verified that the first two calls pass, and the third fails. Examined the logcat output on all nexus devices to verify that the fortify error message was sent properly. - I benchmarked the new __memcpy_chk and __memset_chk on all systems. For __memcpy_chk and large copies, the savings is relatively small (about 1%). For small copies, the savings is large on cortex-a15/krait devices (between 5% to 30%). For cortex-a9 and small copies, the speed up is present, but relatively small (about 3% to 5%). For __memset_chk and large copies, the savings is also small (about 1%). However, all processors show larger speed-ups on small copies (about 30% to 100%). Bug: 9293744 Merge from internal master. (cherry-picked from 7c860db0747f6276a6e43984d43f8fa5181ea936) Change-Id: I916ad305e4001269460ca6ebd38aaa0be8ac7f52
43 lines
1.5 KiB
Makefile
43 lines
1.5 KiB
Makefile
_LIBC_ARCH_COMMON_SRC_FILES := \
|
|
arch-arm/bionic/abort_arm.S \
|
|
arch-arm/bionic/atomics_arm.c \
|
|
arch-arm/bionic/clone.S \
|
|
arch-arm/bionic/eabi.c \
|
|
arch-arm/bionic/_exit_with_stack_teardown.S \
|
|
arch-arm/bionic/ffs.S \
|
|
arch-arm/bionic/futex_arm.S \
|
|
arch-arm/bionic/__get_sp.S \
|
|
arch-arm/bionic/kill.S \
|
|
arch-arm/bionic/libgcc_compat.c \
|
|
arch-arm/bionic/memcmp16.S \
|
|
arch-arm/bionic/memcmp.S \
|
|
arch-arm/bionic/_setjmp.S \
|
|
arch-arm/bionic/setjmp.S \
|
|
arch-arm/bionic/sigsetjmp.S \
|
|
arch-arm/bionic/syscall.S \
|
|
arch-arm/bionic/tgkill.S \
|
|
arch-arm/bionic/tkill.S \
|
|
|
|
# These are used by the static and dynamic versions of the libc
|
|
# respectively.
|
|
_LIBC_ARCH_STATIC_SRC_FILES := \
|
|
arch-arm/bionic/exidx_static.c
|
|
|
|
_LIBC_ARCH_DYNAMIC_SRC_FILES := \
|
|
arch-arm/bionic/exidx_dynamic.c
|
|
|
|
# Remove the C++ fortify function implementations for which there is an
|
|
# arm assembler version.
|
|
_LIBC_FORTIFY_FILES_TO_REMOVE := \
|
|
bionic/__memcpy_chk.cpp \
|
|
bionic/__memset_chk.cpp \
|
|
|
|
libc_common_src_files := \
|
|
$(filter-out $(_LIBC_FORTIFY_FILES_TO_REMOVE),$(libc_common_src_files))
|
|
|
|
ifeq ($(strip $(wildcard bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk)),)
|
|
$(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
|
|
endif
|
|
|
|
include bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk
|