06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.5 Images with a complex memory map<br />

<strong>Using</strong> scatter files<br />

For images with a complex memory map, you cannot specify <strong>the</strong> memory map using basic<br />

linker command-line options. Such images require <strong>the</strong> use of a scatter file.<br />

The following figure shows a complex memory map:<br />

Figure 8-2 Complex memory map<br />

The following example shows <strong>the</strong> corresponding scatter-loading description that loads <strong>the</strong><br />

segments from <strong>the</strong> program1.o and program2.o files into memory:<br />

Example 8-2 Complex memory map in a scatter file<br />

LOAD_ROM_1 0x0000 ; Start address for first load region (0x0000)<br />

{<br />

EXEC_ROM_1 0x0000 ; Start address for first exec region (0x0000)<br />

{<br />

program1.o (+RO) ; Place all code and RO data from<br />

; program1.o into this exec region<br />

}<br />

}<br />

0x4000<br />

0x0000<br />

Load view<br />

RW section#2<br />

RO section#2<br />

RW section#1<br />

RO section#1<br />

Zero fill<br />

Execution view<br />

ZI section#2<br />

RW section#1<br />

ZI section#1<br />

RW section#2<br />

RO section#2<br />

RO section#1<br />

DRAM 0x18000 0x8000 ; Start address for this exec region (0x18000),<br />

; Maximum size of this exec region (0x8000)<br />

{<br />

program1.o (+RW, +ZI) ; Place all RW and ZI data from<br />

; program1.o into this exec region<br />

}<br />

LOAD_ROM_2 0x4000 ; Start address for second load region (0x4000)<br />

{<br />

EXEC_ROM_2 0x4000<br />

{<br />

program2.o (+RO) ; Place all code and RO data from<br />

; program2.o into this exec region<br />

}<br />

0x20000<br />

0x18000<br />

0x08000<br />

0x00000<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 8-9<br />

ID080411 Non-Confidential<br />

DRAM<br />

0x10000<br />

SRAM<br />

ROM2<br />

ROM1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!