File: nm.1p

package info (click to toggle)
manpages-posix 1.67-3
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 9,564 kB
  • ctags: 6
  • sloc: makefile: 69; sh: 37
file content (392 lines) | stat: -rw-r--r-- 10,942 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "NM" P 2003 POSIX
.\" nm 
.SH NAME
nm \- write the name list of an object file (\fBDEVELOPMENT\fP)
.SH SYNOPSIS
.LP
\fBnm\fP \fB[\fP\fB-APv\fP\fB][\fP\fB-efox\fP\fB][\fP \fB-g| -u\fP\fB][\fP\fB-t\fP
\fIformat\fP\fB]\fP \fIfile\fP\fB... \fP
.SH DESCRIPTION
.LP
This utility shall be provided on systems that support both the User
Portability Utilities option and the Software Development
Utilities option. On other systems it is optional. Certain options
are only available on XSI-conformant systems.
.LP
The \fInm\fP utility shall display symbolic information appearing
in the object file, executable file, or object-file library
named by \fIfile\fP. If no symbolic information is available for a
valid input file, the \fInm\fP utility shall report that fact,
but not consider it an error condition.
.LP
The default base used when numeric values are written is unspecified.
\ On XSI-conformant systems, it shall be decimal. 
.SH OPTIONS
.LP
The \fInm\fP utility shall conform to the Base Definitions volume
of IEEE\ Std\ 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
.LP
The following options shall be supported:
.TP 7
\fB-A\fP
Write the full pathname or library name of an object on each line.
.TP 7
\fB-e\fP
Write only external (global) and static symbol information. 
.TP 7
\fB-f\fP
Produce full output. Write redundant symbols ( \fB.text\fP, \fB.data\fP,
and \fB.bss\fP), normally suppressed. 
.TP 7
\fB-g\fP
Write only external (global) symbol information.
.TP 7
\fB-o\fP
Write numeric values in octal (equivalent to \fB-t\ o\fP). 
.TP 7
\fB-P\fP
Write information in a portable output format, as specified in the
STDOUT section.
.TP 7
\fB-t\ \fP \fIformat\fP
Write each numeric value in the specified format. The format shall
be dependent on the single character used as the
\fIformat\fP option-argument: 
.TP 7
\fBd\fP
.RS
The offset is written in decimal   \ (default). 
.RE
.TP 7
\fBo\fP
.RS
The offset is written in octal.
.RE
.TP 7
\fBx\fP
.RS
The offset is written in hexadecimal.
.RE
.sp
.TP 7
\fB-u\fP
Write only undefined symbols.
.TP 7
\fB-v\fP
Sort output by value instead of alphabetically.
.TP 7
\fB-x\fP
Write numeric values in hexadecimal (equivalent to \fB-t\ x\fP). 
.sp
.SH OPERANDS
.LP
The following operand shall be supported:
.TP 7
\fIfile\fP
A pathname of an object file, executable file, or object-file library.
.sp
.SH STDIN
.LP
See the INPUT FILES section.
.SH INPUT FILES
.LP
The input file shall be an object file, an object-file library whose
format is the same as those produced by the \fIar\fP utility for link
editing, or an executable file. The \fInm\fP utility may accept additional
implementation-defined object library formats for the input file.
.SH ENVIRONMENT VARIABLES
.LP
The following environment variables shall affect the execution of
\fInm\fP:
.TP 7
\fILANG\fP
Provide a default value for the internationalization variables that
are unset or null. (See the Base Definitions volume of
IEEE\ Std\ 1003.1-2001, Section 8.2, Internationalization Variables
for
the precedence of internationalization variables used to determine
the values of locale categories.)
.TP 7
\fILC_ALL\fP
If set to a non-empty string value, override the values of all the
other internationalization variables.
.TP 7
\fILC_COLLATE\fP
.sp
Determine the locale for character collation information for the symbol-name
and symbol-value collation sequences.
.TP 7
\fILC_CTYPE\fP
Determine the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as
opposed to multi-byte characters in arguments).
.TP 7
\fILC_MESSAGES\fP
Determine the locale that should be used to affect the format and
contents of diagnostic messages written to standard
error.
.TP 7
\fINLSPATH\fP
Determine the location of message catalogs for the processing of \fILC_MESSAGES
\&.\fP 
.sp
.SH ASYNCHRONOUS EVENTS
.LP
Default.
.SH STDOUT
.LP
If symbolic information is present in the input files, then for each
file or for each member of an archive, the \fInm\fP
utility shall write the following information to standard output.
By default, the format is unspecified, but the output shall be
sorted alphabetically by symbol name:
.IP " *" 3
Library or object name, if \fB-A\fP is specified
.LP
.IP " *" 3
Symbol name
.LP
.IP " *" 3
Symbol type, which shall either be one of the following single characters
or an implementation-defined type represented by a
single character:
.TP 7
\fBA\fP
.RS
Global absolute symbol.
.RE
.TP 7
\fBa\fP
.RS
Local absolute symbol.
.RE
.TP 7
\fBB\fP
.RS
Global "bss" (that is, uninitialized data space) symbol.
.RE
.TP 7
\fBb\fP
.RS
Local bss symbol.
.RE
.TP 7
\fBD\fP
.RS
Global data symbol.
.RE
.TP 7
\fBd\fP
.RS
Local data symbol.
.RE
.TP 7
\fBT\fP
.RS
Global text symbol.
.RE
.TP 7
\fBt\fP
.RS
Local text symbol.
.RE
.TP 7
\fBU\fP
.RS
Undefined symbol.
.RE
.sp
.LP
.IP " *" 3
Value of the symbol
.LP
.IP " *" 3
The size associated with the symbol, if applicable
.LP
.LP
This information may be supplemented by additional information specific
to the implementation.
.LP
If the \fB-P\fP option is specified, the previous information shall
be displayed using the following portable format. The three
versions differ depending on whether \fB-t\ d\fP, \fB-t\ o\fP, or
\fB-t\ x\fP was specified, respectively:
.sp
.RS
.nf

\fB"%s%s %s %d %d\\n", <\fP\fIlibrary/object name\fP\fB>, <\fP\fIname\fP\fB>, <\fP\fItype\fP\fB>,
    <\fP\fIvalue\fP\fB>, <\fP\fIsize\fP\fB>
.sp

"%s%s %s %o %o\\n", <\fP\fIlibrary/object name\fP\fB>, <\fP\fIname\fP\fB>, <\fP\fItype\fP\fB>,
    <\fP\fIvalue\fP\fB>, <\fP\fIsize\fP\fB>
.sp

"%s%s %s %x %x\\n", <\fP\fIlibrary/object name\fP\fB>, <\fP\fIname\fP\fB>, <\fP\fItype\fP\fB>,
    <\fP\fIvalue\fP\fB>, <\fP\fIsize\fP\fB>
\fP
.fi
.RE
where <\fIlibrary/object\ name\fP> shall be formatted as follows:
.IP " *" 3
If \fB-A\fP is not specified, <\fIlibrary/object\ name\fP> shall be
an empty string.
.LP
.IP " *" 3
If \fB-A\fP is specified and the corresponding \fIfile\fP operand
does not name a library:
.sp
.RS
.nf

\fB"%s: ", <\fP\fIfile\fP\fB>
\fP
.fi
.RE
.LP
.IP " *" 3
If \fB-A\fP is specified and the corresponding \fIfile\fP operand
names a library. In this case,
<\fIobject\ file\fP> shall name the object file in the library containing
the symbol being described:
.sp
.RS
.nf

\fB"%s[%s]: ", <\fP\fIfile\fP\fB>, <\fP\fIobject file\fP\fB>
\fP
.fi
.RE
.LP
.LP
If \fB-A\fP is not specified, then if more than one \fIfile\fP operand
is specified or if only one \fIfile\fP operand is
specified and it names a library, \fInm\fP shall write a line identifying
the object containing the following symbols before the
lines containing those symbols, in the form:
.IP " *" 3
If the corresponding \fIfile\fP operand does not name a library:
.sp
.RS
.nf

\fB"%s:\\n", <\fP\fIfile\fP\fB>
\fP
.fi
.RE
.LP
.IP " *" 3
If the corresponding \fIfile\fP operand names a library; in this case,
<\fIobject\ file\fP> shall be the name of the
file in the library containing the following symbols:
.sp
.RS
.nf

\fB"%s[%s]:\\n", <\fP\fIfile\fP\fB>, <\fP\fIobject file\fP\fB>
\fP
.fi
.RE
.LP
.LP
If \fB-P\fP is specified, but \fB-t\fP is not, the format shall be
as if \fB-t\ x\fP had been specified.
.SH STDERR
.LP
The standard error shall be used only for diagnostic messages.
.SH OUTPUT FILES
.LP
None.
.SH EXTENDED DESCRIPTION
.LP
None.
.SH EXIT STATUS
.LP
The following exit values shall be returned:
.TP 7
\ 0
Successful completion.
.TP 7
>0
An error occurred.
.sp
.SH CONSEQUENCES OF ERRORS
.LP
Default.
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
Mechanisms for dynamic linking make this utility less meaningful when
applied to an executable file because a dynamically linked
executable may omit numerous library routines that would be found
in a statically linked executable.
.SH EXAMPLES
.LP
None.
.SH RATIONALE
.LP
Historical implementations of \fInm\fP have used different bases for
numeric output and supplied different default types of
symbols that were reported. The \fB-t\fP \fIformat\fP option, similar
to that used in \fIod\fP and \fIstrings\fP, can be used to specify
the numeric
base; \fB-g\fP and \fB-u\fP can be used to restrict the amount of
output or the types of symbols included in the output.
.LP
The compromise of using \fB-t\fP \fIformat\fP \fIversus\fP using \fB-d\fP,
\fB-o\fP, and other similar options was
necessary because of differences in the meaning of \fB-o\fP between
implementations. The \fB-o\fP option from BSD has been
provided here as \fB-A\fP to avoid confusion with the \fB-o\fP from
System V (which has been provided here as \fB-t\fP and as
\fB-o\fP on XSI-conformant systems).
.LP
The option list was significantly reduced from that provided by historical
implementations.
.LP
The \fInm\fP description is a subset of both the System V and BSD
\fInm\fP utilities with no specified default output.
.LP
It was recognized that mechanisms for dynamic linking make this utility
less meaningful when applied to an executable file
(because a dynamically linked executable file may omit numerous library
routines that would be found in a statically linked
executable file), but the value of \fInm\fP during software development
was judged to outweigh other limitations.
.LP
The default output format of \fInm\fP is not specified because of
differences in historical implementations. The \fB-P\fP
option was added to allow some type of portable output format. After
a comparison of the different formats used in SunOS, BSD,
SVR3, and SVR4, it was decided to create one that did not match the
current format of any of these four systems. The format devised
is easy to parse by humans, easy to parse in shell scripts, and does
not need to vary depending on locale (because no English
descriptions are included). All of the systems currently have the
information available to use this format.
.LP
The format given in \fInm\fP STDOUT uses spaces between the fields,
which may be any number of <blank>s required to align
the columns. The single-character types were selected to match historical
practice, and the requirement that implementation
additions also be single characters made parsing the information easier
for shell scripts.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fIar\fP , \fIc99\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .