grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable

The unaligned local in __aeabi_uidivmod leads to a store to a 64bit
value at an address that is not divisible by 8 (in grub_divmod64).
The compiler most likely generates a STRD instruction to store it and
this causes an exception.

Fixes Savannah bug #43632.

This includes improvements done by Leif Lindholm.
This commit is contained in:
David Kozub 2014-11-20 21:53:14 +01:00 committed by Andrei Borzenkov
parent 58f66137a3
commit 17328db3b3
2 changed files with 13 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2014-12-07 David Kozub <zub.272@gmail.com>
* grub-core/kern/arm/misc.S: fix unaligned 64bit local variable
in __aeabi_uidivmod
Fixes Savannah bug #43632.
2014-12-07 Peter Nelson <peterdn> 2014-12-07 Peter Nelson <peterdn>
* grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse * grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse

View file

@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul)
.macro division parent .macro division parent
stmfd sp!, {lr} sub sp, sp, #8 @ Allocate naturally aligned 64-bit space
sub sp, sp, #12 stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment
add r3, sp, #8 @ Set r3 to address of 64-bit space
str r3, [sp] @ Stack parameter, pointer to 64-bit space
mov r2, r1 mov r2, r1
add r1, sp, #4
str r1, [sp, #0]
mov r1, #0 mov r1, #0
mov r3, #0 mov r3, #0
bl \parent bl \parent
ldr r1, [sp, #4] ldr r1, [sp, #8] @ Extract remainder
add sp, sp, #12 ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register
ldmfd sp!, {lr} add sp, sp, #8
bx lr bx lr
.endm .endm