Annotation of src/usr.bin/nm/nm.1, Revision 1.21
1.21 ! jmc 1: .\" $OpenBSD: nm.1,v 1.20 2007/08/06 19:16:06 sobrado Exp $
1.1 deraadt 2: .\" $NetBSD: nm.1,v 1.3 1995/08/31 23:41:58 jtc Exp $
3: .\"
4: .\" Copyright (c) 1980, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.12 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)nm.1 8.1 (Berkeley) 6/6/93
32: .\"
1.20 sobrado 33: .Dd $Mdocdate: May 31 2007 $
1.1 deraadt 34: .Dt NM 1
1.4 aaron 35: .Os
1.1 deraadt 36: .Sh NAME
37: .Nm nm
38: .Nd display name list (symbol table)
39: .Sh SYNOPSIS
40: .Nm nm
1.13 mickey 41: .Op Fl aCegnoprsuVw
1.20 sobrado 42: .Op Ar
1.1 deraadt 43: .Sh DESCRIPTION
44: The symbol table (name list) of each object in
45: .Ar file(s)
46: is displayed.
47: If a library (archive) is given,
1.4 aaron 48: .Nm
1.1 deraadt 49: displays a list for each
50: object archive member.
51: If
52: .Ar file
53: is not present,
54: .Nm
55: searches for the file
56: .Pa a.out
1.5 aaron 57: and displays its symbol table if it exists.
58: .Pp
59: The options are as follows:
1.6 aaron 60: .Bl -tag -width Ds
1.1 deraadt 61: .It Fl a
62: Display symbol table entries inserted for use by debuggers.
1.7 espie 63: .It Fl C
1.14 jmc 64: Decode low-level symbol names.
65: This involves removing extra underscores and making C++ function names readable.
1.11 espie 66: .It Fl e
67: Output extended information, that is `w' for weak symbols, `f' for
68: function-like symbols, and `o' for object-like symbols.
1.1 deraadt 69: .It Fl g
70: Restrict display to external (global) symbols.
71: .It Fl n
72: Present results in numerical order.
73: .It Fl o
74: Display full path or library name of object on every line.
75: .It Fl p
76: Do not sort at all.
77: .It Fl r
78: Reverse order sort.
1.13 mickey 79: .It Fl s
80: Show archive index.
1.1 deraadt 81: .It Fl u
82: Display undefined symbols only.
1.13 mickey 83: .It Fl V
84: Show program version.
1.1 deraadt 85: .It Fl w
86: Warn about non-object archive members.
1.3 aaron 87: Normally,
88: .Nm nm
89: will silently ignore all archive members which are not
1.1 deraadt 90: object files.
91: .El
92: .Pp
93: Each symbol name is preceded by its value (a blank field if the symbol
94: is undefined) and one of the following letters:
95: .Pp
96: .Bl -tag -width Ds -compact -offset indent
97: .It Fl
98: debugger symbol table entries (see the
99: .Fl a
1.14 jmc 100: option)
1.1 deraadt 101: .It Li A
102: absolute
103: .It Li B
104: bss segment symbol
105: .It Li C
106: common symbol
107: .It Li D
108: data segment symbol
1.10 fgsch 109: .It Li I
110: indirect reference (alias to other symbol)
1.15 jmc 111: .It Li F
1.1 deraadt 112: file name
1.18 mickey 113: .It Li R
114: read-only data segment symbol
1.1 deraadt 115: .It Li T
116: text segment symbol
117: .It Li U
118: undefined
1.16 mjc 119: .It Li W
120: weak symbol (only on ELF binaries)
1.1 deraadt 121: .El
122: .Pp
1.14 jmc 123: If the symbol is local (non-external), the type letter is in lower case.
1.1 deraadt 124: The output is sorted alphabetically.
125: .Sh SEE ALSO
126: .Xr ar 1 ,
1.17 mickey 127: .Xr size 1 ,
1.3 aaron 128: .Xr a.out 5 ,
1.1 deraadt 129: .Xr ar 5 ,
1.13 mickey 130: .Xr elf 5 ,
1.1 deraadt 131: .Xr stab 5
1.21 ! jmc 132: .Sh STANDARDS
! 133: The
! 134: .Nm
! 135: utility appears as an optional part of
! 136: .St -p1003.1-2008 ;
! 137: this incarnation of
! 138: .Nm
! 139: appears largely incompatible with that standard.
1.1 deraadt 140: .Sh HISTORY
141: An
142: .Nm nm
143: command appeared in
144: .At v6 .