Re: [arm-gnu] Problem with u-boot compiled with 2006q1-3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [arm-gnu] Problem with u-boot compiled with 2006q1-3
- To: Tomi.Valkeinen@xxxxxxxxx
- Subject: Re: [arm-gnu] Problem with u-boot compiled with 2006q1-3
- From: Richard Earnshaw <rearnsha@xxxxxxx>
- Date: Thu, 18 May 2006 11:55:26 +0100
On Thu, 2006-05-18 at 09:24, Tomi.Valkeinen@xxxxxxxxx wrote:
> Hi,
>
> I was unable to run u-boot compiled with the newest codesourcery
> toolchain and after debugging I got the problem isolated to an example
> below. U-boot breaks with -Os but works with -O0, but the example below
> does not work with either one. Earlier toolchains work.
>
> It looks like gcc does not obey the instruction to use r8 for gd
> variable in main function, and so the program crashes when func() uses
> gd which it thinks is in r8. Is this a bug in u-boot code or in gcc?
>
> Best regards,
> Tomi Valkeinen
>
This is a bug in uboot.
int main()
{
register volatile gd_t *gd asm("r8");
Does not declare a global register. It declares a local variable in r8.
You need to contact the uboot maintainers and get them to fix the
problem in their sources.
R.