This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: ld: memory assignments
- To: W dot Wadepohl at indumat dot de
- Subject: Re: ld: memory assignments
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 26 Apr 2000 13:22:07 -0700
- CC: binutils at sourceware dot cygnus dot com
- References: <3906CEA4.9B576087@indumat.de>
Date: Wed, 26 Apr 2000 13:10:28 +0200
From: Wolfram Wadepohl <W.Wadepohl@indumat.de>
using gcc for cross m68k development i have a problem in assigning the
sections to memory regions. the linker script is
MEMORY {
flash : ORIGIN = 0x01200000, LENGTH = 6M
dram : ORIGIN = 0x04000000, LENGTH = 1M
}
OUTPUT_FORMAT ( COFF )
SECTIONS {
.data : AT ( ADDR(.text) + SIZEOF(.text) ) {
} > dram = 0x0
.text : {
} > flash = 0xFF
.bss : {
} > dram = 0x0
}
The linker does not locate the .text section as exspected to the region
beginning at 0x1200000. It locates it starting at 0x1000000 instead and
fails because the end of the .text section is not in the flash region.
You haven't told the linker where to put any of the input sections.
You need something like
.text : { *(.text) } > flash = 0xFF
and so on. The linker does not make any assumptions about input
sections based on the output sections.
Ian