This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld fails in current cvs when linking for powerpc-eabi


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]