Debian Codegraph @

upstream/debian-unstable/man1/size.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SIZE 1"
58 .TH SIZE 1 2026-03-05 binutils-2.46 "GNU Development Tools"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 size \- list section sizes and total size of binary files
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 size [\fB\-A\fR|\fB\-B\fR|\fB\-G\fR|\fB\-\-format=\fR\fIcompatibility\fR]
68 [\fB\-\-help\fR]
69 [\fB\-d\fR|\fB\-o\fR|\fB\-x\fR|\fB\-\-radix=\fR\fInumber\fR]
70 [\fB\-\-common\fR]
71 [\fB\-t\fR|\fB\-\-totals\fR]
72 [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-V\fR|\fB\-\-version\fR]
73 [\fB\-f\fR]
74 [\fIobjfile\fR...]
75 .SH DESCRIPTION
76 .IX Header "DESCRIPTION"
77 The GNU \fBsize\fR utility lists the section sizes and the total
78 size for each of the binary files \fIobjfile\fR on its argument list.
79 By default, one line of output is generated for each file or each
80 module if the file is an archive.
81 .PP
82 \&\fIobjfile\fR... are the files to be examined. If none are
83 specified, the file \f(CW\*(C`a.out\*(C'\fR will be used instead.
84 .SH OPTIONS
85 .IX Header "OPTIONS"
86 The command-line options have the following meanings:
87 .IP \fB\-A\fR 4
88 .IX Item "-A"
89 .PD 0
90 .IP \fB\-B\fR 4
91 .IX Item "-B"
92 .IP \fB\-G\fR 4
93 .IX Item "-G"
94 .IP \fB\-\-format=\fR\fIcompatibility\fR 4
95 .IX Item "--format=compatibility"
96 .PD
97 Using one of these options, you can choose whether the output from GNU
98 \&\fBsize\fR resembles output from System V \fBsize\fR (using \fB\-A\fR,
99 or \fB\-\-format=sysv\fR), or Berkeley \fBsize\fR (using \fB\-B\fR, or
100 \&\fB\-\-format=berkeley\fR). The default is the one-line format similar to
101 Berkeley's. Alternatively, you can choose the GNU format output
102 (using \fB\-G\fR, or \fB\-\-format=gnu\fR), this is similar to
103 Berkeley's output format, but sizes are counted differently.
104 .Sp
105 Here is an example of the Berkeley (default) format of output from
106 \&\fBsize\fR:
107 .Sp
108 .Vb 4
109 \& $ size \-\-format=Berkeley ranlib size
110 \& text data bss dec hex filename
111 \& 294880 81920 11592 388392 5ed28 ranlib
112 \& 294880 81920 11888 388688 5ee50 size
113 .Ve
114 .Sp
115 The Berkeley style output counts read only data in the \f(CW\*(C`text\*(C'\fR
116 column, not in the \f(CW\*(C`data\*(C'\fR column, the \f(CW\*(C`dec\*(C'\fR and \f(CW\*(C`hex\*(C'\fR
117 columns both display the sum of the \f(CW\*(C`text\*(C'\fR, \f(CW\*(C`data\*(C'\fR, and
118 \&\f(CW\*(C`bss\*(C'\fR columns in decimal and hexadecimal respectively.
119 .Sp
120 The GNU format counts read only data in the \f(CW\*(C`data\*(C'\fR column, not
121 the \f(CW\*(C`text\*(C'\fR column, and only displays the sum of the \f(CW\*(C`text\*(C'\fR,
122 \&\f(CW\*(C`data\*(C'\fR, and \f(CW\*(C`bss\*(C'\fR columns once, in the \f(CW\*(C`total\*(C'\fR column.
123 The \fB\-\-radix\fR option can be used to change the number base for
124 all columns. Here is the same data displayed with GNU conventions:
125 .Sp
126 .Vb 4
127 \& $ size \-\-format=GNU ranlib size
128 \& text data bss total filename
129 \& 279880 96920 11592 388392 ranlib
130 \& 279880 96920 11888 388688 size
131 .Ve
132 .Sp
133 This is the same data, but displayed closer to System V conventions:
134 .Sp
135 .Vb 7
136 \& $ size \-\-format=SysV ranlib size
137 \& ranlib :
138 \& section size addr
139 \& .text 294880 8192
140 \& .data 81920 303104
141 \& .bss 11592 385024
142 \& Total 388392
143 \&
144 \&
145 \& size :
146 \& section size addr
147 \& .text 294880 8192
148 \& .data 81920 303104
149 \& .bss 11888 385024
150 \& Total 388688
151 .Ve
152 .IP \fB\-\-help\fR 4
153 .IX Item "--help"
154 .PD 0
155 .IP \fB\-h\fR 4
156 .IX Item "-h"
157 .IP \fB\-H\fR 4
158 .IX Item "-H"
159 .IP \fB\-?\fR 4
160 .IX Item "-?"
161 .PD
162 Show a summary of acceptable arguments and options.
163 .IP \fB\-d\fR 4
164 .IX Item "-d"
165 .PD 0
166 .IP \fB\-o\fR 4
167 .IX Item "-o"
168 .IP \fB\-x\fR 4
169 .IX Item "-x"
170 .IP \fB\-\-radix=\fR\fInumber\fR 4
171 .IX Item "--radix=number"
172 .PD
173 Using one of these options, you can control whether the size of each
174 section is given in decimal (\fB\-d\fR, or \fB\-\-radix=10\fR); octal
175 (\fB\-o\fR, or \fB\-\-radix=8\fR); or hexadecimal (\fB\-x\fR, or
176 \&\fB\-\-radix=16\fR). In \fB\-\-radix=\fR\fInumber\fR, only the three
177 values (8, 10, 16) are supported. The total size is always given in two
178 radices; decimal and hexadecimal for \fB\-d\fR or \fB\-x\fR output, or
179 octal and hexadecimal if you're using \fB\-o\fR.
180 .IP \fB\-\-common\fR 4
181 .IX Item "--common"
182 Print total size of common symbols in each file. When using Berkeley
183 or GNU format these are included in the bss size.
184 .IP \fB\-t\fR 4
185 .IX Item "-t"
186 .PD 0
187 .IP \fB\-\-totals\fR 4
188 .IX Item "--totals"
189 .PD
190 Show totals of all objects listed (Berkeley or GNU format mode only).
191 .IP \fB\-\-target=\fR\fIbfdname\fR 4
192 .IX Item "--target=bfdname"
193 Specify that the object-code format for \fIobjfile\fR is
194 \&\fIbfdname\fR. This option may not be necessary; \fBsize\fR can
195 automatically recognize many formats.
196 .IP \fB\-v\fR 4
197 .IX Item "-v"
198 .PD 0
199 .IP \fB\-V\fR 4
200 .IX Item "-V"
201 .IP \fB\-\-version\fR 4
202 .IX Item "--version"
203 .PD
204 Display the version number of \fBsize\fR.
205 .IP \fB\-f\fR 4
206 .IX Item "-f"
207 Ignored. This option is used by other versions of the \fBsize\fR
208 program, but it is not supported by the GNU Binutils version.
209 .IP \fB@\fR\fIfile\fR 4
210 .IX Item "@file"
211 Read command-line options from \fIfile\fR. The options read are
212 inserted in place of the original @\fIfile\fR option. If \fIfile\fR
213 does not exist, or cannot be read, then the option will be treated
214 literally, and not removed.
215 .Sp
216 Options in \fIfile\fR are separated by whitespace. A whitespace
217 character may be included in an option by surrounding the entire
218 option in either single or double quotes. Any character (including a
219 backslash) may be included by prefixing the character to be included
220 with a backslash. The \fIfile\fR may itself contain additional
221 @\fIfile\fR options; any such options will be processed recursively.
222 .SH "SEE ALSO"
223 .IX Header "SEE ALSO"
224 \&\fBar\fR\|(1), \fBobjdump\fR\|(1), \fBreadelf\fR\|(1), and the Info entries for \fIbinutils\fR.
225 .SH COPYRIGHT
226 .IX Header "COPYRIGHT"
227 Copyright (c) 1991\-2026 Free Software Foundation, Inc.
228 .PP
229 Permission is granted to copy, distribute and/or modify this document
230 under the terms of the GNU Free Documentation License, Version 1.3
231 or any later version published by the Free Software Foundation;
232 with no Invariant Sections, with no Front-Cover Texts, and with no
233 Back-Cover Texts. A copy of the license is included in the
234 section entitled "GNU Free Documentation License".