Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 286
 2012 Microchip Technology Inc.
7.4
MAP FILES
The map file contains information relating to the relocation of psects and the addresses 
assigned to symbols within those psects.
7.4.1
Generation
If compilation is being performed via an IDE such as HI-TIDE or MPLAB IDE, a map 
file is generated by default without you having to adjust the compiler options. If you are 
using the driver from the command line then you’ll need to use the -M option to request 
that the map file be produced, see Section 7.2.16 “-Mmapfile”. Map files use the 
extension .map.
Map files are produced by the linker. If the compilation process is stopped before the 
linker is executed, then no map file is produced. The linker will still produce a map file 
even if it encounters errors, which will allow you to use this file to track down the cause 
of the errors. However, if the linker ultimately reports too many errors then it did 
not run to completion, and the map file will be either not created or not complete. You 
can use the --ERRORS option (see Section 4.8.29 “--ERRORS: Maximum Number 
of Errors”
) on the command line to increase the number of errors before the linker 
exits.
7.4.2
Contents
The sections in the map file, in order of appearance, are as follows.
• The compiler name and version number
• A copy of the command line used to invoke the linker
• The version number of the object code in the first file linked
• The machine type
• A psect summary sorted by the psect’s parent object file
• A psect summary sorted by the psect’s CLASS
• A segment summary
• Unused address ranges summary
• The symbol table
Portions of an example map file, along with explanatory text, are shown in the following 
sections.
7.4.2.1
GENERAL INFORMATION
At the top of the map file is general information relating to the execution of the linker.
When analyzing a program, always confirm the compiler version number shown in the 
map file if you have more than one compiler version installed to ensure the desired 
compiler is being executed.
The device selected with the --CHIP option (Section 4.8.20 “--CHIP: Define 
Device”
) or that select in your IDE, should appear after the Machine type entry.
The object code version relates to the file format used by relocatable object files pro-
duced by the assembler. Unless either the assembler or linker have been updated inde-
pendently, this should not be of concern.