This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 2/2] binutils: Add new GNU format mode to `size` utility
- From: Nick Clifton <nickc at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, binutils at sourceware dot org
- Date: Fri, 1 Feb 2019 11:18:09 +0000
- Subject: Re: [PATCH 2/2] binutils: Add new GNU format mode to `size` utility
- References: <cover.1548931650.git.andrew.burgess@embecosm.com> <274324e00d814e5fdbc598fd932a756bf88a1857.1548931650.git.andrew.burgess@embecosm.com>
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