Invoking (Using as) (original) (raw)
2 Command-Line Options ¶
This chapter describes command-line options available in _all_versions of the GNU assembler; see Machine Dependent Features, for options specific to particular machine architectures.
If you are invoking as
via the GNU C compiler, you can use the ‘-Wa’ option to pass arguments through to the assembler. The assembler arguments must be separated from each other (and the ‘-Wa’) by commas. For example:
gcc -c -g -O -Wa,-alh,-L file.c
This passes two options to the assembler: ‘-alh’ (emit a listing to standard output with high-level and assembly source) and ‘-L’ (retain local symbols in the symbol table).
Usually you do not need to use this ‘-Wa’ mechanism, since many compiler command-line options are automatically passed to the assembler by the compiler. (You can call the GNU compiler driver with the ‘-v’ option to see precisely what options it passes to each compilation pass, including the assembler.)
- Enable Listings: -a[cdghilns]
- --alternate
- -D
- Work Faster: -f
- Control Informational Messages: --info, --no-info
- .include Search Path: -I path
- Difference Tables: -K
- Include Local Symbols: -L
- Configuring listing output: --listing
- Assemble in MRI Compatibility Mode: -M
- Dependency Tracking: --MD
- Output Section Padding
- Name the Object File: -o
- Join Data and Text Sections: -R
- Display Assembly Statistics: --statistics
- Compatible Output: --traditional-format
- Announce Version: -v
- Control Warnings: -W, --no-warn, --warn, --fatal-warnings
- Generate Object File in Spite of Errors: -Z