選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

163 行
7.5KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1991-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3
  6. or any later version published by the Free Software Foundation;
  7. with no Invariant Sections, with no Front-Cover Texts, and with no
  8. Back-Cover Texts. A copy of the license is included in the
  9. section entitled "GNU Free Documentation License".
  10. -->
  11. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title>ar (GNU Binary Utilities)</title>
  15. <meta name="description" content="ar (GNU Binary Utilities)">
  16. <meta name="keywords" content="ar (GNU Binary Utilities)">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <link href="index.html#Top" rel="start" title="Top">
  21. <link href="Binutils-Index.html#Binutils-Index" rel="index" title="Binutils Index">
  22. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  23. <link href="index.html#Top" rel="up" title="Top">
  24. <link href="ar-cmdline.html#ar-cmdline" rel="next" title="ar cmdline">
  25. <link href="index.html#Top" rel="prev" title="Top">
  26. <style type="text/css">
  27. <!--
  28. a.summary-letter {text-decoration: none}
  29. blockquote.indentedblock {margin-right: 0em}
  30. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smalllisp {margin-left: 3.2em}
  38. kbd {font-style: oblique}
  39. pre.display {font-family: inherit}
  40. pre.format {font-family: inherit}
  41. pre.menu-comment {font-family: serif}
  42. pre.menu-preformatted {font-family: serif}
  43. pre.smalldisplay {font-family: inherit; font-size: smaller}
  44. pre.smallexample {font-size: smaller}
  45. pre.smallformat {font-family: inherit; font-size: smaller}
  46. pre.smalllisp {font-size: smaller}
  47. span.nolinebreak {white-space: nowrap}
  48. span.roman {font-family: initial; font-weight: normal}
  49. span.sansserif {font-family: sans-serif; font-weight: normal}
  50. ul.no-bullet {list-style: none}
  51. -->
  52. </style>
  53. </head>
  54. <body lang="en">
  55. <a name="ar"></a>
  56. <div class="header">
  57. <p>
  58. Next: <a href="nm.html#nm" accesskey="n" rel="next">nm</a>, Previous: <a href="index.html#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  59. </div>
  60. <hr>
  61. <a name="ar-1"></a>
  62. <h2 class="chapter">1 ar</h2>
  63. <a name="index-ar"></a>
  64. <a name="index-archives"></a>
  65. <a name="index-collections-of-files"></a>
  66. <div class="smallexample">
  67. <pre class="smallexample">ar [-]<var>p</var>[<var>mod</var>] [<samp>--plugin</samp> <var>name</var>] [<samp>--target</samp> <var>bfdname</var>] [<samp>--output</samp> <var>dirname</var>] [<var>relpos</var>] [<var>count</var>] <var>archive</var> [<var>member</var>&hellip;]
  68. ar -M [ &lt;mri-script ]
  69. </pre></div>
  70. <p>The <small>GNU</small> <code>ar</code> program creates, modifies, and extracts from
  71. archives. An <em>archive</em> is a single file holding a collection of
  72. other files in a structure that makes it possible to retrieve
  73. the original individual files (called <em>members</em> of the archive).
  74. </p>
  75. <p>The original files&rsquo; contents, mode (permissions), timestamp, owner, and
  76. group are preserved in the archive, and can be restored on
  77. extraction.
  78. </p>
  79. <a name="index-name-length"></a>
  80. <p><small>GNU</small> <code>ar</code> can maintain archives whose members have names of any
  81. length; however, depending on how <code>ar</code> is configured on your
  82. system, a limit on member-name length may be imposed for compatibility
  83. with archive formats maintained with other tools. If it exists, the
  84. limit is often 15 characters (typical of formats related to a.out) or 16
  85. characters (typical of formats related to coff).
  86. </p>
  87. <a name="index-libraries"></a>
  88. <p><code>ar</code> is considered a binary utility because archives of this sort
  89. are most often used as <em>libraries</em> holding commonly needed
  90. subroutines.
  91. </p>
  92. <a name="index-symbol-index"></a>
  93. <p><code>ar</code> creates an index to the symbols defined in relocatable
  94. object modules in the archive when you specify the modifier &lsquo;<samp>s</samp>&rsquo;.
  95. Once created, this index is updated in the archive whenever <code>ar</code>
  96. makes a change to its contents (save for the &lsquo;<samp>q</samp>&rsquo; update operation).
  97. An archive with such an index speeds up linking to the library, and
  98. allows routines in the library to call each other without regard to
  99. their placement in the archive.
  100. </p>
  101. <p>You may use &lsquo;<samp>nm -s</samp>&rsquo; or &lsquo;<samp>nm --print-armap</samp>&rsquo; to list this index
  102. table. If an archive lacks the table, another form of <code>ar</code> called
  103. <code>ranlib</code> can be used to add just the table.
  104. </p>
  105. <a name="index-thin-archives"></a>
  106. <p><small>GNU</small> <code>ar</code> can optionally create a <em>thin</em> archive,
  107. which contains a symbol index and references to the original copies
  108. of the member files of the archive. This is useful for building
  109. libraries for use within a local build tree, where the relocatable
  110. objects are expected to remain available, and copying the contents of
  111. each object would only waste time and space.
  112. </p>
  113. <p>An archive can either be <em>thin</em> or it can be normal. It cannot
  114. be both at the same time. Once an archive is created its format
  115. cannot be changed without first deleting it and then creating a new
  116. archive in its place.
  117. </p>
  118. <p>Thin archives are also <em>flattened</em>, so that adding one thin
  119. archive to another thin archive does not nest it, as would happen with
  120. a normal archive. Instead the elements of the first archive are added
  121. individually to the second archive.
  122. </p>
  123. <p>The paths to the elements of the archive are stored relative to the
  124. archive itself.
  125. </p>
  126. <a name="index-compatibility_002c-ar"></a>
  127. <a name="index-ar-compatibility"></a>
  128. <p><small>GNU</small> <code>ar</code> is designed to be compatible with two different
  129. facilities. You can control its activity using command-line options,
  130. like the different varieties of <code>ar</code> on Unix systems; or, if you
  131. specify the single command-line option <samp>-M</samp>, you can control it
  132. with a script supplied via standard input, like the MRI &ldquo;librarian&rdquo;
  133. program.
  134. </p>
  135. <table class="menu" border="0" cellspacing="0">
  136. <tr><td align="left" valign="top">&bull; <a href="ar-cmdline.html#ar-cmdline" accesskey="1">ar cmdline</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling <code>ar</code> on the command line
  137. </td></tr>
  138. <tr><td align="left" valign="top">&bull; <a href="ar-scripts.html#ar-scripts" accesskey="2">ar scripts</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling <code>ar</code> with a script
  139. </td></tr>
  140. </table>
  141. <hr>
  142. <div class="header">
  143. <p>
  144. Next: <a href="nm.html#nm" accesskey="n" rel="next">nm</a>, Previous: <a href="index.html#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  145. </div>
  146. </body>
  147. </html>