Since 2018-07 (https://reviews.llvm.org/D48751), https://llvm.org/docs/CommandGuide/llvm-nm.html supports --no-weak for listing non-weak symbols. The short option -W is added as an alias. I think the option is mildly useful and perhaps binutils can consider adding it as well. llvm-nm aims for being compatible with GNU nm, so taking -W without asking for binutils opinions was not great. (Due to the recent -U conflict, llvm-nm folks should be more aware of using short options and will handle such issues better.)
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2c3cc81e068464b5a3d5bf19a9cf3cf3dd6b7b55 commit 2c3cc81e068464b5a3d5bf19a9cf3cf3dd6b7b55 Author: Nick Clifton <nickc@redhat.com> Date: Wed May 18 13:15:22 2022 +0100 Add a --no-weak option to nm. PR 29135 * nm.c (non_weak): New variable. (filter_symbols): When non-weak is true, ignore weak symbols. (long_options): Add --no-weak. (usage): Mention --no-weak. (main): Handle -W/--no-weak. * doc/binutils.texi: Document new feature. * NEWS: Mention the new feature. * testsuite/binutils-all/nm.exp: Add test of new feature. * testsuite/binutils-all/no-weak.s: New test source file.
I have added the --no-weak option to nm.