Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
Compiler Command-Line Driver
2012-2013 Microchip Technology Inc. DS50002071C-page 81
5.5 COMPILER OUTPUT
There are many files created by the compiler during the compilation. A large number of
these are intermediate files are deleted after compilation is complete, but many remain
and are used for programming the device or for debugging purposes.
5.5.1 Output Files
The compilation driver can produce output files with the following extensions, which are
case-sensitive.
The names of many output files use the same base name as the source file from which
they were derived. For example the source file input.c will create an object file called
input.o when the -c option is used.
The default output file is a ELF file called a.out, unless you override that name using
the -o option.
If you are using MPLAB X IDE or MPLAB IDE v8 to specify options to the compiler,
there is typically a project file that is created for each application. The name of this proj-
ect 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 xc16-gcc is to produce a ELF output. To make changes to the
files output or the file names, see Section 5.7 Driver Option Descriptions.
5.5.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. There are many variants to this
option, which may be found in the MPLAB XC16 Assembler, Linker and Utilities Users
Guide (DS52106). To pass the option from the compiler, see Section 5.7.8 Options
for Assembling.
TABLE 5-4: FILE NAMES
Extensions Definition
file.hex Executable file
file.cof COF debug file (default)
file.elf ELF debug file
file.o Object file (intermediate file)
file.S Assembly code file (required preprocessing)
file.s Assembly code file (intermediate file)
file.i Preprocessed file (intermediate file)
file.p Preprocedure abstraction assembly language file (intermediate file)
file.map Map file
Note: Throughout this manual, the term project name will refer to the name of the
project created in the IDE.
Protego_Release_01_05-Related-OEM-Documentation-MPLAB-XC16-C-Compiler.pdf