This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFC] nm -u prints only sym names


Hi Nick,

On Fri, Feb 21, 2003 at 01:21:47PM +0000, Nick Clifton wrote:
> > When nm is invoked with -u it prints only the symbol names. Although
> > this does not affect the BSD and the POSIX output, it affects the
> > SYSV output, since information like sym size, type and section is
> > not printed.
> 
> Hmm, well I agree that your patch fixes this, but I am not sure that
> fixing it is the right thing to do.  The point of selecting the "sysv"
> format output option is to make the GNU binutils nm behave in the same
> way as the OS provided nm in a SystemV compatible system.  Changing
> the GNU binutils nm to provide extra information, whilst possibly
> helpful, breaks compatibility with the SystemV version.

Okay. Since this patch is not approved I have the following ideas to 
fix some problems with -u, --size-sort options.

The two main problems are that:

(a) When --size-sort is used all undefined symbols are vanished in
filter_symbols. This results to a different output; less symbols are
displayed without this behaviour been documented.

(b) When --size-sort -u is used there is no output. This is actually
a special case of problem (a).

I was hoping that printing the size of undefined symbols (which is okay
for ELFs), which in other words means that we have no problem using 
undefined symbols when sorting by size, will not break anything, but since
my patch wasn't accepted maybe we have to procceed in a different way.

So, I conclude to the following proposal:

If the above behaviour (of (a), (b)) is normal, should we document it?
At least an error must be displayed when --sort-size and -u are both used
in the command line. Otherwise, I think that nm must be modified in order
to take care the size of undefined symbols, too.

Of course, I can offer patches for whatever you think is most suitable to
do. :-)

> I suggest that what you should do, if you want to access this extra
> information, is to add a new output format option (eg "gnu").  Then if
> this format is selected you can print out as much information as you
> like, since you do not have to be compatible with anything else.

I think that nm is quite functional as is, but it may not be a bad idea
at all to move in this direction, too.

Regards,
Elias

PS. Sorry, for the long reply. :-)

-- 
University of Athens			I bet the human brain 
Physics Department				is a kludge --Marvin Minsky 

	


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]