size Command

Purpose

Displays the section sizes of the Extended Common Object File Format (XCOFF) object files.

Syntax

size-d -o -x ] [  -f ] [  -V ] [  -X  {32 | 64 | 32_64 | d64 | any}]File ... ]

Description

The size command writes to standard output the number of bytes required by all sections, along with their sum for each XCOFF file. If the -f flag is specified, the section name follows the section size.

Note: When no file is passed as an input to the size command, the a.out file is considered as the default.

Flags

The output is in decimal notation unless you change the output with the following flags:

Item Description
-d Writes in decimal notation.
-f Writes the section name in parenthesis following the section size.
-o Writes in octal notation.
-x Writes in hexadecimal notation.
-X mode Specifies the type of object file size should examine. The mode must be one of the following:
32
Processes only 32-bit object files
64
Processes only 64-bit object files
32_64
Processes both 32-bit and 64-bit object files
d64
Examines discontinued 64-bit XCOFF files (magic number == U803XTOCMAGIC).
any
Processes all of the supported object files.

The default is to process 32-bit object files (ignore 64-bit objects). The mode can also be set with the OBJECT_MODE environment variable. For example, OBJECT_MODE=64 causes size to process any 64-bit objects and ignore 32-bit objects. The -X flag overrides the OBJECT_MODE variable.

-V Prints the version number of the size command.

Examples

  1. To display the size of the a.out file in decimal, enter:
    size
    This displays the size in bytes of the executable a.out file. The size of each section of the object file is given, followed by the total:
    3720 + 1752 + 4152 = 9624
  2. To display the size of an object file in octal, enter:
    size -o driver.o
    This displays the size of the driver.o object file in octal.
  3. To display the size of several object files in hexadecimal, enter:
    size -x *.o
    This displays in hexadecimal the size of each file ending with .o in the current directory.