Invoking.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU Assembler "as".
  4. Copyright (C) 1991-2017 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <title>Using as: Invoking</title>
  15. <meta name="description" content="Using as: Invoking">
  16. <meta name="keywords" content="Using as: Invoking">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="index.html#Top" rel="up" title="Top">
  25. <link href="a.html#a" rel="next" title="a">
  26. <link href="Errors.html#Errors" rel="prev" title="Errors">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.smallquotation {font-size: smaller}
  31. div.display {margin-left: 3.2em}
  32. div.example {margin-left: 3.2em}
  33. div.indentedblock {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style:oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nocodebreak {white-space:nowrap}
  49. span.nolinebreak {white-space:nowrap}
  50. span.roman {font-family:serif; font-weight:normal}
  51. span.sansserif {font-family:sans-serif; font-weight:normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  57. <a name="Invoking"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Syntax.html#Syntax" accesskey="n" rel="next">Syntax</a>, Previous: <a href="Overview.html#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  61. </div>
  62. <hr>
  63. <a name="Command_002dLine-Options"></a>
  64. <h2 class="chapter">2 Command-Line Options</h2>
  65. <a name="index-options_002c-all-versions-of-assembler"></a>
  66. <p>This chapter describes command-line options available in <em>all</em>
  67. versions of the <small>GNU</small> assembler; see <a href="Machine-Dependencies.html#Machine-Dependencies">Machine Dependencies</a>,
  68. for options specific
  69. to particular machine architectures.
  70. </p>
  71. <p>If you are invoking <code>as</code> via the <small>GNU</small> C compiler,
  72. you can use the &lsquo;<samp>-Wa</samp>&rsquo; option to pass arguments through to the assembler.
  73. The assembler arguments must be separated from each other (and the &lsquo;<samp>-Wa</samp>&rsquo;)
  74. by commas. For example:
  75. </p>
  76. <div class="smallexample">
  77. <pre class="smallexample">gcc -c -g -O -Wa,-alh,-L file.c
  78. </pre></div>
  79. <p>This passes two options to the assembler: &lsquo;<samp>-alh</samp>&rsquo; (emit a listing to
  80. standard output with high-level and assembly source) and &lsquo;<samp>-L</samp>&rsquo; (retain
  81. local symbols in the symbol table).
  82. </p>
  83. <p>Usually you do not need to use this &lsquo;<samp>-Wa</samp>&rsquo; mechanism, since many compiler
  84. command-line options are automatically passed to the assembler by the compiler.
  85. (You can call the <small>GNU</small> compiler driver with the &lsquo;<samp>-v</samp>&rsquo; option to see
  86. precisely what options it passes to each compilation pass, including the
  87. assembler.)
  88. </p>
  89. <table class="menu" border="0" cellspacing="0">
  90. <tr><td align="left" valign="top">&bull; <a href="a.html#a" accesskey="1">a</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-a[cdghlns] enable listings
  91. </td></tr>
  92. <tr><td align="left" valign="top">&bull; <a href="alternate.html#alternate" accesskey="2">alternate</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">&ndash;alternate enable alternate macro syntax
  93. </td></tr>
  94. <tr><td align="left" valign="top">&bull; <a href="D.html#D" accesskey="3">D</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-D for compatibility
  95. </td></tr>
  96. <tr><td align="left" valign="top">&bull; <a href="f.html#f" accesskey="4">f</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-f to work faster
  97. </td></tr>
  98. <tr><td align="left" valign="top">&bull; <a href="I.html#I" accesskey="5">I</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-I for .include search path
  99. </td></tr>
  100. <tr><td align="left" valign="top">&bull; <a href="K.html#K" accesskey="6">K</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-K for difference tables
  101. </td></tr>
  102. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  103. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="L.html#L" accesskey="7">L</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-L to retain local symbols
  104. </td></tr>
  105. <tr><td align="left" valign="top">&bull; <a href="listing.html#listing" accesskey="8">listing</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">&ndash;listing-XXX to configure listing output
  106. </td></tr>
  107. <tr><td align="left" valign="top">&bull; <a href="M.html#M" accesskey="9">M</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-M or &ndash;mri to assemble in MRI compatibility mode
  108. </td></tr>
  109. <tr><td align="left" valign="top">&bull; <a href="MD.html#MD">MD</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">&ndash;MD for dependency tracking
  110. </td></tr>
  111. <tr><td align="left" valign="top">&bull; <a href="no_002dpad_002dsections.html#no_002dpad_002dsections">no-pad-sections</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">&ndash;no-pad-sections to stop section padding
  112. </td></tr>
  113. <tr><td align="left" valign="top">&bull; <a href="o.html#o">o</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-o to name the object file
  114. </td></tr>
  115. <tr><td align="left" valign="top">&bull; <a href="R.html#R">R</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-R to join data and text sections
  116. </td></tr>
  117. <tr><td align="left" valign="top">&bull; <a href="statistics.html#statistics">statistics</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">&ndash;statistics to see statistics about assembly
  118. </td></tr>
  119. <tr><td align="left" valign="top">&bull; <a href="traditional_002dformat.html#traditional_002dformat">traditional-format</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">&ndash;traditional-format for compatible output
  120. </td></tr>
  121. <tr><td align="left" valign="top">&bull; <a href="v.html#v">v</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-v to announce version
  122. </td></tr>
  123. <tr><td align="left" valign="top">&bull; <a href="W.html#W">W</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-W, &ndash;no-warn, &ndash;warn, &ndash;fatal-warnings to control warnings
  124. </td></tr>
  125. <tr><td align="left" valign="top">&bull; <a href="Z.html#Z">Z</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">-Z to make object file even after errors
  126. </td></tr>
  127. </table>
  128. <hr>
  129. <div class="header">
  130. <p>
  131. Next: <a href="Syntax.html#Syntax" accesskey="n" rel="next">Syntax</a>, Previous: <a href="Overview.html#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  132. </div>
  133. </body>
  134. </html>