This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld fails in current cvs when linking for powerpc-eabi
- To: Michael Schwingen <rincewind at discworld dot dascon dot de>
- Subject: Re: ld fails in current cvs when linking for powerpc-eabi
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 11 Jul 2001 11:43:59 +0100
- Cc: binutils <binutils at sourceware dot cygnus dot com>
- References: <20010709163247.B29072@a-tuin.dascon.de>
Hi Michael,
> when linking a small program (the uncompress code for out OS), the following
> happens with the current CVS version of binutils, configured for
> powerpc-eabi (in conjunction with gcc-3-cvs from today):
>
> $ powerpc-eabi-gcc -v -g -nostdlib -Wl,-T../lc16a.obj_d/ld.tmp -Wl,-Map,../lc16a.obj_d/lvl1ldr.map -o ../lc16a.obj_d/lvl1ldr.elf -lgcc
> /opt/cgcc2/lib/gcc-lib/powerpc-eabi/3.0.1/../../../../powerpc-eabi/bin/ld: ../lc16a.obj_d/lvl1ldr.elf: Not enough room for program headers, try linking with -N
>
> The info file tells me that -N makes text and data sections
> read/write, which I do not want. Am I doing somwthing wrong?
The info also has more information:
When producing an ELF output file, if the linker script
uses the SIZEOF_HEADERS builtin function, the linker
must compute the number of program headers before it has
determined all the section addresses and sizes. If the
linker later discovers that it needs additional program
headers, it will report an error "not enough room for
program headers". To avoid this error, you must avoid
using the SIZEOF_HEADERS function, or you must rework
your linker script to avoid forcing the linker to use
additional program headers, or you must define the
program headers yourself using the PHDRS command.
So you need to examine your linker script (ld.tmp in the command line
above) and work out how to resolve this problem.
Cheers
Nick