Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
nm.html (19780B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>nm</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/nl.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/nohup.html" accesskey="N">Next 19 >>></a></td> 20 </tr> 21 </table> 22 <hr align="left" width="100%"></div> 23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 24 <center><font size="2">The Open Group Base Specifications Issue 8<br> 25 IEEE Std 1003.1-2024<br> 26 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 27 <hr size="2" noshade> 28 <a name="top" id="top"></a> <a name="nm" id="nm"></a> <a name="tag_20_88" id="tag_20_88"></a><!-- nm --> 29 <h4 class="mansect"><a name="tag_20_88_01" id="tag_20_88_01"></a>NAME</h4> 30 <blockquote>nm — write the name list of an object file (<b>DEVELOPMENT</b>)</blockquote> 31 <h4 class="mansect"><a name="tag_20_88_02" id="tag_20_88_02"></a>SYNOPSIS</h4> 32 <blockquote class="synopsis"> 33 <div class="box"><code><tt><sup>[<a href="javascript:open_code('SD')">SD</a>]</sup> <img src="../images/opt-start.gif" alt= 34 "[Option Start]" border="0"> nm</tt> <b>[</b><tt>-APv</tt><b>] [</b><tt>-g|-u</tt><b>] [</b><tt>-t</tt> <i>format</i><b>]</b> 35 <i>file</i><tt>... <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div> 36 <tt><br> 37 <br></tt> 38 <div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt= 39 "[Option Start]" border="0"> nm</tt> <b>[</b><tt>-APv</tt><b>] [</b><tt>-efox</tt><b>] [</b><tt>-g|-u</tt><b>] [</b><tt>-t</tt> 40 <i>format</i><b>]</b> <i>file</i><tt>... <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div> 41 <tt><br></tt></blockquote> 42 <h4 class="mansect"><a name="tag_20_88_03" id="tag_20_88_03"></a>DESCRIPTION</h4> 43 <blockquote> 44 <p>The <i>nm</i> utility shall display symbolic information appearing in the object file, executable file, or object-file library 45 named by <i>file</i>. If no symbolic information is available for a valid input file, the <i>nm</i> utility shall report that fact, 46 but not consider it an error condition.</p> 47 <p>The default base used when numeric values are written is unspecified. <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> 48 <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> On XSI-conformant systems, it shall be decimal if the 49 <b>-P</b> option is not specified. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p> 50 </blockquote> 51 <h4 class="mansect"><a name="tag_20_88_04" id="tag_20_88_04"></a>OPTIONS</h4> 52 <blockquote> 53 <p>The <i>nm</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 54 Guidelines</i></a> .</p> 55 <p>The following options shall be supported:</p> 56 <dl compact> 57 <dd></dd> 58 <dt><b>-A</b></dt> 59 <dd>Write the full pathname or library name of an object on each line.</dd> 60 <dt><b>-e</b></dt> 61 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 62 Write only external (global) and static symbol information. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd> 63 <dt><b>-f</b></dt> 64 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 65 Produce full output. Write redundant symbols (<b>.text</b>, <b>.data</b>, and <b>.bss</b>), normally suppressed. <img src= 66 "../images/opt-end.gif" alt="[Option End]" border="0"></dd> 67 <dt><b>-g</b></dt> 68 <dd>Write only external (global) symbol information.</dd> 69 <dt><b>-o</b></dt> 70 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 71 Write numeric values in octal (equivalent to <b>-t o</b>). <img src="../images/opt-end.gif" alt="[Option End]" border= 72 "0"></dd> 73 <dt><b>-P</b></dt> 74 <dd>Write information in a portable output format, as specified in the STDOUT section.</dd> 75 <dt><b>-t </b><i>format</i></dt> 76 <dd>Write each numeric value in the specified format. The format shall be dependent on the single character used as the 77 <i>format</i> option-argument: 78 <dl compact> 79 <dd></dd> 80 <dt><tt>d</tt></dt> 81 <dd>decimal <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" 82 border="0"> (default if <b>-P</b> is not specified). <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd> 83 <dt><tt>o</tt></dt> 84 <dd>octal.</dd> 85 <dt><tt>x</tt></dt> 86 <dd>hexadecimal (default if <b>-P</b> is specified).</dd> 87 </dl> 88 </dd> 89 <dt><b>-u</b></dt> 90 <dd>Write only undefined symbols.</dd> 91 <dt><b>-v</b></dt> 92 <dd>Sort output by value instead of by symbol name.</dd> 93 <dt><b>-x</b></dt> 94 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 95 Write numeric values in hexadecimal (equivalent to <b>-t x</b>). <img src="../images/opt-end.gif" alt="[Option End]" border= 96 "0"></dd> 97 </dl> 98 </blockquote> 99 <h4 class="mansect"><a name="tag_20_88_05" id="tag_20_88_05"></a>OPERANDS</h4> 100 <blockquote> 101 <p>The following operand shall be supported:</p> 102 <dl compact> 103 <dd></dd> 104 <dt><i>file</i></dt> 105 <dd>A pathname of an object file, executable file, or object-file library.</dd> 106 </dl> 107 </blockquote> 108 <h4 class="mansect"><a name="tag_20_88_06" id="tag_20_88_06"></a>STDIN</h4> 109 <blockquote> 110 <p>See the INPUT FILES section.</p> 111 </blockquote> 112 <h4 class="mansect"><a name="tag_20_88_07" id="tag_20_88_07"></a>INPUT FILES</h4> 113 <blockquote> 114 <p>The input file shall be an object file, an object-file library whose format is the same as those produced by the <a href= 115 "../utilities/ar.html"><i>ar</i></a> utility for link editing, or an executable file. The <i>nm</i> utility may accept additional 116 implementation-defined object library formats for the input file.</p> 117 </blockquote> 118 <h4 class="mansect"><a name="tag_20_88_08" id="tag_20_88_08"></a>ENVIRONMENT VARIABLES</h4> 119 <blockquote> 120 <p>The following environment variables shall affect the execution of <i>nm</i>:</p> 121 <dl compact> 122 <dd></dd> 123 <dt><i>LANG</i></dt> 124 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 125 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 126 variables used to determine the values of locale categories.)</dd> 127 <dt><i>LC_ALL</i></dt> 128 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 129 <dt><i>LC_COLLATE</i></dt> 130 <dd><br> 131 Determine the locale for character collation information for the symbol-name and symbol-value collation sequences.</dd> 132 <dt><i>LC_CTYPE</i></dt> 133 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 134 opposed to multi-byte characters in arguments).</dd> 135 <dt><i>LC_MESSAGES</i></dt> 136 <dd><br> 137 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 138 <dt><i>NLSPATH</i></dt> 139 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 140 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 141 "0"></dd> 142 </dl> 143 </blockquote> 144 <h4 class="mansect"><a name="tag_20_88_09" id="tag_20_88_09"></a>ASYNCHRONOUS EVENTS</h4> 145 <blockquote> 146 <p>Default.</p> 147 </blockquote> 148 <h4 class="mansect"><a name="tag_20_88_10" id="tag_20_88_10"></a>STDOUT</h4> 149 <blockquote> 150 <p>If symbolic information is present in the input files, then for each file or for each member of an archive, the <i>nm</i> 151 utility shall write the following information to standard output. By default, the format is unspecified, but the output shall be 152 sorted by symbol name according to the collation sequence in the current locale.</p> 153 <ul> 154 <li> 155 <p>Library or object name, if <b>-A</b> is specified</p> 156 </li> 157 <li> 158 <p>Symbol name</p> 159 </li> 160 <li> 161 <p>Symbol type, which shall either be one of the following single characters or an implementation-defined type represented by a 162 single character:</p> 163 <dl compact> 164 <dd></dd> 165 <dt><tt>A</tt></dt> 166 <dd>Global absolute symbol.</dd> 167 <dt><tt>a</tt></dt> 168 <dd>Local absolute symbol.</dd> 169 <dt><tt>B</tt></dt> 170 <dd>Global "bss" (that is, uninitialized data space) symbol.</dd> 171 <dt><tt>b</tt></dt> 172 <dd>Local bss symbol.</dd> 173 <dt><tt>D</tt></dt> 174 <dd>Global data symbol.</dd> 175 <dt><tt>d</tt></dt> 176 <dd>Local data symbol.</dd> 177 <dt><tt>T</tt></dt> 178 <dd>Global text symbol.</dd> 179 <dt><tt>t</tt></dt> 180 <dd>Local text symbol.</dd> 181 <dt><tt>U</tt></dt> 182 <dd>Undefined symbol.</dd> 183 </dl> 184 </li> 185 <li> 186 <p>Value of the symbol</p> 187 </li> 188 <li> 189 <p>The size associated with the symbol, if applicable</p> 190 </li> 191 </ul> 192 <p>This information may be supplemented by additional information specific to the implementation.</p> 193 <p>If the <b>-P</b> option is specified, the previous information shall be displayed using the following portable format. The three 194 versions differ depending on whether <b>-t d</b>, <b>-t o</b>, or <b>-t x</b> was specified, respectively:</p> 195 <pre> 196 <tt>"%s%s %s %d %d\n", <</tt><i>library/object name</i><tt>>, <</tt><i>name</i><tt>>, <</tt><i>type</i><tt>>, 197 <</tt><i>value</i><tt>>, <</tt><i>size</i><tt>> 198 <br> 199 "%s%s %s %o %o\n", <</tt><i>library/object name</i><tt>>, <</tt><i>name</i><tt>>, <</tt><i>type</i><tt>>, 200 <</tt><i>value</i><tt>>, <</tt><i>size</i><tt>> 201 <br> 202 "%s%s %s %x %x\n", <</tt><i>library/object name</i><tt>>, <</tt><i>name</i><tt>>, <</tt><i>type</i><tt>>, 203 <</tt><i>value</i><tt>>, <</tt><i>size</i><tt>> 204 </tt></pre> 205 where <<i>library/object name</i>> shall be formatted as follows: 206 <ul> 207 <li> 208 <p>If <b>-A</b> is not specified, <<i>library/object name</i>> shall be an empty string.</p> 209 </li> 210 <li> 211 <p>If <b>-A</b> is specified and the corresponding <i>file</i> operand does not name a library:</p> 212 <pre> 213 <tt>"%s: ", <</tt><i>file</i><tt>> 214 </tt></pre></li> 215 <li> 216 <p>If <b>-A</b> is specified and the corresponding <i>file</i> operand names a library. In this case, 217 <<i>object file</i>> shall name the object file in the library containing the symbol being described:</p> 218 <pre> 219 <tt>"%s[%s]: ", <</tt><i>file</i><tt>>, <</tt><i>object file</i><tt>> 220 </tt></pre></li> 221 </ul> 222 <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 is 223 specified and it names a library, <i>nm</i> shall write a line identifying the object containing the following symbols before the 224 lines containing those symbols, in the form:</p> 225 <ul> 226 <li> 227 <p>If the corresponding <i>file</i> operand does not name a library:</p> 228 <pre> 229 <tt>"%s:\n", <</tt><i>file</i><tt>> 230 </tt></pre></li> 231 <li> 232 <p>If the corresponding <i>file</i> operand names a library; in this case, <<i>object file</i>> shall be the name of the 233 file in the library containing the following symbols:</p> 234 <pre> 235 <tt>"%s[%s]:\n", <</tt><i>file</i><tt>>, <</tt><i>object file</i><tt>> 236 </tt></pre></li> 237 </ul> 238 <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> 239 </blockquote> 240 <h4 class="mansect"><a name="tag_20_88_11" id="tag_20_88_11"></a>STDERR</h4> 241 <blockquote> 242 <p>The standard error shall be used only for diagnostic messages.</p> 243 </blockquote> 244 <h4 class="mansect"><a name="tag_20_88_12" id="tag_20_88_12"></a>OUTPUT FILES</h4> 245 <blockquote> 246 <p>None.</p> 247 </blockquote> 248 <h4 class="mansect"><a name="tag_20_88_13" id="tag_20_88_13"></a>EXTENDED DESCRIPTION</h4> 249 <blockquote> 250 <p>None.</p> 251 </blockquote> 252 <h4 class="mansect"><a name="tag_20_88_14" id="tag_20_88_14"></a>EXIT STATUS</h4> 253 <blockquote> 254 <p>The following exit values shall be returned:</p> 255 <dl compact> 256 <dd></dd> 257 <dt> 0</dt> 258 <dd>Successful completion.</dd> 259 <dt>>0</dt> 260 <dd>An error occurred.</dd> 261 </dl> 262 </blockquote> 263 <h4 class="mansect"><a name="tag_20_88_15" id="tag_20_88_15"></a>CONSEQUENCES OF ERRORS</h4> 264 <blockquote> 265 <p>Default.</p> 266 </blockquote> 267 <hr> 268 <div class="box"><em>The following sections are informative.</em></div> 269 <h4 class="mansect"><a name="tag_20_88_16" id="tag_20_88_16"></a>APPLICATION USAGE</h4> 270 <blockquote> 271 <p>Mechanisms for dynamic linking make this utility less meaningful when applied to an executable file because a dynamically linked 272 executable may omit numerous library routines that would be found in a statically linked executable.</p> 273 </blockquote> 274 <h4 class="mansect"><a name="tag_20_88_17" id="tag_20_88_17"></a>EXAMPLES</h4> 275 <blockquote> 276 <p>None.</p> 277 </blockquote> 278 <h4 class="mansect"><a name="tag_20_88_18" id="tag_20_88_18"></a>RATIONALE</h4> 279 <blockquote> 280 <p>Historical implementations of <i>nm</i> have used different bases for numeric output and supplied different default types of 281 symbols that were reported. The <b>-t</b> <i>format</i> option, similar to that used in <a href= 282 "../utilities/od.html"><i>od</i></a> and <a href="../utilities/strings.html"><i>strings</i></a>, can be used to specify the numeric 283 base; <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> 284 <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 was 285 necessary because of differences in the meaning of <b>-o</b> between implementations. The <b>-o</b> option from BSD has been 286 provided 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 287 <b>-o</b> on XSI-conformant systems).</p> 288 <p>The option list was significantly reduced from that provided by historical implementations.</p> 289 <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> 290 <p>It was recognized that mechanisms for dynamic linking make this utility less meaningful when applied to an executable file 291 (because a dynamically linked executable file may omit numerous library routines that would be found in a statically linked 292 executable file), but the value of <i>nm</i> during software development was judged to outweigh other limitations.</p> 293 <p>The default output format of <i>nm</i> is not specified because of differences in historical implementations. The <b>-P</b> 294 option was added to allow some type of portable output format. After a comparison of the different formats used in SunOS, BSD, 295 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 296 is easy to parse by humans, easy to parse in shell scripts, and does not need to vary depending on locale (because no English 297 descriptions are included). All of the systems currently have the information available to use this format.</p> 298 <p>The format given in <i>nm</i> STDOUT uses <space> characters between the fields, which may be any number of <blank> 299 characters required to align the columns. The single-character types were selected to match historical practice, and the 300 requirement that implementation additions also be single characters made parsing the information easier for shell scripts.</p> 301 </blockquote> 302 <h4 class="mansect"><a name="tag_20_88_19" id="tag_20_88_19"></a>FUTURE DIRECTIONS</h4> 303 <blockquote> 304 <p>If this utility is directed to display a pathname that contains any bytes that have the encoded value of a <newline> 305 character when <newline> is a terminator or separator in the output format being used, implementations are encouraged to 306 treat this as an error. A future version of this standard may require implementations to treat this as an error.</p> 307 </blockquote> 308 <h4 class="mansect"><a name="tag_20_88_20" id="tag_20_88_20"></a>SEE ALSO</h4> 309 <blockquote> 310 <p><a href="../utilities/ar.html#"><i>ar</i></a> , <a href="../utilities/c17.html#"><i>c17</i></a></p> 311 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 312 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p> 313 </blockquote> 314 <h4 class="mansect"><a name="tag_20_88_21" id="tag_20_88_21"></a>CHANGE HISTORY</h4> 315 <blockquote> 316 <p>First released in Issue 2.</p> 317 </blockquote> 318 <h4 class="mansect"><a name="tag_20_88_22" id="tag_20_88_22"></a>Issue 6</h4> 319 <blockquote> 320 <p>This utility is marked as supported when both the User Portability Utilities option and the Software Development Utilities 321 option are supported.</p> 322 </blockquote> 323 <h4 class="mansect"><a name="tag_20_88_23" id="tag_20_88_23"></a>Issue 7</h4> 324 <blockquote> 325 <p>The <i>nm</i> utility is removed from the User Portability Utilities option. User Portability Utilities is now an option for 326 interactive utilities.</p> 327 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p> 328 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0125 [263] and XCU/TC1-2008/0126 [263] are applied.</p> 329 <p>POSIX.1-2008, Technical Corrigendum 2, XCU/TC2-2008/0148 [744] is applied.</p> 330 </blockquote> 331 <h4 class="mansect"><a name="tag_20_88_24" id="tag_20_88_24"></a>Issue 8</h4> 332 <blockquote> 333 <p>Austin Group Defect 251 is applied, encouraging implementations to report an error if a utility is directed to display a 334 pathname that contains any bytes that have the encoded value of a <newline> character when <newline> is a terminator or 335 separator in the output format being used.</p> 336 <p>Austin Group Defect 1062 is applied, inserting an empty line between the two SYNOPSIS forms.</p> 337 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 338 </blockquote> 339 <div class="box"><em>End of informative text.</em></div> 340 <hr> 341 <p> </p> 342 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 343 <hr size="2" noshade> 344 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 345 POSIX™ is a Trademark of The IEEE.<br> 346 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 347 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 348 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 349 ]</font></center> 350 <hr size="2" noshade> 351 <div class="NAVHEADER"> 352 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 353 <tr class="nav"> 354 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/nl.html" accesskey="P"><<< 355 Previous</a></td> 356 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 357 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/nohup.html" accesskey="N">Next 358 >>></a></td> 359 </tr> 360 </table> 361 <hr align="left" width="100%"></div> 362 </body> 363 </html>