On Mon, 2006-07-03 at 02:10, Bridge Wu wrote:
> Hello,
> 
> When I built blob with arm-iwmmxt-linux-gnueabi toolchain, I found the
> SP value before invoking number() in printf() may be 0 or 4 modulo 8.
> If SP is 0 modulo 8, printf worked well, but while SP is 4 modulo 8,
> printf failed. It cannot store long long type parameter into stack
> before invoking number() with strd instruction. I was using GCC-4.1.1.
> 
> According to ABI for ARM architecture in
> http://www.arm.com/miscPDFs/13176.pdf, it seems GCC should address the
> implementation of va_arg. Below is the excerption from that spec. Does
> anybody know how to solve this issue or make sure GCC always generate
> 8-byte aligned SP?

GCC implements this requirement by preserving the alignment of the stack
to a multiple of 8 bytes.  However, if the caller of a function hasn't
kept to this requirement then your printf can fail.

The most likely cause of your problem is (in approximate order of
likelihood):

1) Your crt0 startup code is not setting up the stack correctly.
2) You are mixing code produced by an older version of GCC or some other
compiler that does not conform.
3) An assembler frame is not preserving the stack alignment before
calling back into your code.
4) There is a bug in the stack alignment code in the compiler.

If you are still convinced that the problem is 4) Then please provide an
testcase that demonstrates the problem by filing a bug report in
bugzilla.

R.

Reply via email to