Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

200 lines
8.7KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the BFD library.
  4. Copyright (C) 1991-2020 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3 or
  7. any later version published by the Free Software Foundation; with the
  8. Invariant Sections being "GNU General Public License" and "Funding
  9. Free Software", the Front-Cover texts being (a) (see below), and with
  10. the Back-Cover Texts being (b) (see below). A copy of the license is
  11. included in the section entitled "GNU Free Documentation License".
  12. (a) The FSF's Front-Cover Text is:
  13. A GNU Manual
  14. (b) The FSF's Back-Cover Text is:
  15. You have freedom to copy and modify this GNU Manual, like GNU
  16. software. Copies published by the Free Software Foundation raise
  17. funds for GNU development. -->
  18. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <title>Archives (Untitled Document)</title>
  22. <meta name="description" content="Archives (Untitled Document)">
  23. <meta name="keywords" content="Archives (Untitled Document)">
  24. <meta name="resource-type" content="document">
  25. <meta name="distribution" content="global">
  26. <meta name="Generator" content="makeinfo">
  27. <link href="index.html#Top" rel="start" title="Top">
  28. <link href="BFD-Index.html#BFD-Index" rel="index" title="BFD Index">
  29. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  30. <link href="BFD-front-end.html#BFD-front-end" rel="up" title="BFD front end">
  31. <link href="Formats.html#Formats" rel="next" title="Formats">
  32. <link href="symbol-handling-functions.html#symbol-handling-functions" rel="prev" title="symbol handling functions">
  33. <style type="text/css">
  34. <!--
  35. a.summary-letter {text-decoration: none}
  36. blockquote.indentedblock {margin-right: 0em}
  37. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  38. blockquote.smallquotation {font-size: smaller}
  39. div.display {margin-left: 3.2em}
  40. div.example {margin-left: 3.2em}
  41. div.lisp {margin-left: 3.2em}
  42. div.smalldisplay {margin-left: 3.2em}
  43. div.smallexample {margin-left: 3.2em}
  44. div.smalllisp {margin-left: 3.2em}
  45. kbd {font-style: oblique}
  46. pre.display {font-family: inherit}
  47. pre.format {font-family: inherit}
  48. pre.menu-comment {font-family: serif}
  49. pre.menu-preformatted {font-family: serif}
  50. pre.smalldisplay {font-family: inherit; font-size: smaller}
  51. pre.smallexample {font-size: smaller}
  52. pre.smallformat {font-family: inherit; font-size: smaller}
  53. pre.smalllisp {font-size: smaller}
  54. span.nolinebreak {white-space: nowrap}
  55. span.roman {font-family: initial; font-weight: normal}
  56. span.sansserif {font-family: sans-serif; font-weight: normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en">
  62. <a name="Archives"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Formats.html#Formats" accesskey="n" rel="next">Formats</a>, Previous: <a href="Symbols.html#Symbols" accesskey="p" rel="prev">Symbols</a>, Up: <a href="BFD-front-end.html#BFD-front-end" accesskey="u" rel="up">BFD front end</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="BFD-Index.html#BFD-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Archives-1"></a>
  69. <h3 class="section">2.8 Archives</h3>
  70. <p><strong>Description</strong><br>
  71. An archive (or library) is just another BFD. It has a symbol
  72. table, although there&rsquo;s not much a user program will do with it.
  73. </p>
  74. <p>The big difference between an archive BFD and an ordinary BFD
  75. is that the archive doesn&rsquo;t have sections. Instead it has a
  76. chain of BFDs that are considered its contents. These BFDs can
  77. be manipulated like any other. The BFDs contained in an
  78. archive opened for reading will all be opened for reading. You
  79. may put either input or output BFDs into an archive opened for
  80. output; they will be handled correctly when the archive is closed.
  81. </p>
  82. <p>Use <code>bfd_openr_next_archived_file</code> to step through
  83. the contents of an archive opened for input. You don&rsquo;t
  84. have to read the entire archive if you don&rsquo;t want
  85. to! Read it until you find what you want.
  86. </p>
  87. <p>A BFD returned by <code>bfd_openr_next_archived_file</code> can be
  88. closed manually with <code>bfd_close</code>. If you do not close it,
  89. then a second iteration through the members of an archive may
  90. return the same BFD. If you close the archive BFD, then all
  91. the member BFDs will automatically be closed as well.
  92. </p>
  93. <p>Archive contents of output BFDs are chained through the
  94. <code>archive_next</code> pointer in a BFD. The first one is findable
  95. through the <code>archive_head</code> slot of the archive. Set it with
  96. <code>bfd_set_archive_head</code> (q.v.). A given BFD may be in only
  97. one open output archive at a time.
  98. </p>
  99. <p>As expected, the BFD archive code is more general than the
  100. archive code of any given environment. BFD archives may
  101. contain files of different formats (e.g., a.out and coff) and
  102. even different architectures. You may even place archives
  103. recursively into archives!
  104. </p>
  105. <p>This can cause unexpected confusion, since some archive
  106. formats are more expressive than others. For instance, Intel
  107. COFF archives can preserve long filenames; SunOS a.out archives
  108. cannot. If you move a file from the first to the second
  109. format and back again, the filename may be truncated.
  110. Likewise, different a.out environments have different
  111. conventions as to how they truncate filenames, whether they
  112. preserve directory names in filenames, etc. When
  113. interoperating with native tools, be sure your files are
  114. homogeneous.
  115. </p>
  116. <p>Beware: most of these formats do not react well to the
  117. presence of spaces in filenames. We do the best we can, but
  118. can&rsquo;t always handle this case due to restrictions in the format of
  119. archives. Many Unix utilities are braindead in regards to
  120. spaces and such in filenames anyway, so this shouldn&rsquo;t be much
  121. of a restriction.
  122. </p>
  123. <p>Archives are supported in BFD in <code>archive.c</code>.
  124. </p>
  125. <a name="Archive-functions"></a>
  126. <h4 class="subsection">2.8.1 Archive functions</h4>
  127. <a name="index-bfd_005fget_005fnext_005fmapent"></a>
  128. <a name="bfd_005fget_005fnext_005fmapent"></a>
  129. <h4 class="subsubsection">2.8.1.1 <code>bfd_get_next_mapent</code></h4>
  130. <p><strong>Synopsis</strong>
  131. </p><div class="example">
  132. <pre class="example">symindex bfd_get_next_mapent
  133. (bfd *abfd, symindex previous, carsym **sym);
  134. </pre></div>
  135. <p><strong>Description</strong><br>
  136. Step through archive <var>abfd</var>&rsquo;s symbol table (if it
  137. has one). Successively update <var>sym</var> with the next symbol&rsquo;s
  138. information, returning that symbol&rsquo;s (internal) index into the
  139. symbol table.
  140. </p>
  141. <p>Supply <code>BFD_NO_MORE_SYMBOLS</code> as the <var>previous</var> entry to get
  142. the first one; returns <code>BFD_NO_MORE_SYMBOLS</code> when you&rsquo;ve already
  143. got the last one.
  144. </p>
  145. <p>A <code>carsym</code> is a canonical archive symbol. The only
  146. user-visible element is its name, a null-terminated string.
  147. </p>
  148. <a name="index-bfd_005fset_005farchive_005fhead"></a>
  149. <a name="bfd_005fset_005farchive_005fhead"></a>
  150. <h4 class="subsubsection">2.8.1.2 <code>bfd_set_archive_head</code></h4>
  151. <p><strong>Synopsis</strong>
  152. </p><div class="example">
  153. <pre class="example">bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
  154. </pre></div>
  155. <p><strong>Description</strong><br>
  156. Set the head of the chain of
  157. BFDs contained in the archive <var>output</var> to <var>new_head</var>.
  158. </p>
  159. <a name="index-bfd_005fopenr_005fnext_005farchived_005ffile"></a>
  160. <a name="bfd_005fopenr_005fnext_005farchived_005ffile"></a>
  161. <h4 class="subsubsection">2.8.1.3 <code>bfd_openr_next_archived_file</code></h4>
  162. <p><strong>Synopsis</strong>
  163. </p><div class="example">
  164. <pre class="example">bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
  165. </pre></div>
  166. <p><strong>Description</strong><br>
  167. Provided a BFD, <var>archive</var>, containing an archive and NULL, open
  168. an input BFD on the first contained element and returns that.
  169. Subsequent calls should pass the archive and the previous return
  170. value to return a created BFD to the next contained element. NULL
  171. is returned when there are no more.
  172. Note - if you want to process the bfd returned by this call be
  173. sure to call bfd_check_format() on it first.
  174. </p>
  175. <hr>
  176. <div class="header">
  177. <p>
  178. Next: <a href="Formats.html#Formats" accesskey="n" rel="next">Formats</a>, Previous: <a href="Symbols.html#Symbols" accesskey="p" rel="prev">Symbols</a>, Up: <a href="BFD-front-end.html#BFD-front-end" accesskey="u" rel="up">BFD front end</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="BFD-Index.html#BFD-Index" title="Index" rel="index">Index</a>]</p>
  179. </div>
  180. </body>
  181. </html>