LLVM-SIZE(1)

πŸ“¦ version 23.1.3, in centos-stream 9

πŸ’… LLVM-SIZE(1) β€” the manual, but make it make sense

okay so welcome to llvm-size, bestie. this is the llvm-size(1) page from the LLVM crew, and yes i'm gonna walk you through the whole thing like we're on facetime. it prints size information for binary files. that's it, that's the vibe. it's intended to be a drop-in replacement for GNU's size, so if you're coming from there: hi, welcome, nothing's gonna break. 🫢


✨ SYNOPSIS ✨

llvm-size [options] [input...]

like, options, then as many inputs as you want. we love a flexible icon. πŸŽ€


🌸 DESCRIPTION 🌸

llvm-size is a tool that prints size information for binary files. it is intended to be a drop-in replacement for GNU's size. no cap.

the tool prints size information for each input specified. and listen β€” the defaults matter here:

  • if no input is specified, the program prints size information for a.out. yes, a.out. it's giving vintage, but that's the deal. πŸ™ˆ
  • if - is specified as an input file, llvm-size reads a file from the standard input stream. cute. stdin stays booked and busy.
  • if an input is an archive, size information will be displayed for all its members. every single one. the whole group chat gets a mention. πŸ’–

πŸ’… OPTIONS πŸ’…

okay this is the main character section, let's go.

  • -A β€” equivalent to --format with a value of sysv. that's it. that's the whole flag.
  • --arch=<arch> β€” architecture(s) from Mach-O universal binaries to display information for. (universal binaries are the ones carrying multiple architectures, and you're picking which ones get to speak.) πŸ¦‹
  • -B β€” equivalent to --format with a value of berkeley.
  • --common β€” include ELF common symbol sizes in the bss size for berkeley output format, or as a separate section entry for sysv output. if you don't specify this, these symbols are ignored. lowkey important: leave it off and your bss might look smaller than reality.
  • --exclude-pagezero β€” do not include the __PAGEZERO segment when calculating size information for Mach-O files. why would you want that? because the __PAGEZERO segment is a virtual memory region used for memory protection that does not contribute to actual size, and excluding it can provide a better representation of actual size. so it's the "real numbers only" toggle. ✨
  • -d β€” equivalent to --radix with a value of 10.
  • -l β€” display verbose address and offset information for segments and sections in Mach-O files in darwin format. the verbose one. the lore-dropper. πŸ‘‘
  • --format=<format> β€” set the output format to the <format> specified. available <format> options are berkeley (the default), sysv and darwin. three formats, three personalities, one flag. let me break it down:

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 an input of a different file format is specified, llvm-size falls back to berkeley format. 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. your little emergency exit when you forget everything. 😭
  • -m β€” equivalent to --format with a value of darwin.
  • -o β€” equivalent to --radix with a value of 8.
  • --radix=<value> β€” display size information in the specified radix. permitted values are 8, 10 (the default) and 16 for octal, decimal and hexadecimal output respectively. pick your numeral aesthetic:
$ 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. display the totals for all listed fields, in addition to the individual file listings. the sum at the bottom, the grand finale:
$ 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 the llvm-size executable. flex the build, bestie.
  • -x β€” equivalent to --radix with a value of 16.
  • @<FILE> β€” read command-line options from response file <FILE>. so you can stash your flags in a file and just point at it. very "i pre-wrote my text, i'm not typing it live." πŸ’œ
friendly reminder: --format takes berkeley, sysv or darwin, and --radix takes 8, 10 or 16. don't get cute with other values, that's not the assignment.

πŸ”₯ EXIT STATUS πŸ”₯

llvm-size exits with a non-zero exit code if there is an error. otherwise, it exits with code 0. clean exit = slay. error = not slay, but at least your scripts can tell the difference. ✨


πŸ’€ BUGS πŸ’€

to report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-size/>.

like, actually visit it. don't just complain in the group chat. πŸ™ˆ


🧚 AUTHOR 🧚

maintained by the LLVM Team (https://llvm.org/). the whole squad. 🫢


2003-2026, LLVM Project


okay that's the whole page, no details skipped, we ate and left no crumbs. πŸ‘‘

sign-off tea: this page is source LLVM, page LLVM-SIZE(1), dated 2026-10-06, and it's page number 23 of that set. go print some sizes, bestie. πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from