nm: use -U as an alias for --defines-only, in line with llvm-nm
This commit is contained in:
parent
b00d6678f6
commit
aa02037b08
2 changed files with 40 additions and 29 deletions
|
@ -817,10 +817,9 @@ nm [@option{-A}|@option{-o}|@option{--print-file-name}]
|
||||||
[@option{-s}|@option{--print-armap}]
|
[@option{-s}|@option{--print-armap}]
|
||||||
[@option{-t} @var{radix}|@option{--radix=}@var{radix}]
|
[@option{-t} @var{radix}|@option{--radix=}@var{radix}]
|
||||||
[@option{-u}|@option{--undefined-only}]
|
[@option{-u}|@option{--undefined-only}]
|
||||||
[@option{-U} @var{method}] [@option{--unicode=}@var{method}]
|
[@option{-U}|@option{--defined-only}]
|
||||||
[@option{-V}|@option{--version}]
|
[@option{-V}|@option{--version}]
|
||||||
[@option{-X 32_64}]
|
[@option{-X 32_64}]
|
||||||
[@option{--defined-only}]
|
|
||||||
[@option{--no-demangle}]
|
[@option{--no-demangle}]
|
||||||
[@option{--no-recurse-limit}|@option{--recurse-limit}]]
|
[@option{--no-recurse-limit}|@option{--recurse-limit}]]
|
||||||
[@option{--plugin} @var{name}]
|
[@option{--plugin} @var{name}]
|
||||||
|
@ -828,6 +827,7 @@ nm [@option{-A}|@option{-o}|@option{--print-file-name}]
|
||||||
[@option{--special-syms}]
|
[@option{--special-syms}]
|
||||||
[@option{--synthetic}]
|
[@option{--synthetic}]
|
||||||
[@option{--target=}@var{bfdname}]
|
[@option{--target=}@var{bfdname}]
|
||||||
|
[@option{--unicode=}@var{method}]
|
||||||
[@option{--with-symbol-versions}]
|
[@option{--with-symbol-versions}]
|
||||||
[@option{--without-symbol-versions}]
|
[@option{--without-symbol-versions}]
|
||||||
[@var{objfile}@dots{}]
|
[@var{objfile}@dots{}]
|
||||||
|
@ -1137,21 +1137,14 @@ Use @var{radix} as the radix for printing the symbol values. It must be
|
||||||
@cindex external symbols
|
@cindex external symbols
|
||||||
@cindex undefined symbols
|
@cindex undefined symbols
|
||||||
Display only undefined symbols (those external to each object file).
|
Display only undefined symbols (those external to each object file).
|
||||||
|
By default both defined and undefined symbols are displayed.
|
||||||
|
|
||||||
@item -U @var{[d|i|l|e|x|h]}
|
@item -U
|
||||||
@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
|
@itemx --defined-only
|
||||||
Controls the display of UTF-8 encoded multibyte characters in strings.
|
@cindex external symbols
|
||||||
The default (@option{--unicode=default}) is to give them no special
|
@cindex undefined symbols
|
||||||
treatment. The @option{--unicode=locale} option displays the sequence
|
Display only defined symbols for each object file.
|
||||||
in the current locale, which may or may not support them. The options
|
By default both defined and undefined symbols are displayed.
|
||||||
@option{--unicode=hex} and @option{--unicode=invalid} display them as
|
|
||||||
hex byte sequences enclosed by either angle brackets or curly braces.
|
|
||||||
|
|
||||||
The @option{--unicode=escape} option displays them as escape sequences
|
|
||||||
(@var{\uxxxx}) and the @option{--unicode=highlight} option displays
|
|
||||||
them as escape sequences highlighted in red (if supported by the
|
|
||||||
output device). The colouring is intended to draw attention to the
|
|
||||||
presence of unicode sequences where they might not be expected.
|
|
||||||
|
|
||||||
@item -V
|
@item -V
|
||||||
@itemx --version
|
@itemx --version
|
||||||
|
@ -1163,11 +1156,6 @@ This option is ignored for compatibility with the AIX version of
|
||||||
@option{32_64}. The default mode of AIX @command{nm} corresponds
|
@option{32_64}. The default mode of AIX @command{nm} corresponds
|
||||||
to @option{-X 32}, which is not supported by @sc{gnu} @command{nm}.
|
to @option{-X 32}, which is not supported by @sc{gnu} @command{nm}.
|
||||||
|
|
||||||
@item --defined-only
|
|
||||||
@cindex external symbols
|
|
||||||
@cindex undefined symbols
|
|
||||||
Display only defined symbols for each object file.
|
|
||||||
|
|
||||||
@item --plugin @var{name}
|
@item --plugin @var{name}
|
||||||
@cindex plugins
|
@cindex plugins
|
||||||
Load the plugin called @var{name} to add support for extra target
|
Load the plugin called @var{name} to add support for extra target
|
||||||
|
@ -1196,6 +1184,9 @@ with the next higher value. If the @code{bsd} output format is used
|
||||||
the size of the symbol is printed, rather than the value, and
|
the size of the symbol is printed, rather than the value, and
|
||||||
@samp{-S} must be used in order both size and value to be printed.
|
@samp{-S} must be used in order both size and value to be printed.
|
||||||
|
|
||||||
|
Note - this option does not work if @option{--undefined-only} has been
|
||||||
|
enabled as undefined symbols have no size.
|
||||||
|
|
||||||
@item --special-syms
|
@item --special-syms
|
||||||
Display symbols which have a target-specific special meaning. These
|
Display symbols which have a target-specific special meaning. These
|
||||||
symbols are usually used by the target for some special processing and
|
symbols are usually used by the target for some special processing and
|
||||||
|
@ -1208,6 +1199,20 @@ Include synthetic symbols in the output. These are special symbols
|
||||||
created by the linker for various purposes. They are not shown by
|
created by the linker for various purposes. They are not shown by
|
||||||
default since they are not part of the binary's original source code.
|
default since they are not part of the binary's original source code.
|
||||||
|
|
||||||
|
@item --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
|
||||||
|
Controls the display of UTF-8 encoded multibyte characters in strings.
|
||||||
|
The default (@option{--unicode=default}) is to give them no special
|
||||||
|
treatment. The @option{--unicode=locale} option displays the sequence
|
||||||
|
in the current locale, which may or may not support them. The options
|
||||||
|
@option{--unicode=hex} and @option{--unicode=invalid} display them as
|
||||||
|
hex byte sequences enclosed by either angle brackets or curly braces.
|
||||||
|
|
||||||
|
The @option{--unicode=escape} option displays them as escape sequences
|
||||||
|
(@var{\uxxxx}) and the @option{--unicode=highlight} option displays
|
||||||
|
them as escape sequences highlighted in red (if supported by the
|
||||||
|
output device). The colouring is intended to draw attention to the
|
||||||
|
presence of unicode sequences where they might not be expected.
|
||||||
|
|
||||||
@item --with-symbol-versions
|
@item --with-symbol-versions
|
||||||
@item --without-symbol-versions
|
@item --without-symbol-versions
|
||||||
Enables or disables the display of symbol version information. The
|
Enables or disables the display of symbol version information. The
|
||||||
|
|
|
@ -242,6 +242,7 @@ enum long_option_values
|
||||||
OPTION_RECURSE_LIMIT,
|
OPTION_RECURSE_LIMIT,
|
||||||
OPTION_NO_RECURSE_LIMIT,
|
OPTION_NO_RECURSE_LIMIT,
|
||||||
OPTION_IFUNC_CHARS,
|
OPTION_IFUNC_CHARS,
|
||||||
|
OPTION_UNICODE,
|
||||||
OPTION_QUIET
|
OPTION_QUIET
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -276,9 +277,9 @@ static struct option long_options[] =
|
||||||
{"special-syms", no_argument, &allow_special_symbols, 1},
|
{"special-syms", no_argument, &allow_special_symbols, 1},
|
||||||
{"synthetic", no_argument, &show_synthetic, 1},
|
{"synthetic", no_argument, &show_synthetic, 1},
|
||||||
{"target", required_argument, 0, OPTION_TARGET},
|
{"target", required_argument, 0, OPTION_TARGET},
|
||||||
{"defined-only", no_argument, &defined_only, 1},
|
{"defined-only", no_argument, 0, 'U'},
|
||||||
{"undefined-only", no_argument, &undefined_only, 1},
|
{"undefined-only", no_argument, 0, 'u'},
|
||||||
{"unicode", required_argument, NULL, 'U'},
|
{"unicode", required_argument, NULL, OPTION_UNICODE},
|
||||||
{"version", no_argument, &show_version, 1},
|
{"version", no_argument, &show_version, 1},
|
||||||
{"with-symbol-versions", no_argument, &with_symbol_versions, 1},
|
{"with-symbol-versions", no_argument, &with_symbol_versions, 1},
|
||||||
{"without-symbol-versions", no_argument, &with_symbol_versions, 0},
|
{"without-symbol-versions", no_argument, &with_symbol_versions, 0},
|
||||||
|
@ -311,8 +312,6 @@ usage (FILE *stream, int status)
|
||||||
--no-recurse-limit Disable a demangling recursion limit.\n"));
|
--no-recurse-limit Disable a demangling recursion limit.\n"));
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
-D, --dynamic Display dynamic symbols instead of normal symbols\n"));
|
-D, --dynamic Display dynamic symbols instead of normal symbols\n"));
|
||||||
fprintf (stream, _("\
|
|
||||||
--defined-only Display only defined symbols\n"));
|
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
-e (ignored)\n"));
|
-e (ignored)\n"));
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
|
@ -361,8 +360,10 @@ usage (FILE *stream, int status)
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
-u, --undefined-only Display only undefined symbols\n"));
|
-u, --undefined-only Display only undefined symbols\n"));
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
-U {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\
|
-U, --defined-only Display only defined symbols\n"));
|
||||||
--unicode={default|show|invalid|hex|escape|highlight}\n"));
|
fprintf (stream, _("\
|
||||||
|
--unicode={default|show|invalid|hex|escape|highlight}\n\
|
||||||
|
Specify how to treat UTF-8 encoded unicode characters\n"));
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
--with-symbol-versions Display version strings after symbol names\n"));
|
--with-symbol-versions Display version strings after symbol names\n"));
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
|
@ -2143,9 +2144,14 @@ main (int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
undefined_only = 1;
|
undefined_only = 1;
|
||||||
|
defined_only = 0;
|
||||||
|
break;
|
||||||
|
case 'U':
|
||||||
|
defined_only = 1;
|
||||||
|
undefined_only = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'U':
|
case OPTION_UNICODE:
|
||||||
if (streq (optarg, "default") || streq (optarg, "d"))
|
if (streq (optarg, "default") || streq (optarg, "d"))
|
||||||
unicode_display = unicode_default;
|
unicode_display = unicode_default;
|
||||||
else if (streq (optarg, "locale") || streq (optarg, "l"))
|
else if (streq (optarg, "locale") || streq (optarg, "l"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue