Fix strlen using Thumb-2 with -Os -marm

2016-04-18  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * libc/machine/arm/strlen-stub.c: Check capabilities of architecture
        to decide which Thumb implementation to use and fall back to C
        implementation for architecture not supporting Thumb mode.
        * libc/machine/arm/strlen.S: Likewise.
This commit is contained in:
Jeff Johnston 2016-05-11 17:18:48 -04:00
parent d1d1378d13
commit 5c02bcc086
2 changed files with 10 additions and 4 deletions

View File

@ -32,11 +32,14 @@
#include <limits.h>
#if defined __OPTIMIZE_SIZE__ || defined PREFER_SIZE_OVER_SPEED
#if defined __thumb__ && !defined __thumb2__
#if __ARM_ARCH_ISA_THUMB == 2
/* Implemented in strlen.S. */
#elif defined (__ARM_ARCH_ISA_THUMB)
/* Implemented in strlen.S. */
#else
/* Implemented in strlen.S. */
#include "../../string/strlen.c"
#endif

View File

@ -27,11 +27,14 @@
#include "acle-compat.h"
#if defined __OPTIMIZE_SIZE__ || defined PREFER_SIZE_OVER_SPEED
#if defined __thumb__ && !defined __thumb2__
#if __ARM_ARCH_ISA_THUMB == 2
#include "strlen-thumb2-Os.S"
#elif defined (__ARM_ARCH_ISA_THUMB)
#include "strlen-thumb1-Os.S"
#else
#include "strlen-thumb2-Os.S"
/* Implemented in strlen-stub.c. */
#endif