Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

NM(1)                       General Commands Manual                      NM(1)

       nm - print symbol name list

       nm [ -gnoprsua ] [ [ filename ] ...

       nm  prints  the name list (symbol table) of each object filename in the
       argument list.  If an argument is an archive, a listing for each object
       file  in  the  archive  will be produced.  If no filename is given, the
       symbols in a.out are listed.

   Output Format
       Each symbol name is preceded by its value (blanks if undefined) and one
       of the letters:

       A      absolute

       B      bss segment symbol

       C      common symbol

       D      data segment symbol

       f      filename

       t      a static function symbol

       T      text segment symbol

       U      undefined

       -      debug, giving symbol table entries (see -a below)

       The type letter is upper case if the symbol is external, and lower case
       if it is local.  The output is sorted alphabetically.

       -a     Print all symbols.

       -g     Print only global (external) symbols.

       -n     Sort numerically rather than alphabetically.

       -o     Prepend file or archive element name to each output line  rather
              than only once.

       -p     Do not sort; print in symbol-table order.

       -r     Sort in reverse order.

       -s     Sort according to the size of the external symbol (computed from
              the difference between the value of the symbol and the value  of
              the  symbol with the next higher value).  This difference is the
              value printed.

       -u     Print only undefined symbols.

              example% nm

       prints the symbol list of the file named a.out, the default output file
       for the C, compiler.

       ar(1V), as(1), cc(1V), ld(1), tmpnam(3S), a.out(5), ar(5), coff(5)

       To see what is in a shared library, run nm on the static (.a) version.

Sun386i BUGS
       When  all  the  symbols  are printed, they must be printed in the order
       they appear in the symbol table in order to preserve  scoping  informa-
       tion.  Therefore, the -v and -n options should be used only in conjunc-
       tion with the -e option.

                               7 September 1989                          NM(1)