1 .\" Copyright (c) 2007 S.Sam Arun Raj
2 .\" Copyright (c) 2008,2011 Joseph Koshy
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" $Id: size.1 3195 2015-05-12 17:22:19Z emaste $
33 .Nd "display section sizes and total size of ELF objects"
36 .Op Fl -format= Ns Ar format
38 .Op Fl -radix= Ns Ar radix
47 lists the sizes of ELF sections, and optionally the total size, for
50 specified on the command line.
53 utility can operate on ELF objects, on
55 archives containing ELF objects, and on core dumps.
56 If no file name is specified on the command-line,
62 utility recognized the following options:
63 .Bl -tag -width indent
64 .It Fl -format= Ns Ar format
65 Display output using the format specified by argument
67 Supported values for this argument are:
71 The default output format is
75 below for more information.
77 Display a help message and exit.
78 .It Fl -radix= Ns Ar radix
79 Display numeric values using the radix specified by argument
84 The default radix is 10.
86 Shows cumulative totals of section sizes from all objects.
87 This option is ignored for System V style output.
89 Display a version identifier and exit.
91 Equivalent to specifying option
92 .Fl -format= Ns Ar sysv .
94 Equivalent to specifying option
95 .Fl -format= Ns Ar berkeley .
97 Equivalent to specifying option
100 Equivalent to specifying option
101 .Fl -radix= Ns Ar 10 .
103 Equivalent to specifying option
106 Equivalent to specifying option
107 .Fl -radix= Ns Ar 8 .
109 Equivalent to specifying option
112 Equivalent to specifying option
113 .Fl -radix= Ns Ar 16 .
116 .Ss Berkeley Style Output
119 style output is in effect, an initial header line naming fields will
120 be output, followed by one line of output for each ELF object specified
121 on the command line or found in an archive.
123 Each line will contain the following whitespace separated fields
127 The size of the text segment in the object.
129 The size of the data segment in the object.
133 segment in the object.
135 The total size of the object in either decimal or octal.
136 Decimal output is used if the specified output radix for numeric values
138 Octal output is used if the radix being used for numeric values
141 The total size of the object in hexadecimal.
143 The file name of the object.
148 was specified, an additional line in the same format as above will be
149 output at the end containing the sum of the respective fields.
150 The file name field for the line will contain the string
152 .Ss System V Style Output
153 If System V style output is selected,
155 will output the following information for each object:
158 The name of the object followed by a colon.
160 A header line containing the names of fields of subsequent lines.
162 One line per section present in the object.
163 Each line has three fields:
166 The name of the section.
168 Its size, in the selected radix for numeric values.
170 The address associated with the section, in the selected numeric radix.
173 A line whose section name field contains the string
175 and whose size field contains the sum of all reported section sizes.
180 To display the section sizes for
185 text data bss dec hex filename
186 20975 540 392 21907 5593 /bin/ls
189 To display sizes and total for
195 $ size -tx /bin/ls /bin/dd
196 text data bss dec hex filename
197 0x51ef 0x21c 0x188 21907 5593 /bin/ls
198 0x3df5 0x170 0x200 16741 4165 /bin/dd
199 0x8fe4 0x38c 0x388 38648 96f8 (TOTALS)
202 To display section sizes for
204 in System V format use:
210 \&.note.ABI-tag 24 4194728
212 \&.dynsym 2088 4195376
213 \&.dynstr 810 4197464
214 \&.rela.dyn 120 4198280
215 \&.rela.plt 1656 4198400
218 \&.text 15224 4201200
220 \&.rodata 1472 4216448
222 \&.eh_frame 1624 5267536
223 \&.dynamic 384 5269160
241 .%A "AT&T Unix Systems Labs"
242 .%T "System V Application Binary Interface"
243 .%O http://www.sco.com/developers/gabi/
248 utility first appeared in
254 utility was re-written by
255 .An S. Sam Arun Raj Aq Mt samarunraj@gmail.com
256 This manual page was written by
257 .An S. Sam Arun Raj Aq Mt samarunraj@gmail.com