summaryrefslogtreecommitdiffstats
path: root/newlib/libc/machine/arm/strcmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/machine/arm/strcmp.S')
-rw-r--r--newlib/libc/machine/arm/strcmp.S23
1 files changed, 21 insertions, 2 deletions
diff --git a/newlib/libc/machine/arm/strcmp.S b/newlib/libc/machine/arm/strcmp.S
index 1742322ee..fecfdfd52 100644
--- a/newlib/libc/machine/arm/strcmp.S
+++ b/newlib/libc/machine/arm/strcmp.S
@@ -64,8 +64,27 @@
|| (__ARM_ARCH == 6 && __ARM_ARCH_PROFILE == 'M')
# if defined (__thumb__) && !defined (__thumb2__)
-/* Thumb1 only variant. */
-# include "strcmp-armv4t.S"
+/* Thumb1 only variant. If size is preferred, use strcmp-armv4t.S.
+ If speed is preferred, the strcmp function in ../../string/strcmp.c
+ will be used. */
+
+# if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)
+# include "strcmp-armv4t.S"
+# else
+ /* Leave this field blank. So the strcmp() is not defined, and this will
+ automatically pull in the default C definition of strcmp() from
+ ../../string/strcmp.c. No need to include this file explicitely.
+ The lib_a-strcmp.o will not be generated, so it won't replace the
+ default lib_a-strcmp.o which is generated by ../../string/strcmp.c.
+ See the commands in configure.in and Makefile.am for more details.
+
+ However, if we need to rewrite this function to be more efficient,
+ we can add the corresponding assembly code into this field and
+ change the commands in configure.in and Makefile.am to allow the
+ corresponding lib_a-strcmp.o to be generated.
+ */
+# endif
+
# else
# include "strcmp-arm-tiny.S"
# endif