LLVM-SIZE(1)

πŸ’… llvm-size(1) β€” the LLVM one, bestie

Okay so real talk, this is llvm-size from the LLVM fam β€” LLVM's very own manual page, and I'm about to make it make sense. 🫢

✨ SYNOPSIS ✨

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

🌸 DESCRIPTION 🌸

llvm-size is that girl who prints size information for binary files. Like, she looks at your binary and tells you how big stuff is. Periodt. πŸ’–

She's intended to be a drop-in replacement for GNU's size β€” so if you're coming from GNU land, you can just slide right in, no cap.

Here's the vibe: the tool prints size information for each input you specify. No input at all? She defaults to printing size info for a.out (yes, the classic, iconic, main-character default). Pass - as an input file and llvm-size reads a file from the standard input stream. And if one of your inputs is an archive, she'll display size information for all its members. Not one, not some β€” all of them. πŸ’€

πŸŽ€ OPTIONS πŸŽ€

  • -A β€” literally just 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. iykyk.
  • -B β€” equivalent to --format with a value of berkeley. Short and sweet.
  • --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 it, these symbols are straight-up ignored. πŸ™ˆ
  • --exclude-pagezero β€” do not include the __PAGEZERO segment when calculating size information for Mach-O files. Listen: __PAGEZERO is a virtual memory region used for memory protection that does not contribute to actual size, and excluding it can give you a better representation of actual size. So like, it's giving accuracy. ✨
  • -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. Verbose! Addresses! Offsets! Obsessed.
  • --format=<format> β€” set the output format to the <format> specified. Available <format> options are berkeley (the default), sysv and darwin.

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 feed it an input of a different file format, llvm-size falls back to berkeley format (she's flexible, she adapts πŸ’). 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. Bestie behaviour honestly.
  • -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. Choose your fighter. 🌈

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, just so we're clear. Displays the totals for all listed fields, in addition to the individual file listings. The math is mathing. πŸ”₯

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 the llvm-size executable.
  • -x β€” equivalent to --radix with a value of 16.
  • @<FILE> β€” read command-line options from response file <FILE>. Sneaky but iconic. πŸ¦‹

⭐ EXIT STATUS ⭐

llvm-size exits with a non-zero exit code if there is an error. Otherwise, she exits with code 0. That's the whole story, no notes. πŸ’…

πŸ’€ BUGS πŸ’€

To report bugs, please visit <<https://github.com/llvm/llvm-project/labels/tools:llvm-size/>>. Don't be shy, they want the reports fr fr.

πŸ‘‘ Author πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). Absolute legends, genuinely.

2003-2026, LLVM Project


And that's a wrap, bestie πŸ§šπŸ’œ β€” this page is page 23, dated 2026-10-20, from LLVM. Go forth and measure your binaries with confidence, mwah πŸ’‹

πŸ“¦ where this page comes from
  • arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms