]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: zImage: make sure the stack is 64-bit aligned
authorNicolas Pitre <nicolas.pitre@linaro.org>
Fri, 22 Apr 2011 01:45:08 +0000 (21:45 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 21 May 2011 22:13:11 +0000 (15:13 -0700)
commit 3bd2cbb95543acf44fe123eb9f038de54e655eb4 upstream.

With ARMv5+ and EABI, the compiler expects a 64-bit aligned stack so
instructions like STRD and LDRD can be used.  Without this, mysterious
boot failures were seen semi randomly with the LZMA decompressor.

While at it, let's align .bss as well.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/boot/compressed/Makefile
arch/arm/boot/compressed/vmlinux.lds.in

index 0a8f748e506adfc415b857bc94dec36e25498999..e1bea82284ae54dbea022507a86e53d499612668 100644 (file)
@@ -59,7 +59,7 @@ ZTEXTADDR     := $(CONFIG_ZBOOT_ROM_TEXT)
 ZBSSADDR       := $(CONFIG_ZBOOT_ROM_BSS)
 else
 ZTEXTADDR      := 0
-ZBSSADDR       := ALIGN(4)
+ZBSSADDR       := ALIGN(8)
 endif
 
 SEDFLAGS       = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
index 366a924019ac6dcf1ccaad07b605f6c6ec1b74c6..7ece7056ba0ea85cf2445bd41966651531e9303a 100644 (file)
@@ -57,6 +57,7 @@ SECTIONS
   .bss                 : { *(.bss) }
   _end = .;
 
+  . = ALIGN(8);                /* the stack must be 64-bit aligned */
   .stack               : { *(.stack) }
 
   .stab 0              : { *(.stab) }