[PATCH 2/2] binutils: Add new GNU format mode to `size` utility
Nick Clifton
nickc@redhat.com
Fri Feb 1 11:18:00 GMT 2019
Hi Andrew,
> This commit then introduces a new output format for the size tool,
> this new format displays the results in a similar manor to the
> berkeley format, but counts read-only data in the data column, and
> only executable sections are counted in the text column.
I am waiting to see what others think of this new style output before
officially reviewing the patch, but I did have one thought which was:
would it be helpful if the read-only data was displayed in a separate
column, rather than being accumulated into the data column (or the text
column) ?
Also - blowing my own trumpet a little bit here - do you know about the
annocheck tool that currently ships as part of the annobin package in
Fedora ? It has a feature similar to the size program, except that it
has a few advantages:
* It only displays the sizes of specific sections, so if you are
not interested in, say, the data sections then these can be ignored.
* It displays a cumulative total of all of the sizes at the end of
its run.
* It can handle directories, archives and rpms.
So for example:
% annocheck --section-size=.text /usr/bin
Section '.text' found in 1497 files, total size: 0x94f0e6f
% annocheck --section-size=.text /usr/bin --verbose
[...]
Section_Size: /usr/bin/secon: .text: 0x1375
Section_Size: /usr/bin/echo: .text: 0x3722
Section_Size: /usr/bin/broadwayd: .text: 0x4a45
Section_Size: Section '.text' found in 1497 files, total size: 0x94f0e6f
% annocheck --section-size=.text --human --section-size=.rodata binnutils-2.30-48.el6.ppc64.rpm
Section_Size: Section '.rodata' found in 20 files, total size: 2Mb
Section_Size: Section '.text' found in 20 files, total size: 10Mb
Cheers
Nick
More information about the Binutils
mailing list