14.6. tiarmsize - Print Size Information

The tiarmsize tool can be used to print size information for binary files.

14.6.1. Usage

tiarmsize [options] [input …]

  • tiarmsize - is the command used to invoke the tool.

  • options - affect the behavior of the tiarmsize tool.

  • input - identify one or more input object files, for which tiarmsize will print the size information for each input file specified. If no input is specified, tiarmsize will attempt to print size information for a.out. If - is specified as an input file, tiarmsize will read a file from the standard input stream. If an input is an archive, size information will be displayed for all its members.

The tiarmsize output will be written to stdout.

14.6.2. Options

-A

Equivalent to the --format=sysv option.

-B

Equivalent to the --format=berkeley option.

--common

Include ELF common symbol sizes in .bss section size for berkeley output format, or as a separate section entry for sysv output. If the --common option is not specified, these symbols are ignored.

-d

Equivalent to the --radix=10 option.

--format=<format>

Set the output format to the specified <format>. Available <format> argument values are:

  • berkeley (the default)

  • sysv

Berkeley output summarizes text, data and bss sizes in each file, as shown below for a typical pair of ELF files:

$ tiarmsize --format=berkeley test.out ref_global.o def_global.o
   text    data     bss     dec     hex filename
   4968    4096   41885   50949    c705 test.out
     62       0       0      62      3e ref_global.o
      0       4       0       4       4 def_global.o

Sysv output displays size and address information for most sections, with each file being listed separately:

$ tiarmsize --format=sysv test.out ref_global.o def_global.o
test.out  :
section                size        addr
.intvecs                  0           0
.bss                    460   536912372
.data                   465   536911904
.sysmem                8192   536903712
.stack                32768   536870944
.text                  4788          32
.cinit                  128        8968
.const                    0           0
.rodata                  52        4820
.ARM.exidx                0           0
.init_array               0           0
.TI.ramfunc               0           0
.TI.noinit                0           0
.TI.persistent            0           0
__llvm_prf_cnts           0   536870944
.binit                    0          32
Veneer$$CMSE              0           0
.args                  4096        4872
.ARM.attributes          83           0
.TI.section.flags        26           0
.symtab_meta            173           0
Total                 51231


ref_global.o  :
section                  size   addr
.text                       0      0
.text.main                 36      0
.ARM.exidx.text.main        8      0
.rodata.str1.1             18      0
.comment                  121      0
.note.GNU-stack             0      0
.ARM.attributes            65      0
.symtab_meta                5      0
.llvm_addrsig               2      0
Total                     255


def_global.o  :
section     size   addr
.text          0      0
.data          4      0
Total          4
--help, -h

Display a summary of command line options.

--help-list

Display an uncategorized summary of command line options.

-o

Equivalent to the --radix=8 option.

--radix=<value>

Display size information in the specified radix indicated by the <value> argument. Permitted values are 8, 10 (the default) and 16 for octal, decimal and hexadecimal output, respectively.

Example:

$ tiarmsize --radix=8 ref_global.o
   text    data     bss     oct     hex filename
    076       0       0      76      3e ref_global.o

$ tiarmsize --radix=10 ref_global.o
   text    data     bss     dec     hex filename
     62       0       0      62      3e ref_global.o

$ tiarmsize --radix=16 ref_global.o
   text    data     bss     dec     hex filename
   0x3e       0       0      62      3e ref_global.o
--totals, -t

Applies only to berkeley output format. Display the totals for all listed fields, in addition to the individual file listings.

Example:

$ llvm-size --totals ref_global.o def_global.o
   text    data     bss     dec     hex filename
     62       0       0      62      3e ref_global.o
      0       4       0       4       4 def_global.o
     62       4       0      66      42 (TOTALS)
--version

Display the version of the tiarmsize executable.

-x

Equivalent to the --radix=16 option.

@<file>

Read command-line options from specified <file>.

14.6.3. Exit Status

tiarmsize exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0.