diff options
author | Julian Brown <julian@codesourcery.com> | 2016-12-09 13:54:17 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-12-12 11:23:45 +0100 |
commit | bc4f996f56f98980dc8b58d7063f9ed8f2c48c9f (patch) | |
tree | ce4cb2584129a5cb1fcbfab6e4caafa588fe746e /newlib/libc | |
parent | 4007871174fb9c814103b6a9215f24a700409fa7 (diff) | |
download | cygnal-bc4f996f56f98980dc8b58d7063f9ed8f2c48c9f.tar.gz cygnal-bc4f996f56f98980dc8b58d7063f9ed8f2c48c9f.tar.bz2 cygnal-bc4f996f56f98980dc8b58d7063f9ed8f2c48c9f.zip |
Big-endian fix for memcpy-armv7m.S
In the case of memcpy-armv7m.S being built for a big-endian multilib
(including armv7 without a specific profile), realignment code made
assumptions about the byte ordering being little-endian.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/machine/arm/memcpy-armv7m.S | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/machine/arm/memcpy-armv7m.S b/newlib/libc/machine/arm/memcpy-armv7m.S index 8a70c7d73..c8bff36f6 100644 --- a/newlib/libc/machine/arm/memcpy-armv7m.S +++ b/newlib/libc/machine/arm/memcpy-armv7m.S @@ -265,9 +265,17 @@ memcpy: .macro mis_src_copy shift 1: +#ifdef __ARM_BIG_ENDIAN + lsls r4, r4, \shift +#else lsrs r4, r4, \shift +#endif ldr r3, [r1], #4 +#ifdef __ARM_BIG_ENDIAN + lsrs r5, r3, 32-\shift +#else lsls r5, r3, 32-\shift +#endif orr r4, r4, r5 str r4, [r0], #4 mov r4, r3 |