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: nm and objdump when no symbols


Hi Alan,

> nm and objdump both display "filename: no symbols" to stderr when
> given an object without any syms.  Why?  In particular, why print
> to stderr?

So that if the command is part of a pipe, the error message will be
seen.  Imagine the situation where you are doing:

        objdump -dw -mi8086 dumo.o | grep foo

Without the error message going to stderr you might think that there
are no occurences of the symbol 'foo', rather than realising that you
made a typo and that you actually wanted to examine the contents of
the file 'foo.o' and not dump.o.

> I propose changing the behavior to printing the "no symbols"
> message only when a symbol table dump is requested,

This seems very reasonable.

> and printing the message to stdout.  Objections?

I think that error messages should be sent to stderr and not stdout.

Cheers
        Nick


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