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: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 1 Feb 2019 12:01:00 +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> <00fef81e-9a8a-a005-f80e-a9ef35fc7259@redhat.com>
* Nick Clifton <nickc@redhat.com> [2019-02-01 11:18:09 +0000]:
> 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) ?
I did consider this, I think my concern was having too many columns,
but splitting them, and having the user sum r/o and r/w data if needed
is easy enough. My immediate need is accurately counting executable
sections, so I'm flexible on splitting the data column, whatever helps
get this merged :)
>
> 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
That looks great, but does it allow filtering by section properties?
The columns of `size` are called 'text', 'data', etc, but its really
counting all executable sections '.init', '.plt', etc which is what I
need. Looking at the man page I suspect adding such a test to
annocheck would be possible, but I'd still like to get this feature
added to size if possible.
Thanks,
Andrew