I'm having trouble building OpenHackWare (the firmware for qemu-system-ppc) from source on a PPC machine running Fedora 6, using either gcc 4.1.1 or gcc 3.4.6. I'm using the source tarball http://perso.magic.fr/l_indien/OpenHackWare/0.4/OpenHackWare-0.4.1.tar.bz2, with the patch pc-bios/ohw.diff from qemu-snapshot-2007-02-09_05.tar.bz2.
The code compiles just fine (although gcc 4.1.1 generates a lot of warnings), but fails to link: ld -O2 -g -nostdlib -T src/main.ld -o .objs/main.out .objs/main.o .objs/bootinfos.o .objs/bloc.o .objs/pci.o .objs/of. \ o .objs/start.o .objs/nvram.o .objs/vga.o .objs/mm.o .objs/char.o .objs/malloc.o .objs/errno.o .objs/_vprintf.o .objs/\ printf.o .objs/sprintf.o .objs/snprintf.o .objs/vprintf.o .objs/vsprintf.o .objs/vsnprintf.o .objs/dprintf.o .objs/vdp\ rintf.o .objs/memcpy.o .objs/memccpy.o .objs/mempcpy.o .objs/memmove.o .objs/memcmove.o .objs/mempmove.o .objs/memset. \ o .objs/memcmp.o .objs/memchr.o .objs/rawmemchr.o .objs/memrchr.o .objs/memmem.o .objs/strcpy.o .objs/strdup.o .objs/s\ trndup.o .objs/stpcpy.o .objs/stpncpy.o .objs/strcat.o .objs/strncat.o .objs/strcmp.o .objs/strcasecmp.o .objs/strncmp\ .o .objs/strncasecmp.o .objs/strchr.o .objs/strchrnul.o .objs/strrchr.o .objs/basename.o .objs/dirname.o .objs/strlen. \ o .objs/strnlen.o .objs/exec_core.o .objs/exec_elf.o .objs/exec_xcoff.o .objs/exec_macho.o .objs/exec_chrp.o .objs/exe\ c_prep.o .objs/exec_pef.o .objs/fs_core.o .objs/fs_raw.o .objs/fs_ext2.o .objs/fs_isofs.o .objs/fs_hfs.o .objs/part_co\ re.o .objs/part_apple.o .objs/part_isofs.o .objs/part_prep.o .objs/dev_char_pckbd.o .objs/dev_char_kbdadb.o .objs/dev_\ char_kbd.o ld: region start is full (.objs/main.out section .rodata.str1.4) ld: region start is full (.objs/main.out section .rodata.str1.4) ld: section .text [0000000005800400 -> 0000000005813767] overlaps section .rodata.str1.4 [0000000005800054 -> 00000000\ 05804683] ld: .objs/main.out: section .text lma 0x5800400 overlaps previous sections ld: .objs/main.out: section .OpenFirmware lma 0x5813768 overlaps previous sections ld: .objs/main.out: section .data lma 0x581946c overlaps previous sections ld: .objs/main.out: section .OpenFirmware_vars lma 0x582053c overlaps previous sections ld: .objs/main.out: section .sdata lma 0x5821a4c overlaps previous sections ld: .objs/main.out: section .rodata lma 0x5821a5c overlaps previous sections ld: .objs/main.out: section .RTAS lma 0x5822654 overlaps previous sections ld: .objs/main.out: section .RTAS_vars lma 0x5823c10 overlaps previous sections make: *** [.objs/main.out] Error 1 I thought debug symbols might be making the code too big, but the same error occurs when compiling without -g. The only thing that seems to work is increasing the length of the start section in main.ld, and moving the bios section's origin to compensate. Unfortunately the resulting binary hangs; the OS presumably relies on the bios origin being 0x05800400. Any hints would be appreciated. --Ed