LLVM-SIZE(1)
β¨ llvm-size β¨
okay bestie, so this is llvm-size from the LLVM manual, and it's literally the glow-up of GNU's size. let's get into it π
πΈ NAME πΈ
llvm-size β print size information. that's it, that's the whole job, and she does it flawlessly.
π SYNOPSIS π
llvm-size [options] [input...]
π¦ DESCRIPTION π¦
so like, llvm-size is a tool that prints size information for binary files. and the way it's intended to be a drop-in replacement for GNU's size?? iconic behaviour fr fr. no cap.
she prints size info for every input you hand her. and if you specify no input at all? she just goes ahead and prints size information for a.out like the self-sufficient queen she is. β¨
if you pass - as an input file, llvm-size reads a file from the standard input stream. and if an input is an archive? she's not gonna just do the top level, no ma'am β size information will be displayed for all its members. every single one. she's thorough. π
π OPTIONS π
-Aβ equivalent to--formatwith a value ofsysv. short, sweet, sysv.--arch=<arch>β the architecture(s) from Mach-O universal binaries that you want info for.-Bβ equivalent to--formatwith a value ofberkeley. the classic.--commonβ include ELF common symbol sizes in bss size for berkeley output format, or as a separate section entry for sysv output. if you don't specify this, those symbols just get ignored, like they weren't even invited. π-dβ equivalent to--radixwith a value of10.-lβ display verbose address and offset information for segments and sections in Mach-O files in darwin format. the tea is detailed.--format=<format>β set the output format to the<format>specified. available<format>options areberkeley(the default, the moment, the main character),sysvanddarwin.
Berkeley output summarises text, data and bss sizes in each file, as shown below for a typical pair of ELF files:
$ 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
For Mach-O files, the output format is slightly different:
$ 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
Sysv output displays size and address information for most sections, with each file being listed separately:
$ 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
darwin format only affects Mach-O input files. if you give her an input of a different file format, llvm-size falls back to berkeley format β she's flexible like that. when producing darwin format, the tool displays information about segments and sections:
$ 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
--help,-hβ display a summary of command line options. the lil cheat sheet.--help-listβ display an uncategorized summary of command line options. same energy, no categories, just vibes.-mβ equivalent to--formatwith a value ofdarwin.-oβ equivalent to--radixwith a value of8.--radix=<value>β display size information in the specified radix. permitted values are8,10(the default) and16for octal, decimal and hexadecimal output respectively.
Example:
$ 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
--totals,-tβ applies only to berkeley output format (she said what she said). display the totals for all listed fields, in addition to the individual file listings.
Example:
$ 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)
--versionβ display the version of thellvm-sizeexecutable.-xβ equivalent to--radixwith a value of16.@<FILE>β read command-line options from response file<FILE>.
π₯ EXIT STATUS π₯
llvm-size exits with a non-zero exit code if there is an error. otherwise? she exits with code 0. clean. tidy. slayed.
π BUGS π
to report bugs, please visit <https://bugs.llvm.org/>. (not me sending you to the bug tracker bestie, but like, they wanna know π)
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). the whole squad, holding it down.
π COPYRIGHT π
2003-2024, LLVM Project. two decades of service, we love to see it.
and that's the whole page babes β LLVM 11, dated 2024-07-18, LLVM-SIZE(1), signing off π«Άβ¨π
π¦ where this page comes from
- fedora 43: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 43: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 44: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 44: llvm11 11.1.0-14.fc41 Β· NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms