Datasheet

C and C++ Compilers
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-17
2.3.6 Specifying output format
By default, source files are compiled and linked into an executable image.
Use the following options to direct the compiler to create unlinked object files,
assembly language files, or listing files from C or C++ source files.
-asm
This option writes a listing of the assembly language generated by the
compiler to a file. Object code is generated and, unless the
-c
option is
also used, the link step is performed.
If used with
-fs
, the source code is interleaved with the assembly listing
and output to a
.txt
file.
The output file names depend on the options used:
-asm
inputname.s
is used for the resulting listing.
-asm -fs
inputname.txt
is used because the resulting interleaved code
cannot be input to the assembler. See the
-fs
option below.
-asm -c -o newname.ext
There are two output files (usually
newname.o
for object code
and
newname.s
for assembly). If
.ext
is not
.s
or
.o
,
newname.ext
is the name of the object file and
newname.s
is the
name of the listing file.
-asm -fs -c -o newname.ext
Gives the same output as
-asm -c -o newname.ext
, except that
the listing file has interleaved source code and a
.txt
extension.
-c
This option compiles but does not perform the link step. The compiler
compiles the source program and writes the object files to either the
current directory or the file specified by the
-o
option. This option is
different from the uppercase
-C
option, described in Setting preprocessor
options on page 2-15. (The
-C
option retains comments in preprocessor
output.)
-list
This option creates a listing file consisting of lines of source interleaved
with error and warning messages. The options
-fi
,
-fj
, and
-fu
can be
used to control the contents of this file.
Caution
The
-list
option does not accept a pathname for the output file. You must
rename previous versions of list files if you do not want to overwrite
them.