BFD-information-loss.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  19. <head>
  20. <title>Untitled Document: BFD information loss</title>
  21. <meta name="description" content="Untitled Document: BFD information loss">
  22. <meta name="keywords" content="Untitled Document: BFD information loss">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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="What-BFD-Version-2-Can-Do.html#What-BFD-Version-2-Can-Do" rel="up" title="What BFD Version 2 Can Do">
  31. <link href="Canonical-format.html#Canonical-format" rel="next" title="Canonical format">
  32. <link href="What-BFD-Version-2-Can-Do.html#What-BFD-Version-2-Can-Do" rel="prev" title="What BFD Version 2 Can Do">
  33. <style type="text/css">
  34. <!--
  35. a.summary-letter {text-decoration: none}
  36. blockquote.smallquotation {font-size: smaller}
  37. div.display {margin-left: 3.2em}
  38. div.example {margin-left: 3.2em}
  39. div.indentedblock {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  55. span.nolinebreak {white-space:nowrap}
  56. span.roman {font-family:serif; font-weight:normal}
  57. span.sansserif {font-family:sans-serif; font-weight:normal}
  58. ul.no-bullet {list-style: none}
  59. -->
  60. </style>
  61. </head>
  62. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  63. <a name="BFD-information-loss"></a>
  64. <div class="header">
  65. <p>
  66. Next: <a href="Canonical-format.html#Canonical-format" accesskey="n" rel="next">Canonical format</a>, Up: <a href="What-BFD-Version-2-Can-Do.html#What-BFD-Version-2-Can-Do" accesskey="u" rel="up">What BFD Version 2 Can Do</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>
  67. </div>
  68. <hr>
  69. <a name="Information-Loss"></a>
  70. <h4 class="subsection">1.3.1 Information Loss</h4>
  71. <p><em>Information can be lost during output.</em> The output formats
  72. supported by BFD do not provide identical facilities, and
  73. information which can be described in one form has nowhere to go in
  74. another format. One example of this is alignment information in
  75. <code>b.out</code>. There is nowhere in an <code>a.out</code> format file to store
  76. alignment information on the contained data, so when a file is linked
  77. from <code>b.out</code> and an <code>a.out</code> image is produced, alignment
  78. information will not propagate to the output file. (The linker will
  79. still use the alignment information internally, so the link is performed
  80. correctly).
  81. </p>
  82. <p>Another example is COFF section names. COFF files may contain an
  83. unlimited number of sections, each one with a textual section name. If
  84. the target of the link is a format which does not have many sections (e.g.,
  85. <code>a.out</code>) or has sections without names (e.g., the Oasys format), the
  86. link cannot be done simply. You can circumvent this problem by
  87. describing the desired input-to-output section mapping with the linker command
  88. language.
  89. </p>
  90. <p><em>Information can be lost during canonicalization.</em> The BFD
  91. internal canonical form of the external formats is not exhaustive; there
  92. are structures in input formats for which there is no direct
  93. representation internally. This means that the BFD back ends
  94. cannot maintain all possible data richness through the transformation
  95. between external to internal and back to external formats.
  96. </p>
  97. <p>This limitation is only a problem when an application reads one
  98. format and writes another. Each BFD back end is responsible for
  99. maintaining as much data as possible, and the internal BFD
  100. canonical form has structures which are opaque to the BFD core,
  101. and exported only to the back ends. When a file is read in one format,
  102. the canonical form is generated for BFD and the application. At the
  103. same time, the back end saves away any information which may otherwise
  104. be lost. If the data is then written back in the same format, the back
  105. end routine will be able to use the canonical form provided by the
  106. BFD core as well as the information it prepared earlier. Since
  107. there is a great deal of commonality between back ends,
  108. there is no information lost when
  109. linking or copying big endian COFF to little endian COFF, or <code>a.out</code> to
  110. <code>b.out</code>. When a mixture of formats is linked, the information is
  111. only lost from the files whose format differs from the destination.
  112. </p>
  113. <hr>
  114. <div class="header">
  115. <p>
  116. Next: <a href="Canonical-format.html#Canonical-format" accesskey="n" rel="next">Canonical format</a>, Up: <a href="What-BFD-Version-2-Can-Do.html#What-BFD-Version-2-Can-Do" accesskey="u" rel="up">What BFD Version 2 Can Do</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>
  117. </div>
  118. </body>
  119. </html>