AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel
AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel
AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel
- TAGS
- linker
- scripts
- atmel
- www.atmel.com
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
32158A-<strong>AVR</strong>-01/11<br />
}<br />
INTRAM_ALIGN PT_NULL;<br />
INTRAM_AT_FLASH PT_LOAD;<br />
INTRAM PT_NULL;<br />
USERPAGE PT_LOAD;<br />
<str<strong>on</strong>g><strong>AVR</strong>32795</str<strong>on</strong>g><br />
To place an output secti<strong>on</strong> in a particular segment, use <str<strong>on</strong>g>the</str<strong>on</strong>g> :phdr output secti<strong>on</strong><br />
attribute.<br />
When <str<strong>on</strong>g>the</str<strong>on</strong>g> executable is programmed to target, <strong>on</strong>ly <str<strong>on</strong>g>the</str<strong>on</strong>g> loadable segments should be<br />
programmed.<br />
NOTE There are types o<str<strong>on</strong>g>the</str<strong>on</strong>g>r than PT_LOAD and PT_NULL (refer to <str<strong>on</strong>g>the</str<strong>on</strong>g> GCC linker scripts<br />
documentati<strong>on</strong> for details).<br />
5.3 SECTIONS command<br />
5.3.1 Symbol assignment<br />
Tells <str<strong>on</strong>g>the</str<strong>on</strong>g> linker how to map input secti<strong>on</strong>s into output secti<strong>on</strong>s, and how to place <str<strong>on</strong>g>the</str<strong>on</strong>g><br />
output secti<strong>on</strong>s in memory.<br />
SECTIONS<br />
{<br />
secti<strong>on</strong>s-command<br />
secti<strong>on</strong>s-command<br />
...<br />
}<br />
Each SECTIONS command may be <strong>on</strong>e of <str<strong>on</strong>g>the</str<strong>on</strong>g> following:<br />
• an ENTRY command<br />
• a symbol assignment<br />
• an output secti<strong>on</strong> descripti<strong>on</strong><br />
• an overlay descripti<strong>on</strong><br />
A value can be assigned to a symbol. This will define <str<strong>on</strong>g>the</str<strong>on</strong>g> symbol as a global symbol.<br />
Example 1:<br />
/* Use a default stack size if stack size was not defined. */<br />
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;<br />
Example 2:<br />
PROVIDE (__executable_start = 0x80000000);<br />
. = 0x80000000;<br />
NOTE The special symbol “.” is <str<strong>on</strong>g>the</str<strong>on</strong>g> locati<strong>on</strong> counter.<br />
Indicates an unused (for loading) program header<br />
Indicates an unused (for loading) program header<br />
7