[U-Boot] [PATCH v2] ARM: Align stack to 8 bytes

Wolfgang Denk wd at denx.de
Tue Jun 22 22:20:20 CEST 2010


Dear Vitaly Kuzmichev,

In message <1276625891-22206-1-git-send-email-vkuzmichev at mvista.com> you wrote:
> The ARM ABI requires that the stack be aligned to 8 bytes as it is noted
> in Procedure Call Standard for the ARM Architecture:
> http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/index.html
> 
> Unaligned SP also causes the problem with variable-length arrays
> allocation when VLA address becomes less than stack pointer during
> aligning of this address, so the next 'push' in the stack overwrites
> first 4 bytes of VLA.
> 
> Signed-off-by: Vitaly Kuzmichev <vkuzmichev at mvista.com>
> ---
>  arch/arm/cpu/arm1136/start.S      |    1 +
>  arch/arm/cpu/arm1176/start.S      |    1 +
>  arch/arm/cpu/arm720t/start.S      |    1 +
>  arch/arm/cpu/arm920t/start.S      |    1 +
>  arch/arm/cpu/arm925t/start.S      |    1 +
>  arch/arm/cpu/arm926ejs/start.S    |    2 +-
>  arch/arm/cpu/arm946es/start.S     |    1 +
>  arch/arm/cpu/arm_cortexa8/start.S |    2 +-
>  arch/arm/cpu/arm_intcm/start.S    |    1 +
>  arch/arm/cpu/ixp/start.S          |    1 +
>  arch/arm/cpu/lh7a40x/start.S      |    1 +
>  arch/arm/cpu/pxa/start.S          |    1 +
>  arch/arm/cpu/s3c44b0/start.S      |    1 +
>  arch/arm/cpu/sa1100/start.S       |    1 +
>  14 files changed, 14 insertions(+), 2 deletions(-)

This is a pretty intrusive patch as it affects all ARM architectures,
but the change has been discussed here several times before, and the
actual commit looks OK to me, too.

Tested on tx25(mx25), imx27lite(mx27), qong(mx31) and trab(s3c2400)
Tested-by: Wolfgang Denk <wd at denx.de>

Applied to master (i. e. it will be included in -rc3, this release).


ARM custodians: please help testing this!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Pardon me for breathing, which I never do anyway so I don't know why
I bother to say it, oh God, I'm so depressed. Here's another of those
self-satisfied doors. Life! Don't talk to me about life."
                                        - Marvin the Paranoid Android


More information about the U-Boot mailing list