public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Not enough room for program headers (allocated 2, need 3)
@ 2001-12-13 11:04 Terry Hipp
  0 siblings, 0 replies; only message in thread
From: Terry Hipp @ 2001-12-13 11:04 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-12-13 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-13 11:04 Not enough room for program headers (allocated 2, need 3) Terry Hipp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).