'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. .TH size 1 "9 Sep 2013" "SunOS 5.11" "User Commands" .SH NAME size \- print section sizes in bytes of object files .SH SYNOPSIS .LP .nf \fBsize\fR [\fB-f\fR] [\fB-F\fR] [\fB-n\fR] [\fB-o\fR] [\fB-V\fR] [\fB-x\fR] \fIfilename\fR... .fi .SH DESCRIPTION .sp .LP The \fBsize\fR command produces segment or section size information in bytes for each loaded section in ELF object files. \fBsize\fR prints the size of the text, data, and bss (uninitialized data) segments (or sections) and their total. .sp .LP \fBsize\fR processes ELF object files entered on the command line. If an archive file is input to the \fBsize\fR command, the information for each object file in the archive is displayed. .sp .LP When calculating segment information, the \fBsize\fR command prints 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. .sp .LP If it cannot calculate segment information, \fBsize\fR calculates section information. When calculating section information, it prints the total size of sections that are allocatable, non-writable, and not \fBNOBITS\fR, the total size of the sections that are allocatable, writable, and not \fBNOBITS\fR, and the total size of the writable sections of type \fBNOBITS\fR. \fBNOBITS\fR sections do not actually take up space in the \fIfilename\fR. .sp .LP If \fBsize\fR cannot calculate either segment or section information, it prints an error message. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-f\fR\fR .ad .RS 6n .rt Prints the size of each allocatable section, the name of the section, and the total of the section sizes. If there is no section data, \fBsize\fR prints an error message. .RE .sp .ne 2 .mk .na \fB\fB-F\fR\fR .ad .RS 6n .rt Prints 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, \fBsize\fR prints an error message. .RE .sp .ne 2 .mk .na \fB\fB-n\fR\fR .ad .RS 6n .rt Prints non-loadable segment or non-allocatable section sizes. If segment data exists, \fBsize\fR prints 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, \fBsize\fR prints, 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, \fBsize\fR prints an error message. .RE .sp .ne 2 .mk .na \fB\fB-o\fR\fR .ad .RS 6n .rt Prints numbers in octal, not decimal. .RE .sp .ne 2 .mk .na \fB\fB-V\fR\fR .ad .RS 6n .rt Prints the version information for the \fBsize\fR command on the standard error output. .RE .sp .ne 2 .mk .na \fB\fB-x\fR\fR .ad .RS 6n .rt Prints numbers in hexadecimal, not decimal. .RE .SH EXAMPLES .sp .LP The examples below are typical \fBsize\fR output. .LP \fBExample 1 \fRProducing size information .sp .in +2 .nf example% \fBsize \fIfilename\fR\fR 2724 + 88 + 0 = 2812 .fi .in -2 .sp .LP \fBExample 2 \fRProducing allocatable section size information .sp .in +2 .nf example% \fBsize -f \fIfilename\fR\fR 26(.text) + 5(.init) + 5(.fini) = 36 .fi .in -2 .sp .LP \fBExample 3 \fRProducing loadable segment size information .sp .in +2 .nf example% \fBsize -F \fIfilename\fR\fR 2724(r-x) + 88(rwx) + 0(rwx) = 2812 ... \fI(If statically linked)\fR .fi .in -2 .sp .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitydeveloper/base-developer-utilities .TE .SH SEE ALSO .sp .LP \fBas\fR(1), \fBld\fR(1), \fBar.h\fR(3HEAD), \fBa.out\fR(4), \fBattributes\fR(5) .SH NOTES .sp .LP Since the size of bss sections is not known until an executable or shared object is created, the \fBsize\fR command will not give the true total size of relocatable objects.