size.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1991-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3
  6. or any later version published by the Free Software Foundation;
  7. with no Invariant Sections, with no Front-Cover Texts, and with no
  8. Back-Cover Texts. A copy of the license is included in the
  9. section entitled "GNU Free Documentation License".
  10. -->
  11. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  12. <head>
  13. <title>GNU Binary Utilities: size</title>
  14. <meta name="description" content="GNU Binary Utilities: size">
  15. <meta name="keywords" content="GNU Binary Utilities: size">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="makeinfo">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <link href="index.html#Top" rel="start" title="Top">
  21. <link href="Binutils-Index.html#Binutils-Index" rel="index" title="Binutils Index">
  22. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  23. <link href="index.html#Top" rel="up" title="Top">
  24. <link href="strings.html#strings" rel="next" title="strings">
  25. <link href="ranlib.html#ranlib" rel="prev" title="ranlib">
  26. <style type="text/css">
  27. <!--
  28. a.summary-letter {text-decoration: none}
  29. blockquote.smallquotation {font-size: smaller}
  30. div.display {margin-left: 3.2em}
  31. div.example {margin-left: 3.2em}
  32. div.indentedblock {margin-left: 3.2em}
  33. div.lisp {margin-left: 3.2em}
  34. div.smalldisplay {margin-left: 3.2em}
  35. div.smallexample {margin-left: 3.2em}
  36. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  37. div.smalllisp {margin-left: 3.2em}
  38. kbd {font-style:oblique}
  39. pre.display {font-family: inherit}
  40. pre.format {font-family: inherit}
  41. pre.menu-comment {font-family: serif}
  42. pre.menu-preformatted {font-family: serif}
  43. pre.smalldisplay {font-family: inherit; font-size: smaller}
  44. pre.smallexample {font-size: smaller}
  45. pre.smallformat {font-family: inherit; font-size: smaller}
  46. pre.smalllisp {font-size: smaller}
  47. span.nocodebreak {white-space:nowrap}
  48. span.nolinebreak {white-space:nowrap}
  49. span.roman {font-family:serif; font-weight:normal}
  50. span.sansserif {font-family:sans-serif; font-weight:normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  56. <a name="size"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="strings.html#strings" accesskey="n" rel="next">strings</a>, Previous: <a href="ranlib.html#ranlib" accesskey="p" rel="prev">ranlib</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="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="size-1"></a>
  63. <h2 class="chapter">6 size</h2>
  64. <a name="index-size"></a>
  65. <a name="index-section-sizes"></a>
  66. <div class="smallexample">
  67. <pre class="smallexample">size [<samp>-A</samp>|<samp>-B</samp>|<samp>--format=</samp><var>compatibility</var>]
  68. [<samp>--help</samp>]
  69. [<samp>-d</samp>|<samp>-o</samp>|<samp>-x</samp>|<samp>--radix=</samp><var>number</var>]
  70. [<samp>--common</samp>]
  71. [<samp>-t</samp>|<samp>--totals</samp>]
  72. [<samp>--target=</samp><var>bfdname</var>] [<samp>-V</samp>|<samp>--version</samp>]
  73. [<var>objfile</var>&hellip;]
  74. </pre></div>
  75. <p>The <small>GNU</small> <code>size</code> utility lists the section sizes&mdash;and the total
  76. size&mdash;for each of the object or archive files <var>objfile</var> in its
  77. argument list. By default, one line of output is generated for each
  78. object file or each module in an archive.
  79. </p>
  80. <p><var>objfile</var>&hellip; are the object files to be examined.
  81. If none are specified, the file <code>a.out</code> will be used.
  82. </p>
  83. <p>The command line options have the following meanings:
  84. </p>
  85. <dl compact="compact">
  86. <dt><code>-A</code></dt>
  87. <dt><code>-B</code></dt>
  88. <dt><code>--format=<var>compatibility</var></code></dt>
  89. <dd><a name="index-size-display-format"></a>
  90. <p>Using one of these options, you can choose whether the output from <small>GNU</small>
  91. <code>size</code> resembles output from System V <code>size</code> (using <samp>-A</samp>,
  92. or <samp>--format=sysv</samp>), or Berkeley <code>size</code> (using <samp>-B</samp>, or
  93. <samp>--format=berkeley</samp>). The default is the one-line format similar to
  94. Berkeley&rsquo;s.
  95. </p>
  96. <p>Here is an example of the Berkeley (default) format of output from
  97. <code>size</code>:
  98. </p><div class="smallexample">
  99. <pre class="smallexample">$ size --format=Berkeley ranlib size
  100. text data bss dec hex filename
  101. 294880 81920 11592 388392 5ed28 ranlib
  102. 294880 81920 11888 388688 5ee50 size
  103. </pre></div>
  104. <p>This is the same data, but displayed closer to System V conventions:
  105. </p>
  106. <div class="smallexample">
  107. <pre class="smallexample">$ size --format=SysV ranlib size
  108. ranlib :
  109. section size addr
  110. .text 294880 8192
  111. .data 81920 303104
  112. .bss 11592 385024
  113. Total 388392
  114. size :
  115. section size addr
  116. .text 294880 8192
  117. .data 81920 303104
  118. .bss 11888 385024
  119. Total 388688
  120. </pre></div>
  121. </dd>
  122. <dt><code>--help</code></dt>
  123. <dd><p>Show a summary of acceptable arguments and options.
  124. </p>
  125. </dd>
  126. <dt><code>-d</code></dt>
  127. <dt><code>-o</code></dt>
  128. <dt><code>-x</code></dt>
  129. <dt><code>--radix=<var>number</var></code></dt>
  130. <dd><a name="index-size-number-format"></a>
  131. <a name="index-radix-for-section-sizes"></a>
  132. <p>Using one of these options, you can control whether the size of each
  133. section is given in decimal (<samp>-d</samp>, or <samp>--radix=10</samp>); octal
  134. (<samp>-o</samp>, or <samp>--radix=8</samp>); or hexadecimal (<samp>-x</samp>, or
  135. <samp>--radix=16</samp>). In <samp>--radix=<var>number</var></samp>, only the three
  136. values (8, 10, 16) are supported. The total size is always given in two
  137. radices; decimal and hexadecimal for <samp>-d</samp> or <samp>-x</samp> output, or
  138. octal and hexadecimal if you&rsquo;re using <samp>-o</samp>.
  139. </p>
  140. </dd>
  141. <dt><code>--common</code></dt>
  142. <dd><p>Print total size of common symbols in each file. When using Berkeley
  143. format these are included in the bss size.
  144. </p>
  145. </dd>
  146. <dt><code>-t</code></dt>
  147. <dt><code>--totals</code></dt>
  148. <dd><p>Show totals of all objects listed (Berkeley format listing mode only).
  149. </p>
  150. </dd>
  151. <dt><code>--target=<var>bfdname</var></code></dt>
  152. <dd><a name="index-object-code-format-2"></a>
  153. <p>Specify that the object-code format for <var>objfile</var> is
  154. <var>bfdname</var>. This option may not be necessary; <code>size</code> can
  155. automatically recognize many formats.
  156. See <a href="Target-Selection.html#Target-Selection">Target Selection</a>, for more information.
  157. </p>
  158. </dd>
  159. <dt><code>-V</code></dt>
  160. <dt><code>--version</code></dt>
  161. <dd><p>Display the version number of <code>size</code>.
  162. </p></dd>
  163. </dl>
  164. <hr>
  165. <div class="header">
  166. <p>
  167. Next: <a href="strings.html#strings" accesskey="n" rel="next">strings</a>, Previous: <a href="ranlib.html#ranlib" accesskey="p" rel="prev">ranlib</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="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  168. </div>
  169. </body>
  170. </html>