[PATCH] ARM: Fix strcmp() for Thumb-1
Richard Earnshaw
rearnsha@arm.com
Tue May 28 09:37:00 GMT 2013
On 27/05/13 07:59, Sebastian Huber wrote:
> On 05/27/2013 04:18 AM, Bin.Cheng wrote:
> [...]
>> Though I have no right to approve the patch, I would like to have below comment.
>> UAL is generally preferred, thus you may handle armv6-m specially by
>> keeping UAL for it. For example,
>>
>> #if (defined(__thumb__) && defined(__ARM_ARCH_6M__))
>> //...
>> #endif
>
> Which problem does this additional pre-processor complexity solve? The
> generated machine code is the same.
>
I don't think either patch is correct. Instead we should explicitly
mark the attributes in this case, probably as follows, but I've only
smoke tested this.
Sebastian, does this fix your problem?
R.
-------------- next part --------------
Index: strcmp.S
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/arm/strcmp.S,v
retrieving revision 1.2
diff -p -r1.2 strcmp.S
*** strcmp.S 30 Nov 2012 09:31:38 -0000 1.2
--- strcmp.S 28 May 2013 09:35:37 -0000
***************
*** 55,60 ****
--- 55,67 ----
#if defined (__thumb__)
.thumb
.thumb_func
+ #if !defined (__thumb2__)
+ /* If we have thumb1 only, we need to explictly mark the
+ compatibility. */
+ .arch armv4t
+ .eabi_attribute Tag_also_compatible_with, "\006\013" /* v6-M. */
+ .eabi_attribute Tag_ARM_ISA_use, 0
+ #endif
#endif
.global strcmp
.type strcmp, %function
More information about the Newlib
mailing list