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>
This commit is contained in:
Julian Brown 2016-12-09 13:54:17 +00:00 committed by Corinna Vinschen
parent 4007871174
commit bc4f996f56
1 changed files with 8 additions and 0 deletions

View File

@ -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