This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] ARM: Fix strcmp() for Thumb-1
- From: nick clifton <nickc at redhat dot com>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>, newlib at sourceware dot org
- Date: Tue, 28 May 2013 10:37:08 +0100
- Subject: Re: [PATCH] ARM: Fix strcmp() for Thumb-1
- References: <1369567629-11768-1-git-send-email-sebastian dot huber at embedded-brains dot de>
Hi Sebastian,
The GCC multilib for ARMv4T is broken with the current strcmp()
implementation. GCC will pass no architecture flag to AS in case it
builds a multilib for -mthumb with no further architecture options. The
default architecture is ARMv4T in GCC. The usage of ".syntax unified"
instructs AS to produce output for the ARMv6T2 architecture. Thus we
have (readelf -A):
>
File: ./arm-rtems4.11/thumb/newlib/libc/machine/arm/lib_a-strcmp.o
Attribute Section: aeabi
File Attributes
Tag_CPU_arch: v6T2
Tag_THUMB_ISA_use: Thumb-2
This appears to be correct. It seems however that there is a similar
problem for the memchr function as well:
% readelf -A arm-rtems4.11/thumb/newlib/libc/machine/arm/lib_a-memchr.o
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
newlib/ChangeLog
2013-05-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
libc/machine/arm/strcmp.S: Fix Thumb-1 version.
The patch works, although given the mail from Chenq I think that adding
a comment would be helpful. As in:
+/* Do not use unified syntax for thumb1 multilibs - it results
> + in the assembler marking the object as requiring a thumb2 ISA. */
+#if !(defined (__thumb__) && !defined (__thumb2__))
.syntax unified
+#endif
Cheers
Nick