📄 nm.html
字号:
<dd>Global data symbol.</dd><dt><tt>d</tt></dt><dd>Local data symbol.</dd><dt><tt>T</tt></dt><dd>Global text symbol.</dd><dt><tt>t</tt></dt><dd>Local text symbol.</dd><dt><tt>U</tt></dt><dd>Undefined symbol.</dd></dl></li><li><p>Value of the symbol</p></li><li><p>The size associated with the symbol, if applicable</p></li></ul><p>This information may be supplemented by additional information specific to the implementation.</p><p>If the <b>-P</b> option is specified, the previous information shall be displayed using the following portable format. The threeversions differ depending on whether <b>-t d</b>, <b>-t o</b>, or <b>-t x</b> was specified, respectively:</p><pre><tt>"%s%s %s %d %d\n", <</tt><i>library/object name</i><tt>>, <</tt><i>name</i><tt>>, <</tt><i>type</i><tt>>, <</tt><i>value</i><tt>>, <</tt><i>size</i><tt>><br>"%s%s %s %o %o\n", <</tt><i>library/object name</i><tt>>, <</tt><i>name</i><tt>>, <</tt><i>type</i><tt>>, <</tt><i>value</i><tt>>, <</tt><i>size</i><tt>><br>"%s%s %s %x %x\n", <</tt><i>library/object name</i><tt>>, <</tt><i>name</i><tt>>, <</tt><i>type</i><tt>>, <</tt><i>value</i><tt>>, <</tt><i>size</i><tt>></tt></pre>where <<i>library/object name</i>> shall be formatted as follows: <ul><li><p>If <b>-A</b> is not specified, <<i>library/object name</i>> shall be an empty string.</p></li><li><p>If <b>-A</b> is specified and the corresponding <i>file</i> operand does not name a library:</p><pre><tt>"%s: ", <</tt><i>file</i><tt>></tt></pre></li><li><p>If <b>-A</b> is specified and the corresponding <i>file</i> operand names a library. In this case,<<i>object file</i>> shall name the object file in the library containing the symbol being described:</p><pre><tt>"%s[%s]: ", <</tt><i>file</i><tt>>, <</tt><i>object file</i><tt>></tt></pre></li></ul><p>If <b>-A</b> is not specified, then if more than one <i>file</i> operand is specified or if only one <i>file</i> operand isspecified and it names a library, <i>nm</i> shall write a line identifying the object containing the following symbols before thelines containing those symbols, in the form:</p><ul><li><p>If the corresponding <i>file</i> operand does not name a library:</p><pre><tt>"%s:\n", <</tt><i>file</i><tt>></tt></pre></li><li><p>If the corresponding <i>file</i> operand names a library; in this case, <<i>object file</i>> shall be the name of thefile in the library containing the following symbols:</p><pre><tt>"%s[%s]:\n", <</tt><i>file</i><tt>>, <</tt><i>object file</i><tt>></tt></pre></li></ul><p>If <b>-P</b> is specified, but <b>-t</b> is not, the format shall be as if <b>-t x</b> had been specified.</p></blockquote><h4><a name="tag_04_94_11"></a>STDERR</h4><blockquote><p>The standard error shall be used only for diagnostic messages.</p></blockquote><h4><a name="tag_04_94_12"></a>OUTPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_94_13"></a>EXTENDED DESCRIPTION</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_94_14"></a>EXIT STATUS</h4><blockquote><p>The following exit values shall be returned:</p><dl compact><dt> 0</dt><dd>Successful completion.</dd><dt>>0</dt><dd>An error occurred.</dd></dl></blockquote><h4><a name="tag_04_94_15"></a>CONSEQUENCES OF ERRORS</h4><blockquote><p>Default.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_04_94_16"></a>APPLICATION USAGE</h4><blockquote><p>Mechanisms for dynamic linking make this utility less meaningful when applied to an executable file because a dynamically linkedexecutable may omit numerous library routines that would be found in a statically linked executable.</p></blockquote><h4><a name="tag_04_94_17"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_94_18"></a>RATIONALE</h4><blockquote><p>Historical implementations of <i>nm</i> have used different bases for numeric output and supplied different default types ofsymbols that were reported. The <b>-t</b> <i>format</i> option, similar to that used in <a href="../utilities/od.html"><i>od</i></a> and <a href="../utilities/strings.html"><i>strings</i></a>, can be used to specify the numericbase; <b>-g</b> and <b>-u</b> can be used to restrict the amount of output or the types of symbols included in the output.</p><p>The compromise of using <b>-t</b> <i>format</i> <i>versus</i> using <b>-d</b>, <b>-o</b>, and other similar options wasnecessary because of differences in the meaning of <b>-o</b> between implementations. The <b>-o</b> option from BSD has beenprovided here as <b>-A</b> to avoid confusion with the <b>-o</b> from System V (which has been provided here as <b>-t</b> and as<b>-o</b> on XSI-conformant systems).</p><p>The option list was significantly reduced from that provided by historical implementations.</p><p>The <i>nm</i> description is a subset of both the System V and BSD <i>nm</i> utilities with no specified default output.</p><p>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 linkedexecutable file), but the value of <i>nm</i> during software development was judged to outweigh other limitations.</p><p>The default output format of <i>nm</i> is not specified because of differences in historical implementations. The <b>-P</b>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 devisedis easy to parse by humans, easy to parse in shell scripts, and does not need to vary depending on locale (because no Englishdescriptions are included). All of the systems currently have the information available to use this format.</p><p>The format given in <i>nm</i> STDOUT uses spaces between the fields, which may be any number of <blank>s required to alignthe columns. The single-character types were selected to match historical practice, and the requirement that implementationadditions also be single characters made parsing the information easier for shell scripts.</p></blockquote><h4><a name="tag_04_94_19"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_94_20"></a>SEE ALSO</h4><blockquote><p><a href="ar.html"><i>ar</i></a> , <a href="c99.html"><i>c99</i></a></p></blockquote><h4><a name="tag_04_94_21"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 2.</p></blockquote><h4><a name="tag_04_94_22"></a>Issue 6</h4><blockquote><p>This utility is marked as supported when both the User Portability Utilities option and the Software Development Utilitiesoption are supported.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -