Specifications
314 www.xilinx.com Embedded System Tools Guide (EDK 6.2i)
1-800-255-7778 UG111 (v1.4) January 30, 2004
Chapter 22: Address Management
R
External Memory, and you may want to keep that portion of your code that is accessed the
most frequently in LMB memory, and that which is accessed the least frequently in
External Memory.
You will need to provide a linker script to mb-gcc using the following command:
mb-gcc -Wl,-T -Wl,linker_script file1.c file2.c -save-temps
This tells mb-gcc to use your linker script only, and to not use the default (built-in) linker
script.
The Linker Script defines the layout and the start address of each of the sections for the
output executable file. Here is a sample linker script.
/*
* Define the memory layout, specifying the start address and size of the
* different memory regions.
*/
MEMORY
{
LMB : ORIGIN = 0x0, LENGTH = 0x1000
OPB : ORIGIN = 0x8000, LENGTH = 0x5000
}
/*
* Specify the default entry point to the program
*/
ENTRY(_start)
/*
* Define the sections, and where they are mapped in memory
*/
SECTIONS
{
/*
* Specify that the .text section from all input object files will be
* placed in LMB memory into the output file section .text Note that
* mb-gdb expects the executable to have a section called .text
*/
.text : {
/* Uncomment the following line to add specific files in the opb_text */
/* region */
/* *(EXCLUDE_FILE(file1.o).text) */
/* Comment out the following line to have multiple text sections */
*(.text)
} >LMB
/* Define space for the stack and heap */
/* Note that variables _heap must be set to the beginning of this area
*/
/* and _stack set to the end of this area */
. = ALIGN(4);
_heap = .;
.bss : {
_STACK_SIZE = 0x400;










