1SIZE(1)                      GNU Development Tools                     SIZE(1)
2
3
4

NAME

6       size - list section sizes and total size of binary files
7

SYNOPSIS

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            [objfile...]
16

DESCRIPTION

18       The GNU size utility lists the section sizes and the total size for
19       each of the binary files objfile on its argument list.  By default, one
20       line of output is generated for each file or each module if the file is
21       an archive.
22
23       objfile... are the files to be examined.  If none are specified, the
24       file "a.out" will be used instead.
25

OPTIONS

27       The command-line options have the following meanings:
28
29       -A
30       -B
31       -G
32       --format=compatibility
33           Using one of these options, you can choose whether the output from
34           GNU size resembles output from System V size (using -A, or
35           --format=sysv), or Berkeley size (using -B, or --format=berkeley).
36           The default is the one-line format similar to Berkeley's.
37           Alternatively, you can choose the GNU format output (using -G, or
38           --format=gnu), this is similar to Berkeley's output format, but
39           sizes are counted differently.
40
41           Here is an example of the Berkeley (default) format of output from
42           size:
43
44                   $ size --format=Berkeley ranlib size
45                      text    data     bss     dec     hex filename
46                    294880   81920   11592  388392   5ed28 ranlib
47                    294880   81920   11888  388688   5ee50 size
48
49           The Berkeley style output counts read only data in the "text"
50           column, not in the "data" column, the "dec" and "hex" columns both
51           display the sum of the "text", "data", and "bss" columns in decimal
52           and hexadecimal respectively.
53
54           The GNU format counts read only data in the "data" column, not the
55           "text" column, and only displays the sum of the "text", "data", and
56           "bss" columns once, in the "total" column.  The --radix option can
57           be used to change the number base for all columns.  Here is the
58           same data displayed with GNU conventions:
59
60                   $ size --format=GNU ranlib size
61                         text       data        bss      total filename
62                       279880      96920      11592     388392 ranlib
63                       279880      96920      11888     388688 size
64
65           This is the same data, but displayed closer to System V
66           conventions:
67
68                   $ size --format=SysV ranlib size
69                   ranlib  :
70                   section         size         addr
71                   .text         294880         8192
72                   .data          81920       303104
73                   .bss           11592       385024
74                   Total         388392
75
76
77                   size  :
78                   section         size         addr
79                   .text         294880         8192
80                   .data          81920       303104
81                   .bss           11888       385024
82                   Total         388688
83
84       --help
85           Show a summary of acceptable arguments and options.
86
87       -d
88       -o
89       -x
90       --radix=number
91           Using one of these options, you can control whether the size of
92           each section is given in decimal (-d, or --radix=10); octal (-o, or
93           --radix=8); or hexadecimal (-x, or --radix=16).  In --radix=number,
94           only the three values (8, 10, 16) are supported.  The total size is
95           always given in two radices; decimal and hexadecimal for -d or -x
96           output, or octal and hexadecimal if you're using -o.
97
98       --common
99           Print total size of common symbols in each file.  When using
100           Berkeley or GNU format these are included in the bss size.
101
102       -t
103       --totals
104           Show totals of all objects listed (Berkeley or GNU format mode
105           only).
106
107       --target=bfdname
108           Specify that the object-code format for objfile is bfdname.  This
109           option may not be necessary; size can automatically recognize many
110           formats.
111
112       -V
113       --version
114           Display the version number of size.
115
116       @file
117           Read command-line options from file.  The options read are inserted
118           in place of the original @file option.  If file does not exist, or
119           cannot be read, then the option will be treated literally, and not
120           removed.
121
122           Options in file are separated by whitespace.  A whitespace
123           character may be included in an option by surrounding the entire
124           option in either single or double quotes.  Any character (including
125           a backslash) may be included by prefixing the character to be
126           included with a backslash.  The file may itself contain additional
127           @file options; any such options will be processed recursively.
128

SEE ALSO

130       ar(1), objdump(1), readelf(1), and the Info entries for binutils.
131
133       Copyright (c) 1991-2021 Free Software Foundation, Inc.
134
135       Permission is granted to copy, distribute and/or modify this document
136       under the terms of the GNU Free Documentation License, Version 1.3 or
137       any later version published by the Free Software Foundation; with no
138       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
139       Texts.  A copy of the license is included in the section entitled "GNU
140       Free Documentation License".
141
142
143
144binutils-2.37                     2021-09-16                           SIZE(1)
Impressum