[Patch] readelf -c dump archive index like nm -s
Shen Feng
shen@cn.fujitsu.com
Mon Sep 3 05:07:00 GMT 2007
Hi Nick,
>
> Thanks very much for submitting this patch. Do you have a binutils
> copyright assignment on file with the FSF ? (I looked but did not find
> one). Without one we unfortunately cannot accept the patch.
I sent the information to fsf-records@gnu.org. Is that right?
>
> One question in particular comes to mind - why do you want this feature
> in readelf ? Since it can already be done by "nm -s", as you have
> pointed out, what purpose is served by adding this ability to readelf ?
nm uses BFD library but readelf doesn't.
I also found a FIXME about this when I read the readelf source code.
Thank you for your comments and I will fix it.
But I have one question.
>
> * The format of the output is not particularly pretty. I agree
> that it is the same format as provided by nm, but I am not sure
> that is such a good idea. Maybe if the output was alpha sorted
> (on object file and then symbol name) and indented to some degree
> then it would be more useful. eg:
>
> Index of archive foo.a:
> Binary bar.o contains:
> a_sym
> b_sym
> d_sym
> Binary baz.o contains:
> c_sym
> e_sym
>
Now readelf rarely sorts any symbols. Does the archive index need to be sorted?
Maybe a text processing command such as sort can do it. So the format maybe
the same as you suggested, but without alpha sorted on object file and symbol
name. Do you think so?
Best Regards,
Shen Feng
More information about the Binutils
mailing list