Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
50
Verifying the linked result of code and data placement
AVR® IAR C/C++ Compiler
Reference Guide
A typical situation where this can be useful is if you need to optimize accesses to code 
and data that is frequently used, and place it in a different physical memory. 
To use your own segments, use the 
#pragma location
 directive, or the 
--segment
 
option.
If you use your own segments, these must also be defined in the linker command file 
using the 
-Z
 or the 
-P
 segment control directives.
Verifying the linked result of code and data placement
The linker has several features that help you to manage code and data placement, for 
example, messages at link time and the linker map file.
SEGMENT TOO LONG ERRORS AND RANGE ERRORS
All code and data that is placed in relocatable segments will have its absolute addresses 
resolved at link time. It is also at link time it is known whether all segments will fit in 
the reserved memory ranges. If the contents of a segment do not fit in the address range 
defined in the linker command file, XLINK will issue a segment too long error.
Some instructions do not work unless a certain condition holds after linking, for 
example that a branch must be within a certain distance or that an address must be even. 
XLINK verifies that the conditions hold when the files are linked. If a condition is not 
satisfied, XLINK generates a range error or warning and prints a description of the 
error.
For further information about these types of errors, see the IAR Linker and Library Tools 
Reference Guide
.
LINKER MAP FILE
XLINK can produce an extensive cross-reference listing, which can optionally contain 
the following information:
A segment map which lists all segments in dump order
A module map which lists all segments, local symbols, and entries (public symbols) 
for every module in the program. All symbols not included in the output can also be 
listed
Module summary which lists the contribution (in bytes) from each module
A symbol list which contains every entry (global symbol) in every module.
Use the option Generate linker listing in IAR Embedded Workbench, or the option 
-X
 
on the command line, and one of their suboptions to generate a linker listing.