1 .\" Copyright (c) 2007 Hyogeol Lee <hyogeollee@gmail.com>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer
9 .\" in this position and unchanged.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 .\" $Id: nm.1 3642 2018-10-14 14:24:28Z jkoshy $
27 .Dd September 13, 2017
32 .Nd display symbolic information in object files
37 .Op Fl -demangle Ns Op = Ns style
46 .Op Fl -print-file-name
48 .Op Fl -radix= Ns Ar format
51 .Op Fl -undefined-only
77 utility displays symbolic information in the object files,
78 executables, and object library files named by its arguments.
79 Lack of symbolic information in an otherwise valid input
80 file, is not considered to be an error.
81 If no files are specified on the command line,
88 utility recognizes the following options:
89 .Bl -tag -width ".Fl d Ar argument"
91 Display all symbols, including debugger-only symbols.
93 Display only defined symbols.
94 .It Fl -demangle Ns Op = Ns Ar style
95 Decode (demangle) low-level symbol names into human-readable names.
96 Supported values for argument
106 is not specified, it is taken to be
109 Only display dynamic symbols.
110 This option is only meaningful for shared libraries.
112 Only display information about global (external) symbols.
114 Display a help message and exit.
115 .It Fl -format Ns = Ns Ar format
116 Display output in the format specified by argument
118 Supported values for the format argument are
123 The default output format is
126 Display the filename and line number associated a symbol using
127 any debugging information present in the input file.
128 For defined symbols, look up the line number associated with
129 the address of the symbol.
130 For undefined symbols, look up the line number associated with
131 a relocation entry that refers to the symbol.
132 If line number information can be determined, it is displayed after
133 other symbol information.
135 Do not demangle symbol names (default).
139 Sort symbols numerically by address instead of alphabetically by name.
143 archives, include the index of the archive's members.
144 .It Fl -print-file-name
145 Write the full pathname or library name of an object on each line,
146 before the rest of the information for a symbol.
147 If this option is not specified,
149 will only identify an input file once, before its symbols are
152 Print the size of each symbol instead of its value.
153 .It Fl -radix Ns = Ns Ar radix
154 Print numeric values using the specified radix.
155 Supported values for argument
165 Reverse the order of the sort.
167 Sort symbols by size instead of alphabetically by name.
168 .It Fl -undefined-only
169 Display only undefined symbols.
171 Display the version identifier for
175 Equivalent to specifying option
176 .Fl -print-file-name .
178 Equivalent to specifying option
179 .Fl -format= Ns Ar bsd .
181 Equivalent to specifying option
182 .Fl -demangle Ns Op = Ns Ar style .
184 Equivalent to specifying option
187 Equivalent to specifying option
188 .Fl -format Ns = Ns Ar format .
190 Equivalent to specifying option
191 .Fl -format Ns = Ns Ar posix .
193 Equivalent to specifying option
196 Equivalent to specifying option
199 Equivalent to specifying option
202 Only display information for global and static symbols.
204 Produce full output (default).
206 Equivalent to specifying option
209 Equivalent to specifying option
212 Equivalent to specifying option
215 Equivalent to specifying option
218 If POSIX output was specified using the
222 options, this option is equivalent to specifying
223 .Fl -radix Ns = Ns Sq Ar o .
224 If POSIX output was not specified, this option
225 acts as a synonym for the
229 Equivalent to specifying option
235 Equivalent to specifying option
238 Equivalent to specifying option
241 Equivalent to specifying option
242 .Fl -radix= Ns Ar radix .
244 Equivalent to specifying option
245 .Fl -undefined-only .
247 Write numeric values in hexadecimal (equivalent to -t x).
253 utility can present its information in a number of formats, numeric
254 radices and sort orders.
257 uses BSD style output, a hexadecimal radix, without output sorted
258 alphabetically by name and without demangling of names.
260 For each symbol listed,
262 presents the following information:
265 The library or object name, if options
273 The type of the symbol denoted by a single character as below:
274 .Bl -tag -compact -width indent
276 A global, absolute symbol.
280 (uninitialized data) symbol.
284 symbol, representing uninitialized data.
286 A global symbol naming initialized data.
290 A read-only data symbol.
292 A global text symbol.
300 A local absolute symbol.
304 (uninitialized data) symbol.
308 A local read-only data symbol.
312 A weak object that is undefined.
314 A weak symbol that is undefined.
319 The value of the symbol.
321 The size of the symbol if applicable.
323 Line number information, if available and if options
339 utility and this manual page were written by
340 .An Hyogeol Lee Aq Mt hyogeollee@gmail.com .