[PATCH] ARM: Fix strcmp() for Thumb-1
nick clifton
nickc@redhat.com
Tue May 28 09:37:00 GMT 2013
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
More information about the Newlib
mailing list