[U-Boot-Users] Problems compiling u-boot for AMCC katmai board

Folks,
I am having a "learning experience" in trying to compile u-boot for the AMCC Katmai board. It always gets through the entire build, right up to the final
link stage. The linking is failing with the .bss section overlapping the .resetvec section, and several episodes of "relocation truncated to fit."
My build platform is an AMD64 system:
uname -a: Linux wfbamd64 2.4.21-15.0.2.ELsmp #1 SMP Wed Jun 16 22:35:40 EDT 2004 x86_64 x86_64 x86_64 GNU/Linux
I've reproduced my errors with a CROSSTOOL cross-compiler GCC 4.0.0/GLIBC 2.3.5, and with a similar cross-compiler GCC 3.4.1/GLIBC 2.3.3.
To those who have successfully built the Katmai u-boot binaries (and I know you're out there!) I ask: how did you do it? What compiler/toolchain/cross-compiler, etc
did you use?
Thanks!
This is the tail of the compile attempt:
UNDEF_SYM=`/opt/crosstool/gcc-4.0.0-glibc-2.3.5/powerpc-440-linux-gnu/bi n/powerpc-440-linux-gnu-objdump -x lib_generic/libgeneric.a board/amcc/katmai/libkatmai.a cpu/ppc4xx/libppc4xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/drivers/libpostdrivers.a post/lib_ppc/libpostppc.a common/libcommon.a |sed -n -e 's/.*(__u_boot_cmd_.*)/-u\1/p'|sort|uniq`;\
cd /home/na2e/ncc3/uboot/u-boot.git && /opt/crosstool/gcc-4.0.0-glibc-2.3.5/powerpc-440-linux-gnu/bin/powerpc-4 40-linux-gnu-ld -Bstatic -T /home/na2e/ncc3/uboot/u-boot.git/board/amcc/katmai/u-boot.lds -Ttext 0xfffc0000 -n $UNDEF_SYM cpu/ppc4xx/start.o cpu/ppc4xx/resetvec.o \
--start-group lib_generic/libgeneric.a board/amcc/katmai/libkatmai.a cpu/ppc4xx/libppc4xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/drivers/libpostdrivers.a post/lib_ppc/libpostppc.a common/libcommon.a --end-group -L /opt/crosstool/gcc-4.0.0-glibc-2.3.5/powerpc-440-linux-gnu/lib/gcc/power pc-440-linux-gnu/4.0.0/nof -lgcc \
-Map u-boot.map -o u-boot
/opt/crosstool/gcc-4.0.0-glibc-2.3.5/powerpc-440-linux-gnu/bin/powerpc-4 40-linux-gnu-ld: section .bss [00000000ffff8e00 -> 000000010004750f] overlaps section .resetvec [00000000fffffffc -> 00000000ffffffff]
cpu/ppc4xx/start.o:start.S:198: relocation truncated to fit: R_PPC_ADDR32 against symbol `_end' defined in *ABS* section in <none>
board/amcc/katmai/libkatmai.a(cmd_katmai.o):(.got2+0x14): relocation truncated to fit: R_PPC_ADDR32 against symbol `console_buffer' defined in COMMON section in common/libcommon.a(main.o)
lib_ppc/libppc.a(board.o):(.got2+0x34): relocation truncated to fit: R_PPC_ADDR32 against symbol `_end' defined in *ABS* section in <none>
lib_ppc/libppc.a(board.o):(.got2+0x70): relocation truncated to fit: R_PPC_ADDR32 against symbol `BootFile' defined in COMMON section in net/libnet.a(net.o)
net/libnet.a(net.o):(.got2+0xbc): relocation truncated to fit: R_PPC_ADDR32 against symbol `PktBuf' defined in COMMON section in net/libnet.a(net.o)+1f
net/libnet.a(net.o):(.got2+0xc0): relocation truncated to fit: R_PPC_ADDR32 against symbol `NetRxPackets' defined in COMMON section in net/libnet.a(net.o)
net/libnet.a(net.o):(.got2+0xc4): relocation truncated to fit: R_PPC_ADDR32 against symbol `NetArpWaitPacketBuf' defined in COMMON section in net/libnet.a(net.o)+1f
net/libnet.a(tftp.o):(.got2+0x78): relocation truncated to fit: R_PPC_ADDR32 against symbol `BootFile' defined in COMMON section in net/libnet.a(net.o)
net/libnet.a(bootp.o):(.got2+0x10): relocation truncated to fit: R_PPC_ADDR32 against symbol `BootFile' defined in COMMON section in net/libnet.a(net.o)
net/libnet.a(nfs.o):(.got2+0x84): relocation truncated to fit: R_PPC_ADDR32 against symbol `BootFile' defined in COMMON section in net/libnet.a(net.o)
drivers/libdrivers.a(cfi_flash.o):(.got2+0x0): additional relocation overflows omitted from the output
make: *** [u-boot] Error 1
--Regards, --Peter Tannenbaum na2e@cadence.com (845) 383-3762 88-655-3762 --Send Chocolate

In message 2315F4A3362D0045AA06DFA9999664EC02527255@MAILNA1.global.cadence.com you wrote:
I am having a "learning experience" in trying to compile u-boot for the AMCC Katmai board. It always gets through the entire build, right up to the final link stage. The linking is failing with the .bss section overlapping the .resetvec section, and several episodes of "relocation truncated to fit."
That means the code is too big. Strange.
I've reproduced my errors with a CROSSTOOL cross-compiler GCC 4.0.0/GLIBC 2.3.5, and with a similar cross-compiler GCC 3.4.1/GLIBC 2.3.3.
Hm... GCC 3.4.x is certainly a good candidate for nasty surprises, but GCC 4.0.0 should work sufficiently well. We use GCC-4.0.0 in ELDK version 4.0, too, and it works just fine.
Even older versions work. For example:
ELDK 3.1.1: GCC 3.3.3 ==> __bss_start = 0xffffd200
ELDK 4.1: GCC 4.0.0 ==> __bss_start = 0xffff8f00
As you can see, GCC 4.0.0 is a bit better in terms of optimizations - we have 28.25 kB instead of 11.5 kB free room at the end of the image.
Ummm.. maybe you are running a broken version of the binutils?
To those who have successfully built the Katmai u-boot binaries (and I know you're out there!) I ask: how did you do it? What compiler/toolchain/cross-compiler, etc did you use?
Any ELDK version 3.x or 4.x should work just fine. Tested again with ELDK 3.1.1 and 4.0 and 4.1
/opt/crosstool/gcc-4.0.0-glibc-2.3.5/powerpc-440-linux-gnu/bin/powerpc-4 40-linux-gnu-ld: section .bss [00000000ffff8e00 -> 000000010004750f] overlaps section .resetvec [00000000fffffffc -> 00000000ffffffff]
Ummm... Your linker seems to assume we had 64 bit addresses, which is not the case. Please configure your binutils to use 32 bit addresses only.
Best regards,
Wolfgang Denk
participants (2)
-
Peter Tannenbaum
-
Wolfgang Denk