]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/powerpc/ieee1275/startup.S: Handle unaligned bss.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 16 Jul 2013 05:41:53 +0000 (07:41 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 16 Jul 2013 05:41:53 +0000 (07:41 +0200)
Reported by: Paulo Flabiano Smorigo.

ChangeLog
grub-core/kern/powerpc/ieee1275/startup.S

index e9b8232bb01ce856545430af091db2a0d6e4a147..57af49bb27c7249d8abec838aee11bc07b4033e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-16  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/powerpc/ieee1275/startup.S: Handle unaligned bss.
+       Reported by: Paulo Flabiano Smorigo.
+
 2013-07-14  Vladimir Testov <vladimir.testov@rosalab.ru>
 
        * grub-core/gfxmenu/gui_list.c: USe viewport when drawing strings.
index b26c47edbaca7984e1bed93702d23f67d1589a36..21c884b433897e1dae15b06d1340ce0280f77c31 100644 (file)
@@ -34,14 +34,31 @@ _start:
        /* Stage1 won't zero BSS for us. In other cases, why not do it again?  */
        lis     6, (__bss_start - 4)@h
        ori     6, 6, (__bss_start - 4)@l
+
+2:     stb     2, 4(6)
+       addi    6, 6, 1
+       andi.   7, 6, 3
+       cmpi    0, 1, 7, 0
+       bne     2b
+       
        lis     7, (_end - 4)@h
        ori     7, 7, (_end - 4)@l
        subf    7, 6, 7
+       subi    8, 7, 1
+       andi.   8, 8, 3
+       addi    8, 8, 1
+       sub     7, 7, 8
+
        srwi    7, 7, 2 /* We store 4 bytes at a time.  */
        mtctr   7
 2:     stwu    2, 4(6) /* We know r2 is already 0 from above.  */
        bdnz    2b
 
+       mtctr   8
+2:     stb     2, 4(6) /* We know r2 is already 0 from above.  */
+       addi    6, 6, 1
+       bdnz    2b
+
        /* Store r5 in grub_ieee1275_entry_fn.  */
        lis     9, grub_ieee1275_entry_fn@ha
        stw     5, grub_ieee1275_entry_fn@l(9)