size - print section sizes in bytes of object files
size [-f] [-F] [-n] [-o] [-V] [-x] filename...
The size command produces segment or section size information in bytes for each loaded section in ELF object files. size prints out the size of the text, data, and bss (uninitialized data) segments (or sections) and their total.
size processes ELF 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 filename.
If size cannot calculate either segment or section information, it prints an error message and stops processing the file.
The following options are supported:
-f
-F
-n
-o
-V
-x
The examples below are typical size output.
Example 1 Producing size information
example% size filename 2724 + 88 + 0 = 2812
Example 2 Producing allocatable section size information
example% size -f filename 26(.text) + 5(.init) + 5(.fini) = 36
Example 3 Producing loadable segment size information
example% size -F filename 2724(r-x) + 88(rwx) + 0(rwx) = 2812 ... (If statically linked)
See attributes(5) for descriptions of the following attributes:
|
as(1), cc(1B), ld(1), ar.h(3HEAD), a.out(4), attributes(5)
Since the size of bss sections is not known until link-edit time, the size command will not give the true total size of pre-linked objects.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |