This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Not enough room for program headers (allocated 2, need 3)


I am trying to link code to run from ROM on an embbedded sparc with a linker 
script that looks something like the following

MEMORY
{
    CODE_ROM (RX) : ORIGIN = 0x00000000, LENGTH = 2M
    DATA    (RW) :  ORIGIN = 0x90000000, LENGTH = 16M
}

SECTIONS
{
.text :  { *(.text) } > CODE_ROM
.data :  AT ( 0x20000 )  { *(.data) } > DATA
.bss  :  AT (0x40000)    { *(.bss)  *(.sbss) }  > DATA

}

I get the following errors..

sparc-elf-gcc -mv8 -O0 -nostartfiles crt0-c9600.S main.c -o main.o  -t 
works.ld
<command line>: warning: "cpu" re-asserted
<command line>: warning: "machine" re-asserted
<command line>: warning: "cpu" re-asserted
<command line>: warning: "machine" re-asserted
/usr/local/lib/gcc-lib/sparc-elf/3.0/../../../../sparc-elf/bin/ld: main.o: 
Not enough room for program headers (allocated 2, need 3)
/usr/local/lib/gcc-lib/sparc-elf/3.0/../../../../sparc-elf/bin/ld: final 
link failed: Bad value
/usr/local/lib/gcc-lib/sparc-elf/3.0/../../../../sparc-elf/bin/ld: mode 
elf32_sparc
/cygdrive/c/TEMP/ccfO1DeI.o
/cygdrive/c/TEMP/ccty4Aeh.o
(/usr/local/lib/gcc-lib/sparc-elf/3.0/../../../../sparc-elf/lib/libc.a)exit.o
(/usr/local/lib/gcc-lib/sparc-elf/3.0/../../../../sparc-elf/lib/libc.a)impure.o
collect2: ld returned 1 exit status
make: *** [all] Error 1

If I remove the "AT (address)", the program links correctly but the LMA of 
the .data and .bss segments is not where I would like them.  Any 
suggestions?

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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