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.10 <strong>Using</strong> <strong>the</strong> FIXED attribute to create root regions<br />
8.10.1 See also<br />
<strong>Using</strong> scatter files<br />
You can use <strong>the</strong> FIXED attribute in an execution region scatter file to create root regions that load<br />
and execute at fixed addresses.<br />
FIXED is used to create multiple root regions within a single load region and <strong>the</strong>refore typically<br />
a single ROM device. For example, you can use this to place a function or a block of data, such<br />
as a constant table or a checksum, at a fixed address in ROM so that it can be accessed easily<br />
through pointers.<br />
If you specify, for example, that some initialization code is to be placed at start of ROM and a<br />
checksum at <strong>the</strong> end of ROM, some of <strong>the</strong> memory contents might be unused. Use <strong>the</strong> * or .ANY<br />
module selector to flood fill <strong>the</strong> region between <strong>the</strong> end of <strong>the</strong> initialization block and <strong>the</strong> start<br />
of <strong>the</strong> data block.<br />
To make your code easier to maintain and debug, it is suggested that you use <strong>the</strong> minimum<br />
amount of placement specifications in scatter files and leave <strong>the</strong> detailed placement of functions<br />
and data to <strong>the</strong> linker.<br />
You cannot specify component objects that have been partially linked. For example, if you<br />
partially link <strong>the</strong> objects obj1.o, obj2.o, and obj3.o toge<strong>the</strong>r to produce obj_all.o, <strong>the</strong><br />
component object names are discarded in <strong>the</strong> resulting object. Therefore, you cannot refer to one<br />
of <strong>the</strong> objects by name, for example, obj1.o. You can refer only to <strong>the</strong> combined object<br />
obj_all.o.<br />
Note<br />
There are some situations where using FIXED and a single load region are not appropriate. O<strong>the</strong>r<br />
techniques for specifying fixed locations are:<br />
• If your loader can handle multiple load regions, place <strong>the</strong> RO code or data in its own load<br />
region.<br />
• If you do not require <strong>the</strong> function or data to be at a fixed location in ROM, use ABSOLUTE<br />
instead of FIXED. The loader <strong>the</strong>n copies <strong>the</strong> data from <strong>the</strong> load region to <strong>the</strong> specified<br />
address in RAM. ABSOLUTE is <strong>the</strong> default attribute.<br />
• To place a data structure at <strong>the</strong> location of memory-mapped I/O, use two load regions and<br />
specify UNINIT. UNINIT ensures that <strong>the</strong> memory locations are not initialized to zero.<br />
Concepts<br />
<strong>Linker</strong> Reference:<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 />
<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 8-17<br />
ID080411 Non-Confidential