2.1.86. -o filename

This option specifies the name of the output file. The full name of the output file produced depends on the combination of options used, as described in Table 2.4 and Table 2.5.

Syntax

If you specify a -o option, the compiler names the output file according to the conventions of Table 2.4.

Table 2.4. Compiling with the -o option

Compiler optionActionUsage notes
-o-writes output to the standard output streamfilename is -. -S is assumed unless -E is specified.
-o filenameproduces an executable image with name filename 
-c -o filenameproduces an object file with name filename 
-S -o filenameproduces an assembly language file with name filename 
-E -o filenameproduces a file containing preprocessor output with name filename 

If you do not specify a -o option, the compiler names the output file according to the conventions of Table 2.5.

Table 2.5. Compiling without the -o option

Compiler optionActionUsage notes
-cproduces an object file whose name defaults to the name of the input file with the filename extension .o 
-Sproduces an output file whose name defaults to the name of the input file with the filename extension .s 
-Ewrites output from the preprocessor to the standard output stream 
(No option)produces an executable image with the default name of __image.axfnone of -o, -c, -E or -S is specified on the command line

Note

This option overrides the --default_extension option.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential