LLVM-SIZE(1)
π llvm-size β bestie's guide to size info π
okay so this is the manual page for llvm-size, part of the LLVM toolchain, and it's literally just here to tell you how big stuff is. welcome to the group chat, pull up a chair π«Ά
β¨ NAME β¨
llvm-size β print size information π
πΈ SYNOPSIS πΈ
llvm-size [options] [input...]
π¦ DESCRIPTION π¦
so llvm-size is that girl β she prints size information for binary files. she's designed to be a drop-in replacement for GNU's size, so if you're switching over, no cap, she'll slot right in π
she prints size info for every input you hand her. if you hand her nothing, she'll just go ahead and print info for a.out (iconic default behaviour, honestly).
if you pass - as an input file, she reads a file straight from the standard input stream. and if one of your inputs is an archive, she'll show size info for all its members β every single one, we're not leaving anyone out π
π OPTIONS π
-Aβ same thing as--formatwith a value ofsysv. that's it, that's the whole vibe.--arch=<arch>β which architecture(s) from Mach-O universal binaries you want info for.-Bβ equivalent to--formatwith a value ofberkeley.--commonβ include ELF common symbol sizes in the bss size for berkeley output, or as its own separate section entry for sysv output. if you don't say it, those symbols get ignored entirely π-dβ equivalent to--radixwith a value of10.-lβ display verbose address and offset info for segments and sections in Mach-O files, in darwin format. she's chatty like that π¬--format=<format>β set the output format to whatever<format>you want. available options areberkeley(the default),sysvanddarwin.
Berkeley output summarises text, data and bss sizes in each file, like this 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 info for most sections, with each file 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 it an input of a different file format, llvm-size falls back to berkeley format. when producing darwin format, the tool displays info 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 the command line options. bestie needs a cheat sheet sometimes π-mβ equivalent to--formatwith a value ofdarwin.-oβ equivalent to--radixwith a value of8.--radix=<value>β display size info in the radix you specify. permitted values are8,10(the default) and16, for 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β only applies to berkeley output format. displays the totals for all listed fields, on top of the individual file listings. group project energy, but the good kind π«
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. slay, what version are we π-xβ equivalent to--radixwith a value of16.@<FILE>β read command line options from the response file<FILE>.
π EXIT STATUS π
llvm-size exits with a non-zero exit code if there's an error. otherwise she exits with code 0 β clean, no drama, periodt β¨
π BUGS π
to report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-size/. (yes we do want to hear about it, no we're not mad π₯Ί)
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). absolute icons, fr fr.
π COPYRIGHT π
2003-2025, LLVM Project
and that's the whole page, bestie!! this was LLVM's llvm-size manual, version 20, dated 2025-09-03 πΈ go forth and measure things, you've got this ππ¦β¨
π¦ where this page comes from
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms