nm(1) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

nm(1)

nm(1)                            User Commands                           nm(1)

NAME
       nm - print name list of an object file

SYNOPSIS
       /usr/bin/nm [-ACDhlLnpPrRsTvV] [-efox] [-g | -u]
            [-t format] file...


       /usr/xpg4/bin/nm [-ACDhlLnpPrRsTvV] [-efox] [-g | -u]
            [-t format] file...

DESCRIPTION
       The  nm  utility displays the symbol table of each ELF object file that
       is specified by file.


       If no symbolic information is available for a valid input file, the  nm
       utility reports that fact, but does not consider it an error condition.

OPTIONS
       The output of nm can be controlled using the following options:

       -A           Writes  the full path name or library name of an object on
                    each line.


       -C           Demangles C++ symbol names before printing them out.


       -D           Displays the SHT_DYNSYM symbol information.  This  is  the
                    symbol  table  used  by  ld.so.1  and  is  present even in
                    stripped dynamic executables. If -D is not specified,  the
                    default  behavior  is to display the SHT_SYMTAB symbol in‐
                    formation.


       -e           See NOTES below.


       -f           See NOTES below.


       -g           Writes only external (global) symbol information.


       -h           Does not display the output heading data.


       -L           Displays the  SHT_SUNW_LDYNSYM  symbol  information.  This
                    symbol    table    contains    local   function   symbols.
                    SHT_SUNW_LDYNSM symbol tables are present even in stripped
                    dynamic executables. These symbols augment the global sym‐
                    bols that are found in SHT_DYNSYM symbol table. If  -L  is
                    not  specified,  the  default  behavior  is to display the
                    SHT_SYMTAB symbol information.


       -l           When used with the -p or -P options, distinguishes between
                    WEAK and GLOBAL symbols by appending a * to the key letter
                    for WEAK symbols.


       -n           Sorts external symbols by name before they are printed.


       -o           Prints the value and size of a symbol in octal instead  of
                    decimal (equivalent to -t  o).


       -p           Produces  easy to parse, terse output. Each symbol name is
                    preceded by its value (blanks if undefined) and one of the
                    letters:


                    A    Absolute symbol.


                    B    bss (uninitialized data space) symbol.


                    C    COMMON symbol.


                    D    Data object symbol.


                    F    File symbol.


                    N    Symbol has no type.


                    L    Thread-Local storage symbol.


                    R    Register symbol.


                    S    Section symbol.


                    T    Text symbol.


                    U    Undefined.

                    If the symbol's binding attribute is:

                    LOCAL     The key letter is lowercase.


                    WEAK      The key letter is uppercase. If the -l  modifier
                              is  specified,  the uppercase key letter is fol‐
                              lowed by a *


                    GLOBAL    The key letter is uppercase.



       -P           Writes information in a portable output format, as  speci‐
                    fied in Standard Output.


       -r           Prepends  the name of the object file or archive member to
                    each symbol name, formatted as object:symbol.


       -R           When processing archives, prepends the archive and archive
                    member  names  to   each   symbol   name,   formatted   as
                    archive:member:symbol.  When  processing non-archives, the
                    -R option is equivalent to -r. If the -r  option  is  also
                    specified, this option is ignored.


       -s           Prints section name instead of section index.


       -t format    Writes  each  numeric  value  in the specified format. The
                    format is dependent on the single character  used  as  the
                    format option-argument:

                    d    The offset is written in decimal (default).


                    o    The offset is written in octal.


                    x    The offset is written in hexadecimal.



       -T           See NOTES.


       -v           Sorts external symbols by value before they are printed.


       -V           Print version information.
       --version


       -x           Prints  the  value and size of a symbol in hexadecimal in‐
                    stead of decimal (equivalent to -t  x).


       -?           Print usage message and immediately exit.
       --help


   /usr/bin/nm
       -u    Prints undefined symbols only. If this option is  specified,  the
             -p and -P options are ignored.


   /usr/xpg4/bin/nm
       -u    Prints long listing for each undefined symbol. See OUTPUT below.



       Options can be used in any order, either singly or in combination. When
       conflicting options are specified (such as -v and -n, or -o and -x) the
       first  is  taken  and  the second ignored with a warning message to the
       user. See -R and the /usr/bin/nm form of -u for exceptions.

OPERANDS
       The following operand is supported:

       file    A path name of an object file, executable file  or  object-file
               library.


OUTPUT
       This section describes the nm utility's output options.

   Standard Output
       For each symbol, the following information is printed:

       Index          The  index  of  the symbol. (The index appears in brack‐
                      ets.)


       Value          The value of the symbol is one of the following:

                          o      A section offset for defined symbols in a re‐
                                 locatable file.


                          o      Alignment constraints for symbols whose  sec‐
                                 tion index is SHN_COMMON.


                          o      A  virtual  address in executable and dynamic
                                 library files.



       Size           The size in bytes of the associated object.


       Type           A symbol is of one of the following types:

                      NOTYPE     No type was specified.


                      OBJECT     A data object such as an array or variable.


                      FUNC       A function or other executable code.


                      REGI       A register symbol (SPARC only).


                      SECTION    A section symbol.


                      FILE       Name of the source file.


                      COMMON     An uninitialized common block.


                      TLS        A variable associated with Thread-Local stor‐
                                 age.



       Bind           The symbol's binding attributes.

                      LOCAL symbols     Have a scope  limited  to  the  object
                                        file containing their definition.


                      GLOBAL symbols    Are  visible to all object files being
                                        combined.


                      WEAK symbols      Are essentially global symbols with  a
                                        lower precedence than GLOBAL.



       Other          An integer corresponding to one of the STV_ symbol visi‐
                      bility values defined in <sys/elf.h>.


       Shndx          Except  for  three  special  values, this is the section
                      header table index in relation to which  the  symbol  is
                      defined. The following special values exist:

                      ABS       Indicates  the  symbol's value does not change
                                through relocation.


                      COMMON    Indicates an unallocated block and  the  value
                                provides alignment constraints.


                      UNDEF     Indicates an undefined symbol.



       Name           The name of the symbol.


       Object Name    The name of the object or library if -A is specified.



       If  the  -P  option is specified, the previous information is displayed
       using the following portable format. The three versions differ  depend‐
       ing on whether -t  d, -t  o, or -t  x was specified, respectively:

         "%s%s %s %d %d\n", library/object name, name, type, value, size


         "%s%s %s %o %o\n", library/object name, name, type, value, size


         "%s%s %s %x %x\n", library/object name, name, type, value, size



       where type is formatted as described for the -p option, and library/ob‐
       ject name is formatted as follows:

           o      If  -A  is  not  specified,  library/object name is an empty
                  string.


           o      If -A is specified and the corresponding file  operand  does
                  not name a library:

                    "%s: ", file



           o      If  -A is specified and the corresponding file operand names
                  a library. In this case, object file names the  object  file
                  in the library containing the symbol being described:

                    "%s[%s]: ", file, object file




       If -A is not specified, then if more than one file operand is specified
       or  if  only  one  file operand is specified and it names a library, nm
       writes a line identifying the object containing the  following  symbols
       before the lines containing those symbols, in the form:

           o      If the corresponding file operand does not name a library:

                    "%s:\n", file



           o      If  the  corresponding file operand names a library; in this
                  case, object file is the name of the  file  in  the  library
                  containing the following symbols:

                    "%s[%s]:\n", file, object file




       If  -P  is specified, but -t is not, the format is as if -t  x had been
       specified.

ENVIRONMENT VARIABLES
       See environ(7) for descriptions of the following environment  variables
       that  affect  the  execution of nm: LANG, LC_ALL, LC_COLLATE, LC_CTYPE,
       LC_MESSAGES, and NLSPATH.

EXIT STATUS
       The following exit values are returned:

       0     Successful completion.


       >0    An error occurred.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

   /usr/bin/nm
       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Availabilitydeveloper/base-developer-utilities


   /usr/xpg4/bin/nm
       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/xopen/xcu4  _  Interface  Stability‐
       Committed


SEE ALSO
       ar(1),  as(1),  dump(1),  ld(1), ld.so.1(1), ar.h(3HEAD), a.out(5), at‐
       tributes(7), environ(7), standards(7)

NOTES
       The following options are obsolete because of  changes  to  the  object
       file format and might be deleted in a future release.

       -e    Prints  only  external  and  static symbols. The symbol table now
             contains only static and external symbols. Automatic  symbols  no
             longer  appear  in the symbol table. They do appear in the debug‐
             ging information produced by cc  -g, which can be examined  using
             dump(1).


       -f    Produces  full  output.  Redundant symbols (such as .text, .data,
             and so forth), which existed previously, do not exist and produc‐
             ing full output is identical to the default output.


       -T    By default, nm prints the entire  name  of  the  symbols  listed.
             Since  symbol names have been moved to the last column, the prob‐
             lem of overflow is removed and it is no longer necessary to trun‐
             cate the symbol name.


Oracle Solaris 11.4               11 May 2021                            nm(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3