brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.5 KiB · 12e7c58 Raw
202 lines · plain
1llvm-size - print size information2==================================3 4.. program:: llvm-size5 6SYNOPSIS7--------8 9:program:`llvm-size` [*options*] [*input...*]10 11DESCRIPTION12-----------13 14:program:`llvm-size` is a tool that prints size information for binary files.15It is intended to be a drop-in replacement for GNU's :program:`size`.16 17The tool prints size information for each ``input`` specified. If no input is18specified, the program prints size information for ``a.out``. If "``-``" is19specified as an input file, :program:`llvm-size` reads a file from the standard20input stream. If an input is an archive, size information will be displayed for21all its members.22 23OPTIONS24-------25 26.. option:: -A27 28 Equivalent to :option:`--format` with a value of ``sysv``.29 30.. option:: --arch=<arch>31 32 Architecture(s) from Mach-O universal binaries to display information for.33 34.. option:: -B35 36 Equivalent to :option:`--format` with a value of ``berkeley``.37 38.. option:: --common39 40 Include ELF common symbol sizes in bss size for ``berkeley`` output format, or41 as a separate section entry for ``sysv`` output. If not specified, these42 symbols are ignored.43 44.. option:: --exclude-pagezero45 46 Do not include the ``__PAGEZERO`` segment when calculating size information47 for Mach-O files. The ``__PAGEZERO`` segment is a virtual memory region used48 for memory protection that does not contribute to actual size, and excluding49 can provide a better representation of actual size.50 51.. option:: -d52 53 Equivalent to :option:`--radix` with a value of ``10``.54 55.. option:: -l56 57 Display verbose address and offset information for segments and sections in58 Mach-O files in ``darwin`` format.59 60.. option:: --format=<format>61 62 Set the output format to the ``<format>`` specified. Available ``<format>``63 options are ``berkeley`` (the default), ``sysv`` and ``darwin``.64 65 Berkeley output summarises text, data and bss sizes in each file, as shown66 below for a typical pair of ELF files:67 68 .. code-block:: console69 70  $ llvm-size --format=berkeley test.o test2.o71     text    data     bss     dec     hex filename72      182      16       5     203      cb test.elf73       82       8       1      91      5b test2.o74 75 For Mach-O files, the output format is slightly different:76 77 .. code-block:: console78 79  $ llvm-size --format=berkeley macho.obj macho2.obj80  __TEXT  __DATA  __OBJC  others  dec     hex81  4       8       0       0       12      c       macho.obj82  16      32      0       0       48      30      macho2.obj83 84 Sysv output displays size and address information for most sections, with each85 file being listed separately:86 87 .. code-block:: console88 89  $ llvm-size --format=sysv test.elf test2.o90     test.elf  :91     section       size      addr92     .eh_frame       92   209749693     .text           90   210124894     .data           16   210534495     .bss             5   210536096     .comment       209         097     Total          41298 99     test2.o  :100     section             size   addr101     .text                 26      0102     .data                  8      0103     .bss                   1      0104     .comment             106      0105     .note.GNU-stack        0      0106     .eh_frame             56      0107     .llvm_addrsig          2      0108     Total                199109 110 ``darwin`` format only affects Mach-O input files. If an input of a different111 file format is specified, :program:`llvm-size` falls back to ``berkeley``112 format. When producing ``darwin`` format, the tool displays information about113 segments and sections:114 115 .. code-block:: console116 117  $ llvm-size --format=darwin macho.obj macho2.obj118     macho.obj:119     Segment : 12120             Section (__TEXT, __text): 4121             Section (__DATA, __data): 8122             total 12123     total 12124     macho2.obj:125     Segment : 48126             Section (__TEXT, __text): 16127             Section (__DATA, __data): 32128             total 48129     total 48130 131.. option:: --help, -h132 133 Display a summary of command line options.134 135.. option:: -m136 137 Equivalent to :option:`--format` with a value of ``darwin``.138 139.. option:: -o140 141 Equivalent to :option:`--radix` with a value of ``8``.142 143.. option:: --radix=<value>144 145 Display size information in the specified radix. Permitted values are ``8``,146 ``10`` (the default) and ``16`` for octal, decimal and hexadecimal output147 respectively.148 149 Example:150 151 .. code-block:: console152 153  $ llvm-size --radix=8 test.o154     text    data     bss     oct     hex filename155     0152      04      04     162      72 test.o156 157  $ llvm-size --radix=10 test.o158     text    data     bss     dec     hex filename159      106       4       4     114      72 test.o160 161  $ llvm-size --radix=16 test.o162     text    data     bss     dec     hex filename163     0x6a     0x4     0x4     114      72 test.o164 165.. option:: --totals, -t166 167 Applies only to ``berkeley`` output format. Display the totals for all listed168 fields, in addition to the individual file listings.169 170 Example:171 172 .. code-block:: console173 174  $ llvm-size --totals test.elf test2.o175     text    data     bss     dec     hex filename176      182      16       5     203      cb test.elf177       82       8       1      91      5b test2.o178      264      24       6     294     126 (TOTALS)179 180.. option:: --version181 182 Display the version of the :program:`llvm-size` executable.183 184.. option:: -x185 186 Equivalent to :option:`--radix` with a value of ``16``.187 188.. option:: @<FILE>189 190 Read command-line options from response file ``<FILE>``.191 192EXIT STATUS193-----------194 195:program:`llvm-size` exits with a non-zero exit code if there is an error.196Otherwise, it exits with code 0.197 198BUGS199----200 201To report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-size/>.202