You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

213 lines
8.5KB

  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-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title>size (GNU Binary Utilities)</title>
  15. <meta name="description" content="size (GNU Binary Utilities)">
  16. <meta name="keywords" content="size (GNU Binary Utilities)">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  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.indentedblock {margin-right: 0em}
  30. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {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.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.nolinebreak {white-space: nowrap}
  48. span.roman {font-family: initial; font-weight: normal}
  49. span.sansserif {font-family: sans-serif; font-weight: normal}
  50. ul.no-bullet {list-style: none}
  51. -->
  52. </style>
  53. </head>
  54. <body lang="en">
  55. <a name="size"></a>
  56. <div class="header">
  57. <p>
  58. 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>
  59. </div>
  60. <hr>
  61. <a name="size-1"></a>
  62. <h2 class="chapter">6 size</h2>
  63. <a name="index-size"></a>
  64. <a name="index-section-sizes"></a>
  65. <div class="smallexample">
  66. <pre class="smallexample">size [<samp>-A</samp>|<samp>-B</samp>|<samp>-G</samp>|<samp>--format=</samp><var>compatibility</var>]
  67. [<samp>--help</samp>]
  68. [<samp>-d</samp>|<samp>-o</samp>|<samp>-x</samp>|<samp>--radix=</samp><var>number</var>]
  69. [<samp>--common</samp>]
  70. [<samp>-t</samp>|<samp>--totals</samp>]
  71. [<samp>--target=</samp><var>bfdname</var>] [<samp>-V</samp>|<samp>--version</samp>]
  72. [<var>objfile</var>&hellip;]
  73. </pre></div>
  74. <p>The <small>GNU</small> <code>size</code> utility lists the section sizes and the total
  75. size for each of the binary files <var>objfile</var> on its argument list.
  76. By default, one line of output is generated for each file or each
  77. module if the file is an archive.
  78. </p>
  79. <p><var>objfile</var>&hellip; are the files to be examined. If none are
  80. specified, the file <code>a.out</code> will be used instead.
  81. </p>
  82. <p>The command-line options have the following meanings:
  83. </p>
  84. <dl compact="compact">
  85. <dt><code>-A</code></dt>
  86. <dt><code>-B</code></dt>
  87. <dt><code>-G</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. Alternatively, you can choose the GNU format output
  95. (using <samp>-G</samp>, or <samp>--format=gnu</samp>), this is similar to
  96. Berkeley&rsquo;s output format, but sizes are counted differently.
  97. </p>
  98. <p>Here is an example of the Berkeley (default) format of output from
  99. <code>size</code>:
  100. </p><div class="smallexample">
  101. <pre class="smallexample">$ size --format=Berkeley ranlib size
  102. text data bss dec hex filename
  103. 294880 81920 11592 388392 5ed28 ranlib
  104. 294880 81920 11888 388688 5ee50 size
  105. </pre></div>
  106. <p>The Berkeley style output counts read only data in the <code>text</code>
  107. column, not in the <code>data</code> column, the <code>dec</code> and <code>hex</code>
  108. columns both display the sum of the <code>text</code>, <code>data</code>, and
  109. <code>bss</code> columns in decimal and hexadecimal respectively.
  110. </p>
  111. <p>The GNU format counts read only data in the <code>data</code> column, not
  112. the <code>text</code> column, and only displays the sum of the <code>text</code>,
  113. <code>data</code>, and <code>bss</code> columns once, in the <code>total</code> column.
  114. The <samp>--radix</samp> option can be used to change the number base for
  115. all columns. Here is the same data displayed with GNU conventions:
  116. </p>
  117. <div class="smallexample">
  118. <pre class="smallexample">$ size --format=GNU ranlib size
  119. text data bss total filename
  120. 279880 96920 11592 388392 ranlib
  121. 279880 96920 11888 388688 size
  122. </pre></div>
  123. <p>This is the same data, but displayed closer to System V conventions:
  124. </p>
  125. <div class="smallexample">
  126. <pre class="smallexample">$ size --format=SysV ranlib size
  127. ranlib :
  128. section size addr
  129. .text 294880 8192
  130. .data 81920 303104
  131. .bss 11592 385024
  132. Total 388392
  133. size :
  134. section size addr
  135. .text 294880 8192
  136. .data 81920 303104
  137. .bss 11888 385024
  138. Total 388688
  139. </pre></div>
  140. </dd>
  141. <dt><code>--help</code></dt>
  142. <dd><p>Show a summary of acceptable arguments and options.
  143. </p>
  144. </dd>
  145. <dt><code>-d</code></dt>
  146. <dt><code>-o</code></dt>
  147. <dt><code>-x</code></dt>
  148. <dt><code>--radix=<var>number</var></code></dt>
  149. <dd><a name="index-size-number-format"></a>
  150. <a name="index-radix-for-section-sizes"></a>
  151. <p>Using one of these options, you can control whether the size of each
  152. section is given in decimal (<samp>-d</samp>, or <samp>--radix=10</samp>); octal
  153. (<samp>-o</samp>, or <samp>--radix=8</samp>); or hexadecimal (<samp>-x</samp>, or
  154. <samp>--radix=16</samp>). In <samp>--radix=<var>number</var></samp>, only the three
  155. values (8, 10, 16) are supported. The total size is always given in two
  156. radices; decimal and hexadecimal for <samp>-d</samp> or <samp>-x</samp> output, or
  157. octal and hexadecimal if you&rsquo;re using <samp>-o</samp>.
  158. </p>
  159. </dd>
  160. <dt><code>--common</code></dt>
  161. <dd><p>Print total size of common symbols in each file. When using Berkeley
  162. or GNU format these are included in the bss size.
  163. </p>
  164. </dd>
  165. <dt><code>-t</code></dt>
  166. <dt><code>--totals</code></dt>
  167. <dd><p>Show totals of all objects listed (Berkeley or GNU format mode only).
  168. </p>
  169. </dd>
  170. <dt><code>--target=<var>bfdname</var></code></dt>
  171. <dd><a name="index-object-code-format-2"></a>
  172. <p>Specify that the object-code format for <var>objfile</var> is
  173. <var>bfdname</var>. This option may not be necessary; <code>size</code> can
  174. automatically recognize many formats.
  175. See <a href="Target-Selection.html#Target-Selection">Target Selection</a>, for more information.
  176. </p>
  177. </dd>
  178. <dt><code>-V</code></dt>
  179. <dt><code>--version</code></dt>
  180. <dd><p>Display the version number of <code>size</code>.
  181. </p></dd>
  182. </dl>
  183. <hr>
  184. <div class="header">
  185. <p>
  186. 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>
  187. </div>
  188. </body>
  189. </html>