size(CP)
size --
print section sizes in bytes of object files
Syntax
size [-F -f -n -o -V -x] files
Description
The
size
command produces segment or section size information in bytes
for each loaded section in
ELF or COFF object files.
size
prints out
the size of the
.text, .data, and
.bss (uninitialized data) segments (or sections) and their total.
size
processes ELF and COFF object
files entered on the command line.
If an archive file is input to the
size
command, the information for each object file in
the archive is displayed.
When calculating segment information, the
size
command prints out
the total file size of the non-writable segments,
the total file size of the writable segments,
and the total memory size of the writable segments minus the total
file size of the writable segments.
If it cannot calculate segment information,
size
calculates
section information.
When calculating section information, it prints out
the total size of sections that are allocatable, non-writable, and not
NOBITS,
the total size of the sections that are allocatable, writable, and not NOBITS,
and the total size of the writable sections of type NOBITS.
(NOBITS sections do not actually take up space
in the file.)
If
size
cannot calculate either segment or section information, it
prints an error message and stops processing the file.
-F -
Prints out the size of each loadable segment, the permission flags of the segment,
then the total of the loadable segment sizes.
If there is no segment data,
size
prints an error message and stops
processing the file.
-f -
Prints out the size of each allocatable section, the name of the section,
and the total of the section sizes.
If there is no section data,
size
prints out an error message and stops processing the file.
-n -
Prints out non-loadable segment or non-allocatable section
sizes.
If segment data exists,
size
prints out
the memory size of each loadable segment or file size
of each non-loadable segment,
the permission flags, and the total size of the segments.
If there is no segment data,
size
prints out, for each allocatable
and non-allocatable section, the memory size, the section name,
and the total size of the sections.
If there is no segment or section data,
size
prints an error message
and stops processing.
-o -
Prints numbers in octal, not decimal.
-V -
Prints the version information for the
size
command on the standard error output.
-x -
Prints numbers in hexadecimal;
not decimal.
Examples
The examples below are typical
size output for COFF files.
size file-
28748 + 4532 + 452 = 33732
size -f file-
28748(.text) + 4532(.data) + 452(.bss) = 33732
size -F file-
28748(r-x) + 4532(rw-) + 452(rw-) = 33732
Warning
Since the size of .bss sections is not known until
link-edit time, the
size
command does not give the true total
size of pre-linked objects.
Files
/usr/ccs/bin/elf/size-
invoked for a COFF, ELF, or iBCS2 compliant object file.
See also
a.out(FP),
ar(FP),
as(CP),
cc(CP),
ld(CP)
Standards conformance
size(CP)
is not part of any
currently supported standard;
it was developed by UNIX System Laboratories, Inc. and
is used by permission.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003