nm(1)									nm(1)



NAME

  nm - name list dump of object files

SYNOPSIS

  nm  [-B|-P|-S] [-abdfhnoprvwxATV] [-e|-g|-u] [-t format] [ file... ]

DESCRIPTION

  The nm command prints formatted listings of the symbol and external sec-
  tions of an object file symbol table.	 A file can be an object file, an
  archive library, or a shared library.	 If you do not specify a file, this
  command assumes a.out.

  The following list of section letters describe the information that nm gen-
  erates in the default, portable (-P), and Berkeley (-B) formats.  If a sym-
  bol is external, the type letter is uppercase.  If a symbol is local (non-
  external), the type letter is lowercase.

  A    external absolute

  a    local absolute

  B    external zeroed data

  b    local zeroed data

  C    common

  D    external initialized data

  d    local initialized data

  E    small common

  G    external small initialized data

  g    local small initialized data

  N    nil storage class, compiler internal usage

  Q    read only constants

  q    local read only constants

  R    external read only

  r    local read only

  S    external small zeroed data

  s    local small zeroed data

  T    external text

  t    local text

  U    external undefined

  V    external small undefined

  The System V format (-S) and the -a specified debug format provide an
  expanded listing with these columns:

  Name
       The symbol or external name

  Value
       Value field for the symbol or external, usually an address or
       interesting debugging information

  Class
       The symbol type

  Type
       The symbol's language declaration

  Size
       The symbol's size (accurate only for objects compiled with debugging
       information preserved as in cc -g)

  Index
       The symbol's index field

  Section
       The symbol's storage class

  NOTE: In the System V (-S) format, every effort was made to map the field's
  functionality into System V nomenclature.

FLAGS

  The nm command accepts these options:

  -a  Prints debugging information using System V format

  -b  For Berkeley (-B) format only, prints the value field in octal.
      Equivalent to -t o.

  -d  Prints the value field in decimal (default for System V and default
      output formats). Equivalent to -t d.

  -e  Prints external and statics only

  -f  Produces full output. (The nm command still accepts this old option,
      but ignores it.)

  -g  Prints only global symbols

  -h  Does not print headers

  -n  For Berkeley (-B) format, sorts all symbols by value. For all other
      formats, sorts external symbols by name (default for Berkeley).

  -o  Prints the value field in octal for all formats except Berkeley (-B).
      (Equivalent to -t o.)  For Berkeley format, prepends the filename to
      each symbol. (Equivalent to -A)

  -p  Prints symbols as they are found in the file (the System V default)

  -r  Reverses the sense of a value or name sort

  -t format
      Write each numeric value in the specified format as follows:

	  d   The offset is written in decimal (default for System V and
	      default output formats). Equivalent to -d.

	  o   The offset is written in octal. Equivalent to -o.

	  x   The offset is written in hexadecimal (default for Berkeley and
	      portable formats). Equivalent to -x.

  -u  Prints only undefined symbols

  -v  Sorts external symbols by value

  -w  Identifies weak symbols using an asterisk (*). For the default, port-
      able (-P), and Berkeley (-B) formats, the asterisk follows the symbol
      type letter. For System V (-S), an additional column is added to the
      end of each line containing an asterisk for weak symbols.

  -x  Prints value field in hexadecimal (default for Berkeley and portable
      formats).	 Equivalent to -t x.

  -A  Prepends the filename to each symbol. This is useful for using the grep
      command to check through nm listings of libraries.

  -B  Prints Berkeley (4.3 BSD)-style output. This format produces an address
      or value field followed by a letter showing what section the symbol or
      external is located in. The third and final field is the name of the
      symbol or external.

  -P  Prints output in a portable format. This format prints lines containing
      each symbol's name, type (single letter), value, and size.

  -S  Prints AT&T System V-style output.

  -T  Truncates long names, inserting a `*' as the last printed character

  -V  Prints version information on stderr

RELATED INFORMATION

  Programmer's Guide
  Assembly Language Programmer's Guide