1<html lang="en"> 2<head> 3<title>size - GNU Binary Utilities</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="GNU Binary Utilities"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="prev" href="ranlib.html#ranlib" title="ranlib"> 9<link rel="next" href="strings.html#strings" title="strings"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1991-2013 Free Software Foundation, Inc. 13 14Permission is granted to copy, distribute and/or modify this document 15under the terms of the GNU Free Documentation License, Version 1.3 16or any later version published by the Free Software Foundation; 17with no Invariant Sections, with no Front-Cover Texts, and with no 18Back-Cover Texts. A copy of the license is included in the 19section entitled ``GNU Free Documentation License''. 20 21--> 22<meta http-equiv="Content-Style-Type" content="text/css"> 23<style type="text/css"><!-- 24 pre.display { font-family:inherit } 25 pre.format { font-family:inherit } 26 pre.smalldisplay { font-family:inherit; font-size:smaller } 27 pre.smallformat { font-family:inherit; font-size:smaller } 28 pre.smallexample { font-size:smaller } 29 pre.smalllisp { font-size:smaller } 30 span.sc { font-variant:small-caps } 31 span.roman { font-family:serif; font-weight:normal; } 32 span.sansserif { font-family:sans-serif; font-weight:normal; } 33--></style> 34<link rel="stylesheet" type="text/css" href="../cs.css"> 35</head> 36<body> 37<div class="node"> 38<a name="size"></a> 39<p> 40Next: <a rel="next" accesskey="n" href="strings.html#strings">strings</a>, 41Previous: <a rel="previous" accesskey="p" href="ranlib.html#ranlib">ranlib</a>, 42Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> 43<hr> 44</div> 45 46<h2 class="chapter">6 size</h2> 47 48<p><a name="index-size-117"></a><a name="index-section-sizes-118"></a> 49<!-- man title size list section sizes and total size. --> 50 51<pre class="smallexample"> <!-- man begin SYNOPSIS size --> 52 size [<samp><span class="option">-A</span></samp>|<samp><span class="option">-B</span></samp>|<samp><span class="option">--format=</span></samp><var>compatibility</var>] 53 [<samp><span class="option">--help</span></samp>] 54 [<samp><span class="option">-d</span></samp>|<samp><span class="option">-o</span></samp>|<samp><span class="option">-x</span></samp>|<samp><span class="option">--radix=</span></samp><var>number</var>] 55 [<samp><span class="option">--common</span></samp>] 56 [<samp><span class="option">-t</span></samp>|<samp><span class="option">--totals</span></samp>] 57 [<samp><span class="option">--target=</span></samp><var>bfdname</var>] [<samp><span class="option">-V</span></samp>|<samp><span class="option">--version</span></samp>] 58 [<var>objfile</var>...] 59 <!-- man end --> 60</pre> 61 <!-- man begin DESCRIPTION size --> 62 <p>The <span class="sc">gnu</span> <samp><span class="command">size</span></samp> utility lists the section sizes—and the total 63size—for each of the object or archive files <var>objfile</var> in its 64argument list. By default, one line of output is generated for each 65object file or each module in an archive. 66 67 <p><var>objfile</var><small class="dots">...</small> are the object files to be examined. 68If none are specified, the file <code>a.out</code> will be used. 69 70<!-- man end --> 71<!-- man begin OPTIONS size --> 72 <p>The command line options have the following meanings: 73 74 <dl> 75<dt><samp><span class="env">-A</span></samp><dt><samp><span class="env">-B</span></samp><dt><samp><span class="env">--format=</span><var>compatibility</var></samp><dd><a name="index-g_t_0040command_007bsize_007d-display-format-119"></a>Using one of these options, you can choose whether the output from <span class="sc">gnu</span> 76<samp><span class="command">size</span></samp> resembles output from System V <samp><span class="command">size</span></samp> (using <samp><span class="option">-A</span></samp>, 77or <samp><span class="option">--format=sysv</span></samp>), or Berkeley <samp><span class="command">size</span></samp> (using <samp><span class="option">-B</span></samp>, or 78<samp><span class="option">--format=berkeley</span></samp>). The default is the one-line format similar to 79Berkeley's. 80<!-- Bonus for doc-source readers: you can also say -format=strange (or --> 81<!-- anything else that starts with 's') for sysv, and -format=boring (or --> 82<!-- anything else that starts with 'b') for Berkeley. --> 83 84 <p>Here is an example of the Berkeley (default) format of output from 85<samp><span class="command">size</span></samp>: 86 <pre class="smallexample"> $ size --format=Berkeley ranlib size 87 text data bss dec hex filename 88 294880 81920 11592 388392 5ed28 ranlib 89 294880 81920 11888 388688 5ee50 size 90</pre> 91 <p class="noindent">This is the same data, but displayed closer to System V conventions: 92 93 <pre class="smallexample"> $ size --format=SysV ranlib size 94 ranlib : 95 section size addr 96 .text 294880 8192 97 .data 81920 303104 98 .bss 11592 385024 99 Total 388392 100 101 102 size : 103 section size addr 104 .text 294880 8192 105 .data 81920 303104 106 .bss 11888 385024 107 Total 388688 108</pre> 109 <br><dt><samp><span class="env">--help</span></samp><dd>Show a summary of acceptable arguments and options. 110 111 <br><dt><samp><span class="env">-d</span></samp><dt><samp><span class="env">-o</span></samp><dt><samp><span class="env">-x</span></samp><dt><samp><span class="env">--radix=</span><var>number</var></samp><dd><a name="index-g_t_0040command_007bsize_007d-number-format-120"></a><a name="index-radix-for-section-sizes-121"></a>Using one of these options, you can control whether the size of each 112section is given in decimal (<samp><span class="option">-d</span></samp>, or <samp><span class="option">--radix=10</span></samp>); octal 113(<samp><span class="option">-o</span></samp>, or <samp><span class="option">--radix=8</span></samp>); or hexadecimal (<samp><span class="option">-x</span></samp>, or 114<samp><span class="option">--radix=16</span></samp>). In <samp><span class="option">--radix=</span><var>number</var></samp>, only the three 115values (8, 10, 16) are supported. The total size is always given in two 116radices; decimal and hexadecimal for <samp><span class="option">-d</span></samp> or <samp><span class="option">-x</span></samp> output, or 117octal and hexadecimal if you're using <samp><span class="option">-o</span></samp>. 118 119 <br><dt><samp><span class="env">--common</span></samp><dd>Print total size of common symbols in each file. When using Berkeley 120format these are included in the bss size. 121 122 <br><dt><samp><span class="env">-t</span></samp><dt><samp><span class="env">--totals</span></samp><dd>Show totals of all objects listed (Berkeley format listing mode only). 123 124 <br><dt><samp><span class="env">--target=</span><var>bfdname</var></samp><dd><a name="index-object-code-format-122"></a>Specify that the object-code format for <var>objfile</var> is 125<var>bfdname</var>. This option may not be necessary; <samp><span class="command">size</span></samp> can 126automatically recognize many formats. 127See <a href="Target-Selection.html#Target-Selection">Target Selection</a>, for more information. 128 129 <br><dt><samp><span class="env">-V</span></samp><dt><samp><span class="env">--version</span></samp><dd>Display the version number of <samp><span class="command">size</span></samp>. 130</dl> 131 132<!-- man end --> 133 </body></html> 134 135