aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/clang/llvm-size/llvm-size.1
blob: b89fbea69765dd00af8d688789fda7d35f93609c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
.\" $FreeBSD$
.\" Man page generated from reStructuredText.
.
.TH "LLVM-SIZE" "1" "2020-06-26" "10" "LLVM"
.SH NAME
llvm-size \- print size information
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-size\fP [\fIoptions\fP] [\fIinput...\fP]
.SH DESCRIPTION
.sp
\fBllvm\-size\fP is a tool that prints size information for binary files.
It is intended to be a drop\-in replacement for GNU\(aqs \fBsize\fP\&.
.sp
The tool prints size information for each \fBinput\fP specified. If no input is
specified, the program prints size information for \fBa.out\fP\&. If "\fB\-\fP" is
specified as an input file, \fBllvm\-size\fP reads a file from the standard
input stream. If an input is an archive, size information will be displayed for
all its members.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-A
Equivalent to \fI\%\-\-format\fP with a value of \fBsysv\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-arch=<arch>
Architecture(s) from Mach\-O universal binaries to display information for.
.UNINDENT
.INDENT 0.0
.TP
.B \-B
Equivalent to \fI\%\-\-format\fP with a value of \fBberkeley\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-common
Include ELF common symbol sizes in bss size for \fBberkeley\fP output format, or
as a separate section entry for \fBsysv\fP output. If not specified, these
symbols are ignored.
.UNINDENT
.INDENT 0.0
.TP
.B \-d
Equivalent to \fI\%\-\-radix\fP with a value of \fB10\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-l
Display verbose address and offset information for segments and sections in
Mach\-O files in \fBdarwin\fP format.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-format=<format>
Set the output format to the \fB<format>\fP specified. Available \fB<format>\fP
options are \fBberkeley\fP (the default), \fBsysv\fP and \fBdarwin\fP\&.
.sp
Berkeley output summarises text, data and bss sizes in each file, as shown
below for a typical pair of ELF files:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-size \-\-format=berkeley test.o test2.o
   text    data     bss     dec     hex filename
    182      16       5     203      cb test.elf
     82       8       1      91      5b test2.o
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For Mach\-O files, the output format is slightly different:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-size \-\-format=berkeley macho.obj macho2.obj
__TEXT  __DATA  __OBJC  others  dec     hex
4       8       0       0       12      c       macho.obj
16      32      0       0       48      30      macho2.obj
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Sysv output displays size and address information for most sections, with each
file being listed separately:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-size \-\-format=sysv test.elf test2.o
   test.elf  :
   section       size      addr
   .eh_frame       92   2097496
   .text           90   2101248
   .data           16   2105344
   .bss             5   2105360
   .comment       209         0
   Total          412

   test2.o  :
   section             size   addr
   .text                 26      0
   .data                  8      0
   .bss                   1      0
   .comment             106      0
   .note.GNU\-stack        0      0
   .eh_frame             56      0
   .llvm_addrsig          2      0
   Total                199
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBdarwin\fP format only affects Mach\-O input files. If an input of a different
file format is specified, \fBllvm\-size\fP falls back to \fBberkeley\fP
format. When producing \fBdarwin\fP format, the tool displays information about
segments and sections:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-size \-\-format=darwin macho.obj macho2.obj
   macho.obj:
   Segment : 12
           Section (__TEXT, __text): 4
           Section (__DATA, __data): 8
           total 12
   total 12
   macho2.obj:
   Segment : 48
           Section (__TEXT, __text): 16
           Section (__DATA, __data): 32
           total 48
   total 48
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help, \-h
Display a summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help\-list
Display an uncategorized summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-m
Equivalent to \fI\%\-\-format\fP with a value of \fBdarwin\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-o
Equivalent to \fI\%\-\-radix\fP with a value of \fB8\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-radix=<value>
Display size information in the specified radix. Permitted values are \fB8\fP,
\fB10\fP (the default) and \fB16\fP for octal, decimal and hexadecimal output
respectively.
.sp
Example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-size \-\-radix=8 test.o
   text    data     bss     oct     hex filename
   0152      04      04     162      72 test.o

$ llvm\-size \-\-radix=10 test.o
   text    data     bss     dec     hex filename
    106       4       4     114      72 test.o

$ llvm\-size \-\-radix=16 test.o
   text    data     bss     dec     hex filename
   0x6a     0x4     0x4     114      72 test.o
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-totals, \-t
Applies only to \fBberkeley\fP output format. Display the totals for all listed
fields, in addition to the individual file listings.
.sp
Example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-size \-\-totals test.elf test2.o
   text    data     bss     dec     hex filename
    182      16       5     203      cb test.elf
     82       8       1      91      5b test2.o
    264      24       6     294     126 (TOTALS)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Display the version of the \fBllvm\-size\fP executable.
.UNINDENT
.INDENT 0.0
.TP
.B \-x
Equivalent to \fI\%\-\-radix\fP with a value of \fB16\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B @<FILE>
Read command\-line options from response file \fB<FILE>\fP\&.
.UNINDENT
.SH EXIT STATUS
.sp
\fBllvm\-size\fP exits with a non\-zero exit code if there is an error.
Otherwise, it exits with code 0.
.SH BUGS
.sp
To report bugs, please visit <\fI\%http://llvm.org/bugs/\fP>.
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
2003-2020, LLVM Project
.\" Generated by docutils manpage writer.
.