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.
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:
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
- To display the size of
the a.out file in decimal, enter:
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:size
3720 + 1752 + 4152 = 9624
- To display the size of
an object file in octal, enter:
This displays the size of the driver.o object file in octal.size -o driver.o
- To display the size of
several object files in hexadecimal, enter:
This displays in hexadecimal the size of each file ending with .o in the current directory.size -x *.o