# HG changeset patch # User nickg # Date 1234193689 0 # Node ID 4db2c98d89f84e8544f2c6652563ac5a6df1902b # Parent 7337b9f24edf0ba89eb0853c15d192d66bf5bb6d * src/vectors.S (start): The loop to initialize BSS was using a BLS to terminate. This caused an extra zero to be stored beyond the end of __bss_end. Usually this is benign, but when __bss_end is at the very top of RAM, and the hardware generates an exception for illegal accesses, this can crash the program before it even starts. The fix is to use a BLT instructions which will terminate the loop 1 word earlier. diff --git a/packages/hal/arm/arch/current/ChangeLog b/packages/hal/arm/arch/current/ChangeLog --- a/packages/hal/arm/arch/current/ChangeLog +++ b/packages/hal/arm/arch/current/ChangeLog @@ -1,3 +1,13 @@ +2009-02-09 Nick Garnett + + * src/vectors.S (start): The loop to initialize BSS was using a + BLS to terminate. This caused an extra zero to be stored beyond + the end of __bss_end. Usually this is benign, but when __bss_end + is at the very top of RAM, and the hardware generates an exception + for illegal accesses, this can crash the program before it even + starts. The fix is to use a BLT instructions which will terminate + the loop 1 word earlier. + 2009-02-02 Bart Veer * cdl/hal_arm.cdl: add new architectural CFLAGS and LDFLAGS diff --git a/packages/hal/arm/arch/current/src/vectors.S b/packages/hal/arm/arch/current/src/vectors.S --- a/packages/hal/arm/arch/current/src/vectors.S +++ b/packages/hal/arm/arch/current/src/vectors.S @@ -450,7 +450,7 @@ 2: beq 2f 1: str r0,[r1],#4 cmp r1,r2 - bls 1b + blt 1b 2: // Run kernel + application in THUMB mode