Index: hal/powerpc/arch/current/src/vectors.S =================================================================== --- hal/powerpc/arch/current/src/vectors.S (revision 3391) +++ hal/powerpc/arch/current/src/vectors.S (working copy) @@ -368,11 +368,13 @@ li r0,0 # r0 = 0 cmplw r3,r4 # skip if no bss beq 2f + sub r4,r4,r3 # compute number of words to clear + srwi r4,r4,2 + mtctr r4 + subi r3,r3,4 -1: stw r0,0(r3) # store zero - addi r3,r3,4 # increment by 1 word - cmplw r3,r4 # compare - blt 1b # loop if not yet done +1: stwu r0,4(r3) # store zero & increment pointer + bdnz 1b 2: # clear SBSS @@ -380,11 +382,13 @@ lwi r4,__sbss_end # r4 = end cmplw r3,r4 # skip if no sbss beq 2f + sub r4,r4,r3 # compute number of words to clear + srwi r4,r4,2 + mtctr r4 + subi r3,r3,4 -1: stw r0,0(r3) # store zero - addi r3,r3,4 # increment by 1 word - cmplw r3,r4 # compare - blt 1b # loop if not yet done +1: stwu r0,4(r3) # store zero & increment pointer + bdnz 1b 2: # It is now safe to call C functions which may rely on initialized