blob: 19319f7048ca20c261be13b5359b6c1c56344463 [file] [log] [blame]
<html lang="en">
<head>
<title>Invoking - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Overview.html#Overview" title="Overview">
<link rel="next" href="Syntax.html#Syntax" title="Syntax">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Invoking"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Syntax.html#Syntax">Syntax</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Overview.html#Overview">Overview</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">2 Command-Line Options</h2>
<p><a name="index-options_002c-all-versions-of-assembler-46"></a>This chapter describes command-line options available in <em>all</em>
versions of the <span class="sc">gnu</span> assembler; see <a href="Machine-Dependencies.html#Machine-Dependencies">Machine Dependencies</a>,
for options specific
to particular machine architectures.
<!-- man begin DESCRIPTION -->
<p>If you are invoking <samp><span class="command">as</span></samp> via the <span class="sc">gnu</span> C compiler,
you can use the &lsquo;<samp><span class="samp">-Wa</span></samp>&rsquo; option to pass arguments through to the assembler.
The assembler arguments must be separated from each other (and the &lsquo;<samp><span class="samp">-Wa</span></samp>&rsquo;)
by commas. For example:
<pre class="smallexample"> gcc -c -g -O -Wa,-alh,-L file.c
</pre>
<p class="noindent">This passes two options to the assembler: &lsquo;<samp><span class="samp">-alh</span></samp>&rsquo; (emit a listing to
standard output with high-level and assembly source) and &lsquo;<samp><span class="samp">-L</span></samp>&rsquo; (retain
local symbols in the symbol table).
<p>Usually you do not need to use this &lsquo;<samp><span class="samp">-Wa</span></samp>&rsquo; mechanism, since many compiler
command-line options are automatically passed to the assembler by the compiler.
(You can call the <span class="sc">gnu</span> compiler driver with the &lsquo;<samp><span class="samp">-v</span></samp>&rsquo; option to see
precisely what options it passes to each compilation pass, including the
assembler.)
<!-- man end -->
<ul class="menu">
<li><a accesskey="1" href="a.html#a">a</a>: -a[cdghlns] enable listings
<li><a accesskey="2" href="alternate.html#alternate">alternate</a>: --alternate enable alternate macro syntax
<li><a accesskey="3" href="D.html#D">D</a>: -D for compatibility
<li><a accesskey="4" href="f.html#f">f</a>: -f to work faster
<li><a accesskey="5" href="I.html#I">I</a>: -I for .include search path
<li><a accesskey="6" href="K.html#K">K</a>: -K for difference tables
<li><a accesskey="7" href="L.html#L">L</a>: -L to retain local symbols
<li><a accesskey="8" href="listing.html#listing">listing</a>: --listing-XXX to configure listing output
<li><a accesskey="9" href="M.html#M">M</a>: -M or --mri to assemble in MRI compatibility mode
<li><a href="MD.html#MD">MD</a>: --MD for dependency tracking
<li><a href="o.html#o">o</a>: -o to name the object file
<li><a href="R.html#R">R</a>: -R to join data and text sections
<li><a href="statistics.html#statistics">statistics</a>: --statistics to see statistics about assembly
<li><a href="traditional_002dformat.html#traditional_002dformat">traditional-format</a>: --traditional-format for compatible output
<li><a href="v.html#v">v</a>: -v to announce version
<li><a href="W.html#W">W</a>: -W, --no-warn, --warn, --fatal-warnings to control warnings
<li><a href="Z.html#Z">Z</a>: -Z to make object file even after errors
</ul>
</body></html>