1size(1)                          User Commands                         size(1)
2
3
4

NAME

6       size - print section sizes in bytes of object files
7

SYNOPSIS

9       size [-f] [-F] [-n] [-o] [-V] [-x] filename...
10
11

DESCRIPTION

13       The  size command produces segment or section size information in bytes
14       for each loaded section in ELF object files. size prints out  the  size
15       of the text, data, and bss (uninitialized data) segments (or  sections)
16       and their total.
17
18
19       size processes ELF object files entered on the command line. If an  ar‐
20       chive  file  is  input  to  the  size command, the information for each
21       object file in the archive is displayed.
22
23
24       When calculating segment information, the size command prints  out  the
25       total  file  size  of the non-writable segments, the total file size of
26       the writable segments, and the total memory size of the  writable  seg‐
27       ments minus the total  file size of the writable segments.
28
29
30       If  it  cannot  calculate  segment information, size calculates section
31       information. When calculating section  information, it prints  out  the
32       total  size  of  sections  that are allocatable,  non-writable, and not
33       NOBITS, the total size of the sections that are allocatable,  writable,
34       and  not  NOBITS,  and  the total size of the writable sections of type
35       NOBITS. NOBITS sections do not actually take up space in the filename.
36
37
38       If size cannot calculate either  segment  or  section  information,  it
39       prints an error message and stops processing the file.
40

OPTIONS

42       The following options are supported:
43
44       -f    Prints  out the size of each allocatable section, the name of the
45             section, and the total of the section sizes. If there is no  sec‐
46             tion  data, size prints out an error message and stops processing
47             the file.
48
49
50       -F    Prints out the size of  each  loadable  segment,  the  permission
51             flags  of  the  segment,  then  the total of the loadable segment
52             sizes. If there is no segment data, size prints an error  message
53             and stops processing the file.
54
55
56       -n    Prints out non-loadable segment or non-allocatable section sizes.
57             If segment data exists, size prints out the memory size  of  each
58             loadable  segment  or file size of each non-loadable segment, the
59             permission flags, and the total size of the segments. If there is
60             no  segment  data, size prints out, for each allocatable and non-
61             allocatable section, the memory size, the section name,  and  the
62             total  size  of  the  sections. If there is no segment or section
63             data, size prints an error message and stops processing.
64
65
66       -o    Prints numbers in octal, not decimal.
67
68
69       -V    Prints the version information for the size command on the  stan‐
70             dard error output.
71
72
73       -x    Prints numbers in hexadecimal, not decimal.
74
75

EXAMPLES

77       The examples below are typical size output.
78
79       Example 1 Producing size information
80
81         example% size filename
82         2724 + 88 + 0 = 2812
83
84
85
86       Example 2 Producing allocatable section size information
87
88         example% size -f filename
89         26(.text) + 5(.init) + 5(.fini) = 36
90
91
92
93       Example 3 Producing loadable segment size information
94
95         example% size -F filename
96         2724(r-x) + 88(rwx) + 0(rwx) = 2812 ... (If statically linked)
97
98
99

ATTRIBUTES

101       See attributes(5) for descriptions of the following attributes:
102
103
104
105
106       ┌─────────────────────────────┬─────────────────────────────┐
107       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
108       ├─────────────────────────────┼─────────────────────────────┤
109       │Availability                 │SUNWbtool                    │
110       └─────────────────────────────┴─────────────────────────────┘
111

SEE ALSO

113       as(1), ld(1), ar.h(3HEAD), a.out(4), attributes(5)
114

NOTES

116       Since  the  size of bss sections is not known until link-edit time, the
117       size command will not give the true total size of pre-linked objects.
118
119
120
121SunOS 5.11                        24 Aug 2009                          size(1)
Impressum