logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

nm.1p (11212B)


  1. '\" et
  2. .TH NM "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. nm
  12. \(em write the name list of an object file (\fBDEVELOPMENT\fP)
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. nm \fB[\fR-APv\fB] [\fR-g|-u\fB] [\fR-t \fIformat\fB] \fIfile\fR...
  17. nm \fB[\fR-APv\fB] [\fR-efox\fB] [\fR-g|-u\fB] [\fR-t \fIformat\fB]\fI file\fR...
  18. .fi
  19. .SH DESCRIPTION
  20. The
  21. .IR nm
  22. utility shall display symbolic information appearing in the object
  23. file, executable file, or object-file library named by
  24. .IR file .
  25. If no symbolic information is available for a valid input file, the
  26. .IR nm
  27. utility shall report that fact, but not consider it an error
  28. condition.
  29. .P
  30. The default base used when numeric values are written is unspecified.
  31. On XSI-conformant systems, it shall be decimal if the
  32. .BR \-P
  33. option is not specified.
  34. .SH OPTIONS
  35. The
  36. .IR nm
  37. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  38. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  39. .P
  40. The following options shall be supported:
  41. .IP "\fB\-A\fP" 10
  42. Write the full pathname or library name of an object on each line.
  43. .IP "\fB\-e\fP" 10
  44. Write only external (global) and static symbol information.
  45. .IP "\fB\-f\fP" 10
  46. Produce full output. Write redundant symbols (\c
  47. .BR .text ,
  48. .BR .data ,
  49. and
  50. .BR .bss ),
  51. normally suppressed.
  52. .IP "\fB\-g\fP" 10
  53. Write only external (global) symbol information.
  54. .IP "\fB\-o\fP" 10
  55. Write numeric values in octal (equivalent to
  56. .BR "\-t\ o" ).
  57. .IP "\fB\-P\fP" 10
  58. Write information in a portable output format, as specified in the
  59. STDOUT section.
  60. .IP "\fB\-t\ \fIformat\fR" 10
  61. Write each numeric value in the specified format. The format shall be
  62. dependent on the single character used as the
  63. .IR format
  64. option-argument:
  65. .RS 10
  66. .IP "\fRd\fR" 6
  67. decimal
  68. (default if
  69. .BR \-P
  70. is not specified).
  71. .IP "\fRo\fR" 6
  72. octal.
  73. .IP "\fRx\fR" 6
  74. hexadecimal (default if
  75. .BR \-P
  76. is specified).
  77. .RE
  78. .IP "\fB\-u\fP" 10
  79. Write only undefined symbols.
  80. .IP "\fB\-v\fP" 10
  81. Sort output by value instead of by symbol name.
  82. .IP "\fB\-x\fP" 10
  83. Write numeric values in hexadecimal (equivalent to
  84. .BR "\-t\ x" ).
  85. .SH OPERANDS
  86. The following operand shall be supported:
  87. .IP "\fIfile\fR" 10
  88. A pathname of an object file, executable file, or object-file library.
  89. .SH STDIN
  90. See the INPUT FILES section.
  91. .SH "INPUT FILES"
  92. The input file shall be an object file, an object-file library whose
  93. format is the same as those produced by the
  94. .IR ar
  95. utility for link editing, or an executable file. The
  96. .IR nm
  97. utility may accept additional implementation-defined object library
  98. formats for the input file.
  99. .SH "ENVIRONMENT VARIABLES"
  100. The following environment variables shall affect the execution of
  101. .IR nm :
  102. .IP "\fILANG\fP" 10
  103. Provide a default value for the internationalization variables that are
  104. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  105. .IR "Section 8.2" ", " "Internationalization Variables"
  106. for the precedence of internationalization variables used to determine
  107. the values of locale categories.)
  108. .IP "\fILC_ALL\fP" 10
  109. If set to a non-empty string value, override the values of all the
  110. other internationalization variables.
  111. .IP "\fILC_COLLATE\fP" 10
  112. .br
  113. Determine the locale for character collation information for the
  114. symbol-name and symbol-value collation sequences.
  115. .IP "\fILC_CTYPE\fP" 10
  116. Determine the locale for the interpretation of sequences of bytes of
  117. text data as characters (for example, single-byte as opposed to
  118. multi-byte characters in arguments).
  119. .IP "\fILC_MESSAGES\fP" 10
  120. .br
  121. Determine the locale that should be used to affect the format and
  122. contents of diagnostic messages written to standard error.
  123. .IP "\fINLSPATH\fP" 10
  124. Determine the location of message catalogs for the processing of
  125. .IR LC_MESSAGES .
  126. .SH "ASYNCHRONOUS EVENTS"
  127. Default.
  128. .SH STDOUT
  129. If symbolic information is present in the input files, then for each
  130. file or for each member of an archive, the
  131. .IR nm
  132. utility shall write the following information to standard output. By
  133. default, the format is unspecified, but the output shall be sorted by
  134. symbol name according to the collation sequence in the current locale.
  135. .IP " *" 4
  136. Library or object name, if
  137. .BR \-A
  138. is specified
  139. .IP " *" 4
  140. Symbol name
  141. .IP " *" 4
  142. Symbol type, which shall either be one of the following single
  143. characters or an implementation-defined type represented by a single
  144. character:
  145. .RS 4
  146. .IP "\fRA\fR" 6
  147. Global absolute symbol.
  148. .IP "\fRa\fR" 6
  149. Local absolute symbol.
  150. .IP "\fRB\fR" 6
  151. Global ``bss'' (that is, uninitialized data space) symbol.
  152. .IP "\fRb\fR" 6
  153. Local bss symbol.
  154. .IP "\fRD\fR" 6
  155. Global data symbol.
  156. .IP "\fRd\fR" 6
  157. Local data symbol.
  158. .IP "\fRT\fR" 6
  159. Global text symbol.
  160. .IP "\fRt\fR" 6
  161. Local text symbol.
  162. .IP "\fRU\fR" 6
  163. Undefined symbol.
  164. .RE
  165. .IP " *" 4
  166. Value of the symbol
  167. .IP " *" 4
  168. The size associated with the symbol, if applicable
  169. .P
  170. This information may be supplemented by additional information specific
  171. to the implementation.
  172. .P
  173. If the
  174. .BR \-P
  175. option is specified, the previous information shall be displayed using
  176. the following portable format. The three versions differ depending on
  177. whether
  178. .BR "\-t\ d" ,
  179. .BR "\-t\ o" ,
  180. or
  181. .BR "\-t\ x"
  182. was specified, respectively:
  183. .sp
  184. .RS 4
  185. .nf
  186. "%s%s %s %d %d\en", <\fIlibrary/object name\fR>, <\fIname\fR>, <\fItype\fR>,
  187. <\fIvalue\fR>, <\fIsize\fR>
  188. .P
  189. "%s%s %s %o %o\en", <\fIlibrary/object name\fR>, <\fIname\fR>, <\fItype\fR>,
  190. <\fIvalue\fR>, <\fIsize\fR>
  191. .P
  192. "%s%s %s %x %x\en", <\fIlibrary/object name\fR>, <\fIname\fR>, <\fItype\fR>,
  193. <\fIvalue\fR>, <\fIsize\fR>
  194. .fi
  195. .P
  196. .RE
  197. where <\fIlibrary/object\ name\fP> shall be formatted as follows:
  198. .IP " *" 4
  199. If
  200. .BR \-A
  201. is not specified, <\fIlibrary/object\ name\fP> shall be an empty string.
  202. .IP " *" 4
  203. If
  204. .BR \-A
  205. is specified and the corresponding
  206. .IR file
  207. operand does not name a library:
  208. .RS 4
  209. .sp
  210. .RS 4
  211. .nf
  212. "%s: ", <\fIfile\fR>
  213. .fi
  214. .P
  215. .RE
  216. .RE
  217. .IP " *" 4
  218. If
  219. .BR \-A
  220. is specified and the corresponding
  221. .IR file
  222. operand names a library. In this case, <\fIobject\ file\fP> shall name
  223. the object file in the library containing the symbol being described:
  224. .RS 4
  225. .sp
  226. .RS 4
  227. .nf
  228. "%s[%s]: ", <\fIfile\fR>, <\fIobject file\fR>
  229. .fi
  230. .P
  231. .RE
  232. .RE
  233. .P
  234. If
  235. .BR \-A
  236. is not specified, then if more than one
  237. .IR file
  238. operand is specified or if only one
  239. .IR file
  240. operand is specified and it names a library,
  241. .IR nm
  242. shall write a line identifying the object containing the following
  243. symbols before the lines containing those symbols, in the form:
  244. .IP " *" 4
  245. If the corresponding
  246. .IR file
  247. operand does not name a library:
  248. .RS 4
  249. .sp
  250. .RS 4
  251. .nf
  252. "%s:\en", <\fIfile\fR>
  253. .fi
  254. .P
  255. .RE
  256. .RE
  257. .IP " *" 4
  258. If the corresponding
  259. .IR file
  260. operand names a library; in this case, <\fIobject\ file\fP> shall be
  261. the name of the file in the library containing the following symbols:
  262. .RS 4
  263. .sp
  264. .RS 4
  265. .nf
  266. "%s[%s]:\en", <\fIfile\fR>, <\fIobject file\fR>
  267. .fi
  268. .P
  269. .RE
  270. .RE
  271. .P
  272. If
  273. .BR \-P
  274. is specified, but
  275. .BR \-t
  276. is not, the format shall be as if
  277. .BR "\-t\ x"
  278. had been specified.
  279. .SH STDERR
  280. The standard error shall be used only for diagnostic messages.
  281. .SH "OUTPUT FILES"
  282. None.
  283. .SH "EXTENDED DESCRIPTION"
  284. None.
  285. .SH "EXIT STATUS"
  286. The following exit values shall be returned:
  287. .IP "\00" 6
  288. Successful completion.
  289. .IP >0 6
  290. An error occurred.
  291. .SH "CONSEQUENCES OF ERRORS"
  292. Default.
  293. .LP
  294. .IR "The following sections are informative."
  295. .SH "APPLICATION USAGE"
  296. Mechanisms for dynamic linking make this utility less meaningful when
  297. applied to an executable file because a dynamically linked executable
  298. may omit numerous library routines that would be found in a statically
  299. linked executable.
  300. .SH EXAMPLES
  301. None.
  302. .SH RATIONALE
  303. Historical implementations of
  304. .IR nm
  305. have used different bases for numeric output and supplied different
  306. default types of symbols that were reported. The
  307. .BR \-t
  308. .IR format
  309. option, similar to that used in
  310. .IR od
  311. and
  312. .IR strings ,
  313. can be used to specify the numeric base;
  314. .BR \-g
  315. and
  316. .BR \-u
  317. can be used to restrict the amount of output or the types of symbols
  318. included in the output.
  319. .P
  320. The compromise of using
  321. .BR \-t
  322. .IR format
  323. \fIversus\fP using
  324. .BR \-d ,
  325. .BR \-o ,
  326. and other similar options was necessary because of differences in the
  327. meaning of
  328. .BR \-o
  329. between implementations. The
  330. .BR \-o
  331. option from BSD has been provided here as
  332. .BR \-A
  333. to avoid confusion with the
  334. .BR \-o
  335. from System V (which has been provided here as
  336. .BR \-t
  337. and as
  338. .BR \-o
  339. on XSI-conformant systems).
  340. .P
  341. The option list was significantly reduced from that provided by
  342. historical implementations.
  343. .P
  344. The
  345. .IR nm
  346. description is a subset of both the System V and BSD
  347. .IR nm
  348. utilities with no specified default output.
  349. .P
  350. It was recognized that mechanisms for dynamic linking make this utility
  351. less meaningful when applied to an executable file (because a
  352. dynamically linked executable file may omit numerous library routines
  353. that would be found in a statically linked executable file), but the
  354. value of
  355. .IR nm
  356. during software development was judged to outweigh other limitations.
  357. .P
  358. The default output format of
  359. .IR nm
  360. is not specified because of differences in historical implementations.
  361. The
  362. .BR \-P
  363. option was added to allow some type of portable output format. After a
  364. comparison of the different formats used in SunOS, BSD, SVR3, and SVR4,
  365. it was decided to create one that did not match the current format of
  366. any of these four systems. The format devised is easy to parse by
  367. humans, easy to parse in shell scripts, and does not need to vary
  368. depending on locale (because no English descriptions are included).
  369. All of the systems currently have the information available to use this
  370. format.
  371. .P
  372. The format given in
  373. .IR nm
  374. STDOUT uses
  375. <space>
  376. characters between the fields, which may be any number of
  377. <blank>
  378. characters required to align the columns. The single-character types
  379. were selected to match historical practice, and the requirement that
  380. implementation additions also be single characters made parsing the
  381. information easier for shell scripts.
  382. .SH "FUTURE DIRECTIONS"
  383. None.
  384. .SH "SEE ALSO"
  385. .IR "\fIar\fR\^",
  386. .IR "\fIc99\fR\^"
  387. .P
  388. The Base Definitions volume of POSIX.1\(hy2017,
  389. .IR "Chapter 8" ", " "Environment Variables",
  390. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  391. .\"
  392. .SH COPYRIGHT
  393. Portions of this text are reprinted and reproduced in electronic form
  394. from IEEE Std 1003.1-2017, Standard for Information Technology
  395. -- Portable Operating System Interface (POSIX), The Open Group Base
  396. Specifications Issue 7, 2018 Edition,
  397. Copyright (C) 2018 by the Institute of
  398. Electrical and Electronics Engineers, Inc and The Open Group.
  399. In the event of any discrepancy between this version and the original IEEE and
  400. The Open Group Standard, the original IEEE and The Open Group Standard
  401. is the referee document. The original Standard can be obtained online at
  402. http://www.opengroup.org/unix/online.html .
  403. .PP
  404. Any typographical or formatting errors that appear
  405. in this page are most likely
  406. to have been introduced during the conversion of the source files to
  407. man page format. To report such errors, see
  408. https://www.kernel.org/doc/man-pages/reporting_bugs.html .