[U-Boot-Users] U-boot problem with new codesourcery toolchain

Tomi.Valkeinen at nokia.com Tomi.Valkeinen at nokia.com
Thu May 18 15:21:48 CEST 2006


I noticed that u-boot does not work when compiled with new arm toolchain
from codesourcery. Debugging showed that the problem is with the global
variable declared with DECLARE_GLOBAL_DATA_PTR
(include/asm-arm/global_data.h). In lib_arm/board.c:start_armboot() the
gd variable is never put to r8, but is optimized away. I guess this is
correct behaviour from the compiler, as the variable is declared as a
local variable, and is never used (from the compilers point of view).

What I don't understand is why the variable is declared as a local var.
Declaring it as a global in global_data.h fixes the bug and is simpler.

An other problem is when linking u-boot with the toolchain:
bin/../lib/gcc/arm-none-linux-gnueabi/4.1.0/libgcc.a(_dvmd_lnx.o): In
m:(.text+0x8): undefined reference to `raise'

It seems that the libgcc in the toolchain uses raise() inside __div0,
and raise is defined (I think) in libc. It sounds a bit weird to use
raise from libc in libgcc though. But in any case this led me thinking
if it would be feasible not to use libgcc at all. The needed functions
could be copied from linux source, and I don't think there are too many
of those funcs. I may be totally wrong here of course =). But then
u-boot would not depend on anything, which would be a good thing.

Best regards,
 Tomi Valkeinen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20060518/bd078e61/attachment.htm 

More information about the U-Boot mailing list