You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 satır
6.1KB

  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>Targets (Untitled Document)</title>
  22. <meta name="description" content="Targets (Untitled Document)">
  23. <meta name="keywords" content="Targets (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="bfd_005ftarget.html#bfd_005ftarget" rel="next" title="bfd_target">
  32. <link href="Core-Files.html#Core-Files" rel="prev" title="Core Files">
  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="Targets"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Architectures.html#Architectures" accesskey="n" rel="next">Architectures</a>, Previous: <a href="Core-Files.html#Core-Files" accesskey="p" rel="prev">Core Files</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="Targets-1"></a>
  69. <h3 class="section">2.12 Targets</h3>
  70. <p><strong>Description</strong><br>
  71. Each port of BFD to a different machine requires the creation
  72. of a target back end. All the back end provides to the root
  73. part of BFD is a structure containing pointers to functions
  74. which perform certain low level operations on files. BFD
  75. translates the applications&rsquo;s requests through a pointer into
  76. calls to the back end routines.
  77. </p>
  78. <p>When a file is opened with <code>bfd_openr</code>, its format and
  79. target are unknown. BFD uses various mechanisms to determine
  80. how to interpret the file. The operations performed are:
  81. </p>
  82. <ul>
  83. <li> Create a BFD by calling the internal routine
  84. <code>_bfd_new_bfd</code>, then call <code>bfd_find_target</code> with the
  85. target string supplied to <code>bfd_openr</code> and the new BFD pointer.
  86. </li><li> If a null target string was provided to <code>bfd_find_target</code>,
  87. look up the environment variable <code>GNUTARGET</code> and use
  88. that as the target string.
  89. </li><li> If the target string is still <code>NULL</code>, or the target string is
  90. <code>default</code>, then use the first item in the target vector
  91. as the target type, and set <code>target_defaulted</code> in the BFD to
  92. cause <code>bfd_check_format</code> to loop through all the targets.
  93. See <a href="bfd_005ftarget.html#bfd_005ftarget">bfd_target</a>. See <a href="Formats.html#Formats">Formats</a>.
  94. </li><li> Otherwise, inspect the elements in the target vector
  95. one by one, until a match on target name is found. When found,
  96. use it.
  97. </li><li> Otherwise return the error <code>bfd_error_invalid_target</code> to
  98. <code>bfd_openr</code>.
  99. </li><li> <code>bfd_openr</code> attempts to open the file using
  100. <code>bfd_open_file</code>, and returns the BFD.
  101. </li></ul>
  102. <p>Once the BFD has been opened and the target selected, the file
  103. format may be determined. This is done by calling
  104. <code>bfd_check_format</code> on the BFD with a suggested format.
  105. If <code>target_defaulted</code> has been set, each possible target
  106. type is tried to see if it recognizes the specified format.
  107. <code>bfd_check_format</code> returns <code>TRUE</code> when the caller guesses right.
  108. </p><table class="menu" border="0" cellspacing="0">
  109. <tr><td align="left" valign="top">&bull; <a href="bfd_005ftarget.html#bfd_005ftarget" accesskey="1">bfd_target</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
  110. </td></tr>
  111. </table>
  112. <hr>
  113. <div class="header">
  114. <p>
  115. Next: <a href="Architectures.html#Architectures" accesskey="n" rel="next">Architectures</a>, Previous: <a href="Core-Files.html#Core-Files" accesskey="p" rel="prev">Core Files</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>
  116. </div>
  117. </body>
  118. </html>