In https://reviews.llvm.org/D83152 , someone wants to have an llvm-nm option to suppress 'no symbols' diagnostic when the symbol table is absent. I think this is an area binutils may likely have an opinion so I am asking here. I can think of several choices.
* Add --no-warning-for-no-symbols.
macOS libtool has an option named -no_warning_for_no_symbols
* Add --quiet
* Drop 'no symbols' without an option. This has potential risk to make existing scripts expecting the output unhappy.
nm can also choose to do nothing but promise that it will not intentionally be incompatible with llvm-nm, i.e. if llvm-nm picks --quiet, nm will not pick --quiet for other purposes.
(In reply to Fangrui Song from comment #1)
> Patch: https://sourceware.org/pipermail/binutils/2021-February/115340.html
Patch approved - please apply.
For some strange reason I cannot find your posts for this patch in my email queue, so I was unaware that you had asked for a review. So sorry for the delay and please go ahead and apply.
The master branch has been updated by Fangrui Song <email@example.com>:
Author: Fangrui Song <firstname.lastname@example.org>
Date: Fri Feb 26 09:25:45 2021 -0800
nm: Add --quiet to suppress "no symbols" diagnostic
* readelf.c (quiet): New option flag.
(enum long_option_values): New enum to hold long option value.
(long_options): Add --quiet.
(usage): Mention --quiet.
(display_rel_file): If quiet is enabled, suppress "no symbols".
(main): Handle the new option.
* NEWS: Mention --quiet.
* docs/binutils.texi: Document --quiet.
Implemented for binutils 2.37