Microchip Technology SW006023-1N Data Sheet

Page of 238
Compiler Command Line Driver
 2012 Microchip Technology Inc.
DS51686E-page 59
If you are using an IDE, such as MPLAB IDE, to specify options to the compiler, there 
is typically a project file that is created for each application. The name of this project is 
used as the base name for project-wide output files, unless otherwise specified by the 
user. However check the manual for the IDE you are using for more details.
The compiler is able to directly produce a number of the output file formats which are 
used by Microchip development tools.
The default behavior of xc32-gcc and xc32-g++ is to produce an ELF output. To make 
changes to the file’s output or the file names, see Section 3.9 “Driver Option 
Descriptions”
.
3.7.2
Diagnostic Files
Two valuable files produced by the compiler are the assembly list file, produced by the 
assembler, and the map file, produced by the linker.
The assembly list file contains the mapping between the original source code and the 
generated assembly code. It is useful for information such as how C source was 
encoded, or how assembly source may have been optimized. It is essential when con-
firming if compiler-produced code that accesses objects is atomic, and shows the 
region in which all objects and code are placed.
The option to create a listing file in the assembler is -a (or -Wa,-a if passed to the 
driver). There are many variants to this option, which may be found in the “MPLAB 
Assembler, Linker and Utilities for PIC32 MCUs User’s Guide”
(DS51833). To pass the 
option from the compiler, see Section 3.9.9 “Options for Assembling”.
There is one list file produced for each build. There is one assembler listing file for each 
translation unit. This is a pre-link assembler listing so it will not show final addresses. 
Thus, if you require a list file for each source file, these files must be compiled sepa-
rately, see Section 3.3.2 “Multi-step C Compilation”. This is the case if you build 
using MPLAB IDE. Each list file will be assigned the module name and extension .lst.
The map file shows information relating to where objects were positioned in memory. It 
is useful for confirming that user-defined linker options were correctly processed, and 
for determining the exact placement of objects and functions.
The option to create a map file in the linker is -Map file (or -Wl,-Map=file if 
passed to the driver), which may be found in the “MPLAB Assembler, Linker and Utili-
ties for PIC32 User’s Guide”
. To pass the option from the compiler, see 
Section 3.9.10 “Options for Linking”.
There is one map file produced when you build a project, assuming the linker was 
executed and ran to completion.
Note:
Throughout this manual, the term project name will refer to the name of the 
project created in the IDE.