Bug 5205 - linker fails with section .bootpg can't be allocated in segment 1
Summary: linker fails with section .bootpg can't be allocated in segment 1
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-22 08:43 UTC by Clemens Koller
Modified: 2007-12-12 11:39 UTC (History)
2 users (show)

See Also:
Host: powerpc-unknown-linux-gnu
Target: powerpc-unknown-linux-gnu
Build: powerpc-unknown-linux-gnu
Last reconfirmed:


Attachments
reduced testcase (5.32 KB, application/octet-stream)
2007-10-22 09:02 UTC, Clemens Koller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Clemens Koller 2007-10-22 08:43:17 UTC
compiling u-boot-1.3.0-rc3 (and others at least since 1.3.0) with gcc-4.2.2 and
binutils-2.18.50.20071019:

UNDEF_SYM=`objdump -x lib_generic/libgeneric.a board/tqm85xx/libtqm85xx.a
cpu/mpc85xx/libmpc85xx.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/bios_emulator/libatibiosemu.a
drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a
drivers/onenand/libonenand.a drivers/net/libnet.a drivers/qe/qe.a
drivers/serial/libserial.a drivers/sk98lin/libsk98lin.a post/libpost.a
post/drivers/libpostdrivers.a post/lib_ppc/libpostppc.a
post/lib_ppc/fpu/libpostppcfpu.a common/libcommon.a libfdt/libfdt.a |sed  -n -e
's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
                cd /share/home/clemens/work/u-boot/u-boot-1.3.0-rc3 && ld
-Bstatic -T
/share/home/clemens/work/u-boot/u-boot-1.3.0-rc3/board/tqm85xx/u-boot.lds -Ttext
0xfffc0000  -n $UNDEF_SYM cpu/mpc85xx/start.o cpu/mpc85xx/resetvec.o \
                        --start-group lib_generic/libgeneric.a
board/tqm85xx/libtqm85xx.a cpu/mpc85xx/libmpc85xx.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/bios_emulator/libatibiosemu.a drivers/nand/libnand.a
drivers/nand_legacy/libnand_legacy.a drivers/onenand/libonenand.a
drivers/net/libnet.a drivers/qe/qe.a drivers/serial/libserial.a
drivers/sk98lin/libsk98lin.a post/libpost.a post/drivers/libpostdrivers.a
post/lib_ppc/libpostppc.a post/lib_ppc/fpu/libpostppcfpu.a common/libcommon.a
libfdt/libfdt.a --end-group -L /usr/lib/gcc/powerpc-unknown-linux-gnu/4.2.2 -lgcc \
                        -Map u-boot.map -o u-boot
ld: u-boot: section `.bootpg' can't be allocated in segment 1
LOAD: .bootpg .resetvec
ld: final link failed: Bad value
make: *** [u-boot] Error 1

Will try to create a reduced testcase.
Comment 1 Clemens Koller 2007-10-22 09:02:15 UTC
Created attachment 2057 [details]
reduced testcase
Comment 2 H.J. Lu 2007-10-22 21:04:24 UTC
I can't reproduce it:

./ld -Bstatic -T u-boot.lds -Ttext 0xfffc0000 -n start.o resetvec.o -Map
u-boot.map -o u-boot
start.o: In function `_start_cont':
/share/home/clemens/work/u-boot/u-boot-1.3.0-rc3/cpu/mpc85xx/start.S:326:
undefined reference to `cpu_init_f'
/share/home/clemens/work/u-boot/u-boot-1.3.0-rc3/cpu/mpc85xx/start.S:327:
undefined reference to `board_init_f'
....
Comment 3 Clemens Koller 2007-10-22 22:06:35 UTC
ld seems to fails before it starts to resolve the external (in the testcase
_not_ included) references. I'll have to check more in detail. Any hints?
Comment 4 H.J. Lu 2007-10-22 22:35:03 UTC
(In reply to comment #3)
> ld seems to fails before it starts to resolve the external (in the testcase
> _not_ included) references. I'll have to check more in detail. Any hints?

Without a testcase, I can't tell for sure. It can be anything from bad hardware,
bad libc, bad gcc, ...
Comment 5 Clemens Koller 2007-12-12 11:39:32 UTC
This bug was fixed now in:
http://sourceware.org/ml/binutils/2007-11/msg00235.html

Using the latest binutils-snapshot (at least):
$ ld -v
GNU ld (GNU Binutils) 2.18.50.20071212

the latest U-Boot
commit 41be969f4957115ed7b1fe8b890bfaee99d7a7a2
Author: Wolfgang Denk <wd@denx.de>
Date:   Thu Dec 6 10:21:19 2007 +0100
    Release v1.3.1
compiled a  $ make TQM8540_config target with gcc-4.2.2 within
an native mpc8540 environment fine now.