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
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
8.12 Placing a named section explicitly using scatter-loading<br />
8.12.1 See also<br />
<strong>Using</strong> scatter files<br />
The following example shows how to place a named section explicitly using scatter-loading:<br />
Example 8-7 Explicit section placement<br />
LR1 0x0 0x10000<br />
{<br />
ER1 0x0 0x2000 ; Root Region, containing init code<br />
{<br />
init.o (INIT, +FIRST) ; place init code at exactly 0x0<br />
*(+RO) ; rest of code and read-only data<br />
}<br />
RAM_RW 0x400000 (0x1FF00-0x2000) ; RW & ZI data to be placed at 0x400000<br />
{<br />
*(+RW)<br />
}<br />
RAM_ZI +0<br />
{<br />
*(+ZI)<br />
}<br />
DATABLOCK 0x1FF00 0xFF ; execution region at 0x1FF00<br />
{ ; maximum space available for table is 0xFF<br />
data.o(+RO-DATA) ; place RO data between 0x1FF00 and 0x1FFFF<br />
}<br />
}<br />
In this example, <strong>the</strong> scatter-loading description places:<br />
• The initialization code is placed in <strong>the</strong> INIT section in <strong>the</strong> init.o file. This example shows<br />
that <strong>the</strong> code from <strong>the</strong> INIT section is placed first, at address 0x0, followed by <strong>the</strong><br />
remainder of <strong>the</strong> RO code and all of <strong>the</strong> RO data except for <strong>the</strong> RO data in <strong>the</strong> object<br />
data.o.<br />
• All global RW variables in RAM at 0x400000.<br />
• A table of RO-DATA from data.o at address 0x1FF00.<br />
Tasks<br />
• <strong>Using</strong> <strong>the</strong> FIXED attribute to create root regions on page 8-17.<br />
Concepts<br />
<strong>Linker</strong> Reference:<br />
• About load region descriptions on page 4-5<br />
• About execution region descriptions on page 4-8.<br />
Reference<br />
<strong>Linker</strong> Reference:<br />
• Load region attributes on page 4-7<br />
• Execution region attributes on page 4-11<br />
• Address attributes for load and execution regions on page 4-14.<br />
Assembler Reference:<br />
• ENTRY on page 6-65.<br />
<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 8-23<br />
ID080411 Non-Confidential