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