1SIZE(1) GNU Development Tools SIZE(1)
2
3
4
6 size - list section sizes and total size of binary files
7
9 size [-A|-B|-G|--format=compatibility]
10 [--help]
11 [-d|-o|-x|--radix=number]
12 [--common]
13 [-t|--totals]
14 [--target=bfdname] [-V|--version]
15 [-f]
16 [objfile...]
17
19 The GNU size utility lists the section sizes and the total size for
20 each of the binary files objfile on its argument list. By default, one
21 line of output is generated for each file or each module if the file is
22 an archive.
23
24 objfile... are the files to be examined. If none are specified, the
25 file "a.out" will be used instead.
26
28 The command-line options have the following meanings:
29
30 -A
31 -B
32 -G
33 --format=compatibility
34 Using one of these options, you can choose whether the output from
35 GNU size resembles output from System V size (using -A, or
36 --format=sysv), or Berkeley size (using -B, or --format=berkeley).
37 The default is the one-line format similar to Berkeley's.
38 Alternatively, you can choose the GNU format output (using -G, or
39 --format=gnu), this is similar to Berkeley's output format, but
40 sizes are counted differently.
41
42 Here is an example of the Berkeley (default) format of output from
43 size:
44
45 $ size --format=Berkeley ranlib size
46 text data bss dec hex filename
47 294880 81920 11592 388392 5ed28 ranlib
48 294880 81920 11888 388688 5ee50 size
49
50 The Berkeley style output counts read only data in the "text"
51 column, not in the "data" column, the "dec" and "hex" columns both
52 display the sum of the "text", "data", and "bss" columns in decimal
53 and hexadecimal respectively.
54
55 The GNU format counts read only data in the "data" column, not the
56 "text" column, and only displays the sum of the "text", "data", and
57 "bss" columns once, in the "total" column. The --radix option can
58 be used to change the number base for all columns. Here is the
59 same data displayed with GNU conventions:
60
61 $ size --format=GNU ranlib size
62 text data bss total filename
63 279880 96920 11592 388392 ranlib
64 279880 96920 11888 388688 size
65
66 This is the same data, but displayed closer to System V
67 conventions:
68
69 $ size --format=SysV ranlib size
70 ranlib :
71 section size addr
72 .text 294880 8192
73 .data 81920 303104
74 .bss 11592 385024
75 Total 388392
76
77
78 size :
79 section size addr
80 .text 294880 8192
81 .data 81920 303104
82 .bss 11888 385024
83 Total 388688
84
85 --help
86 -h
87 -H
88 -? Show a summary of acceptable arguments and options.
89
90 -d
91 -o
92 -x
93 --radix=number
94 Using one of these options, you can control whether the size of
95 each section is given in decimal (-d, or --radix=10); octal (-o, or
96 --radix=8); or hexadecimal (-x, or --radix=16). In --radix=number,
97 only the three values (8, 10, 16) are supported. The total size is
98 always given in two radices; decimal and hexadecimal for -d or -x
99 output, or octal and hexadecimal if you're using -o.
100
101 --common
102 Print total size of common symbols in each file. When using
103 Berkeley or GNU format these are included in the bss size.
104
105 -t
106 --totals
107 Show totals of all objects listed (Berkeley or GNU format mode
108 only).
109
110 --target=bfdname
111 Specify that the object-code format for objfile is bfdname. This
112 option may not be necessary; size can automatically recognize many
113 formats.
114
115 -v
116 -V
117 --version
118 Display the version number of size.
119
120 -f Ignored. This option is used by other versions of the size
121 program, but it is not supported by the GNU Binutils version.
122
123 @file
124 Read command-line options from file. The options read are inserted
125 in place of the original @file option. If file does not exist, or
126 cannot be read, then the option will be treated literally, and not
127 removed.
128
129 Options in file are separated by whitespace. A whitespace
130 character may be included in an option by surrounding the entire
131 option in either single or double quotes. Any character (including
132 a backslash) may be included by prefixing the character to be
133 included with a backslash. The file may itself contain additional
134 @file options; any such options will be processed recursively.
135
137 ar(1), objdump(1), readelf(1), and the Info entries for binutils.
138
140 Copyright (c) 1991-2023 Free Software Foundation, Inc.
141
142 Permission is granted to copy, distribute and/or modify this document
143 under the terms of the GNU Free Documentation License, Version 1.3 or
144 any later version published by the Free Software Foundation; with no
145 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
146 Texts. A copy of the license is included in the section entitled "GNU
147 Free Documentation License".
148
149
150
151binutils-2.41 2023-08-16 SIZE(1)