aboutsummaryrefslogtreecommitdiff
path: root/libgloss/arm
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/arm')
-rw-r--r--libgloss/arm/crt0.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index 33bcc3a..bea2892 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -251,6 +251,11 @@ __change_mode:
add r3, #4
b .LC15
.LC14:
+ /* Ensure doubleword stack alignment. */
+ mov r4, sp
+ mov r5, #7
+ bic r4, r5
+ mov sp, r4
#else
add r2, sp, r0, LSL #2 /* End of args */
mov r3, sp /* Start of args */
@@ -260,6 +265,8 @@ __change_mode:
strhi r5, [r2, #-4]!
strhi r4, [r3], #4
bhi .LC13
+ /* Ensure doubleword stack alignment. */
+ bic sp, sp, #7
#endif
#endif