linker script
Manfred Metzger
ManfredMetzger@gmx.de
Thu Nov 25 20:04:00 GMT 2004
Hi,
in an embedded application I want to run some functions from the internal
RAM of an arm7 microcontroller for faster execution.
To do this, I have to copy these functions from external FLASH-memory to
the internal RAM. I thought it should be possible do handle this like the
.data section is handled, by copying the functions in the startup-code to the
internal RAM. But i can't figure out how to tell this to my linker script
(below is the version i use without this feature, out of my head and
incomplete as I don't have it here). Whatever I try, the linker emits an
error (most of the time about overlaping sections).
Any hints how to do this? I use gcc-3.4.2 and binutils-2.15 configured as
arm-elf.
Thanks,
Manni
--------------------------------------------------------------------------------------------------------------------
...
MEMORY
{
FLASH : ORIGIN = ..., LENGTH = ...
RAM : ORIGIN = ..., LENGTH = ...
INTRAM : ORIGIN = ..., LENGTH = ...
}
SECTIONS
{
.text :
{
*(.text)
*(.rodata)
*(.glue_7)
*(.glue_7t)
. = ALIGN(4);
_etext = . ;
} > FLASH
.data : AT (_etext)
{
_data = .;
*(.data)
. = ALIGN(4);
_edata = . ;
} > RAM
.bss :
{
_bss = . ;
*(.bss)
*(COMMON)
. = ALIGN(4);
_ebss = . ;
} > RAM
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list