This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] Respect "red zone" for SPU inferior calls
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: mark dot kettenis at xs4all dot nl (Mark Kettenis)
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 6 Aug 2008 22:12:53 +0200 (CEST)
- Subject: Re: [commit] Respect "red zone" for SPU inferior calls
Mark Kettenis wrote:
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > GDB neglected to respect the ABI-defined "red zone" of 2000 bytes on the SPU,
> > which could cause stack corruption when calling an inferior function while
> > within prologue code of another function. Fixed by the patch below.
>
> Do I read that right, is that reallu *decimal* 2000? Seems a bit ood
> to me.
It may be odd, but this is indeed what the ABI specifies:
http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/02E544E65760B0BF87257060006F8F20/$file/SPU_ABI-Specification_1.8.pdf
"Storing to memory using the stack pointer plus an offset must never be
done with an offset less than -2000 (-125*16). This allows interrupt
handlers to use the application stack by first adding -2000 to the
stack pointer." (p. 9)
This also agrees with what GCC implements.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com