mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
Move printing from bfd to nm and add POSIX and SysV compatibility.
This commit is contained in:
@ -633,28 +633,85 @@ The GNU linker @code{ld} is now described in a separate manual.
|
|||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
nm [ -a | --debug-syms ] [ -g | --extern-only ]
|
nm [ -a | --debug-syms ] [ -g | --extern-only ]
|
||||||
[ -s | --print-armap ] [ -o | --print-file-name ]
|
[ -s | --print-armap ] [ -A | -o | --print-file-name ]
|
||||||
[ -n | --numeric-sort ] [ -p | --no-sort ]
|
[ -n | -v | --numeric-sort ] [ -p | --no-sort ]
|
||||||
[ -r | --reverse-sort ] [ -u | --undefined-only ]
|
[ -r | --reverse-sort ] [ -u | --undefined-only ]
|
||||||
[ --target=@var{bfdname} ]
|
[ -t @var{radix} | --radix=@var{radix} ] [ -P | --portability ]
|
||||||
[ @var{objfile}@dots{} ]
|
[ --target=@var{bfdname} ] [ -f @var{format} | --format=@var{format} ]
|
||||||
|
[ -V | --version ] [ @var{objfile}@dots{} ]
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
GNU @code{nm} lists the symbols from object files @var{objfile}@dots{}.
|
GNU @code{nm} lists the symbols from object files @var{objfile}@dots{}.
|
||||||
|
If no object files are listed as arguments, @code{nm} assumes
|
||||||
|
@file{a.out}.
|
||||||
|
|
||||||
|
For each symbol, @code{nm} shows:
|
||||||
|
|
||||||
|
@itemize @bullet
|
||||||
|
@item
|
||||||
|
The symbol value, in the radix selected by options (see below), or
|
||||||
|
hexadecimal by default.
|
||||||
|
|
||||||
|
@item
|
||||||
|
The symbol type. At least the following types are used; others are, as
|
||||||
|
well, depending on the object file format. If lowercase, the symbol is
|
||||||
|
local; if uppercase, the symbol is global (external).
|
||||||
|
|
||||||
|
@c Some more detail on exactly what these symbol types are used for
|
||||||
|
@c would be nice.
|
||||||
|
@table @code
|
||||||
|
@item A
|
||||||
|
Absolute.
|
||||||
|
|
||||||
|
@item B
|
||||||
|
BSS (uninitialized data).
|
||||||
|
|
||||||
|
@item C
|
||||||
|
Common.
|
||||||
|
|
||||||
|
@item D
|
||||||
|
Initialized data.
|
||||||
|
|
||||||
|
@item I
|
||||||
|
Indirect reference.
|
||||||
|
|
||||||
|
@item T
|
||||||
|
Text (program code).
|
||||||
|
|
||||||
|
@item U
|
||||||
|
Undefined.
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@item
|
||||||
|
The symbol name.
|
||||||
|
@end itemize
|
||||||
|
|
||||||
The long and short forms of options, shown here as alternatives, are
|
The long and short forms of options, shown here as alternatives, are
|
||||||
equivalent.
|
equivalent.
|
||||||
|
|
||||||
@table @code
|
@table @code
|
||||||
@item @var{objfile}@dots{}
|
@item -A
|
||||||
@kindex a.out
|
@itemx -o
|
||||||
Object files whose symbols are to be listed. If no object files are
|
@itemx --print-file-name
|
||||||
listed as arguments, @code{nm} assumes @samp{a.out}.
|
@cindex input file name
|
||||||
|
@cindex file name
|
||||||
|
@cindex source file name
|
||||||
|
Precede each symbol by the name of the input file (or archive element)
|
||||||
|
in which it was found, rather than identifying the input file once only,
|
||||||
|
before all of its symbols.
|
||||||
|
|
||||||
@item -a
|
@item -a
|
||||||
@itemx --debug-syms
|
@itemx --debug-syms
|
||||||
@cindex debugging symbols
|
@cindex debugging symbols
|
||||||
Display debugger-only symbols; normally these are not listed.
|
Display all symbols, even debugger-only symbols; normally these are not
|
||||||
|
listed.
|
||||||
|
|
||||||
|
@item -f @var{format}
|
||||||
|
@itemx --format=@var{format}
|
||||||
|
Use the output format @var{format}, which can be @code{bsd},
|
||||||
|
@code{sysv}, or @code{posix}. The default is @code{bsd}.
|
||||||
|
Only the first character of @var{format} is significant, it can be
|
||||||
|
either upper or lower case.
|
||||||
|
|
||||||
@item -g
|
@item -g
|
||||||
@itemx --extern-only
|
@itemx --extern-only
|
||||||
@ -664,10 +721,16 @@ Display only external symbols.
|
|||||||
@item -p
|
@item -p
|
||||||
@itemx --no-sort
|
@itemx --no-sort
|
||||||
@cindex sorting symbols
|
@cindex sorting symbols
|
||||||
Don't bother to sort the symbols in any order; just print them in the
|
Don't bother to sort the symbols in any order; print them in the order
|
||||||
order encountered.
|
encountered.
|
||||||
|
|
||||||
|
@item -P
|
||||||
|
@itemx --portability
|
||||||
|
Use the POSIX.2 standard output format instead of the default format.
|
||||||
|
Equivalent to @samp{-f posix}.
|
||||||
|
|
||||||
@item -n
|
@item -n
|
||||||
|
@itemx -v
|
||||||
@itemx --numeric-sort
|
@itemx --numeric-sort
|
||||||
Sort symbols numerically by their addresses, rather than alphabetically
|
Sort symbols numerically by their addresses, rather than alphabetically
|
||||||
by their names.
|
by their names.
|
||||||
@ -679,26 +742,20 @@ When listing symbols from archive members, include the index: a mapping
|
|||||||
(stored in the archive by @code{ar} or @code{ranlib}) of which modules
|
(stored in the archive by @code{ar} or @code{ranlib}) of which modules
|
||||||
contain definitions for which names.
|
contain definitions for which names.
|
||||||
|
|
||||||
@item -o
|
|
||||||
@itemx --print-file-name
|
|
||||||
@cindex input file name
|
|
||||||
@cindex file name
|
|
||||||
@cindex source file name
|
|
||||||
Precede each symbol by the name of the input file where it was found,
|
|
||||||
rather than identifying the input file once only before all of its
|
|
||||||
symbols.
|
|
||||||
|
|
||||||
@item -r
|
@item -r
|
||||||
@itemx --reverse-sort
|
@itemx --reverse-sort
|
||||||
Reverse the order of the sort (whether numeric or alphabetic); let the
|
Reverse the order of the sort (whether numeric or alphabetic); let the
|
||||||
last come first.
|
last come first.
|
||||||
|
|
||||||
|
@item -t @var{radix}
|
||||||
|
@itemx --radix=@var{radix}
|
||||||
|
Use @var{radix} as the radix for printing the symbol values. It must be
|
||||||
|
@samp{d} for decimal, @samp{o} for octal, or @samp{x} for hexadecimal.
|
||||||
|
|
||||||
@item --target=@var{bfdname}
|
@item --target=@var{bfdname}
|
||||||
@c @item --target
|
|
||||||
@cindex object code format
|
@cindex object code format
|
||||||
Specify an object code format other than your system's default format.
|
Specify an object code format other than your system's default format.
|
||||||
@xref{objdump}, for information on listing available formats.
|
@xref{objdump}, for information on listing available formats.
|
||||||
@c FIXME what *does* --target/no arg do?
|
|
||||||
|
|
||||||
@item -u
|
@item -u
|
||||||
@itemx --undefined-only
|
@itemx --undefined-only
|
||||||
@ -706,6 +763,9 @@ Specify an object code format other than your system's default format.
|
|||||||
@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).
|
||||||
|
|
||||||
|
@item -V
|
||||||
|
@itemx --version
|
||||||
|
Show the version number of @code{nm}.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node objdump, ranlib, nm, Top
|
@node objdump, ranlib, nm, Top
|
||||||
|
Reference in New Issue
Block a user