BFD-information-loss.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 GNU linker LD
  4. (GNU Binutils)
  5. version 2.28.
  6. Copyright (C) 1991-2017 Free Software Foundation, Inc.
  7. Permission is granted to copy, distribute and/or modify this document
  8. under the terms of the GNU Free Documentation License, Version 1.3
  9. or any later version published by the Free Software Foundation;
  10. with no Invariant Sections, with no Front-Cover Texts, and with no
  11. Back-Cover Texts. A copy of the license is included in the
  12. section entitled "GNU Free Documentation License". -->
  13. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>LD: BFD information loss</title>
  16. <meta name="description" content="LD: BFD information loss">
  17. <meta name="keywords" content="LD: BFD information loss">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="LD-Index.html#LD-Index" rel="index" title="LD Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="BFD-outline.html#BFD-outline" rel="up" title="BFD outline">
  26. <link href="Canonical-format.html#Canonical-format" rel="next" title="Canonical format">
  27. <link href="BFD-outline.html#BFD-outline" rel="prev" title="BFD outline">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="BFD-information-loss"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Canonical-format.html#Canonical-format" accesskey="n" rel="next">Canonical format</a>, Up: <a href="BFD-outline.html#BFD-outline" accesskey="u" rel="up">BFD outline</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LD-Index.html#LD-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="Information-Loss"></a>
  65. <h4 class="subsection">5.1.1 Information Loss</h4>
  66. <p><em>Information can be lost during output.</em> The output formats
  67. supported by BFD do not provide identical facilities, and
  68. information which can be described in one form has nowhere to go in
  69. another format. One example of this is alignment information in
  70. <code>b.out</code>. There is nowhere in an <code>a.out</code> format file to store
  71. alignment information on the contained data, so when a file is linked
  72. from <code>b.out</code> and an <code>a.out</code> image is produced, alignment
  73. information will not propagate to the output file. (The linker will
  74. still use the alignment information internally, so the link is performed
  75. correctly).
  76. </p>
  77. <p>Another example is COFF section names. COFF files may contain an
  78. unlimited number of sections, each one with a textual section name. If
  79. the target of the link is a format which does not have many sections (e.g.,
  80. <code>a.out</code>) or has sections without names (e.g., the Oasys format), the
  81. link cannot be done simply. You can circumvent this problem by
  82. describing the desired input-to-output section mapping with the linker command
  83. language.
  84. </p>
  85. <p><em>Information can be lost during canonicalization.</em> The BFD
  86. internal canonical form of the external formats is not exhaustive; there
  87. are structures in input formats for which there is no direct
  88. representation internally. This means that the BFD back ends
  89. cannot maintain all possible data richness through the transformation
  90. between external to internal and back to external formats.
  91. </p>
  92. <p>This limitation is only a problem when an application reads one
  93. format and writes another. Each BFD back end is responsible for
  94. maintaining as much data as possible, and the internal BFD
  95. canonical form has structures which are opaque to the BFD core,
  96. and exported only to the back ends. When a file is read in one format,
  97. the canonical form is generated for BFD and the application. At the
  98. same time, the back end saves away any information which may otherwise
  99. be lost. If the data is then written back in the same format, the back
  100. end routine will be able to use the canonical form provided by the
  101. BFD core as well as the information it prepared earlier. Since
  102. there is a great deal of commonality between back ends,
  103. there is no information lost when
  104. linking or copying big endian COFF to little endian COFF, or <code>a.out</code> to
  105. <code>b.out</code>. When a mixture of formats is linked, the information is
  106. only lost from the files whose format differs from the destination.
  107. </p>
  108. <hr>
  109. <div class="header">
  110. <p>
  111. Next: <a href="Canonical-format.html#Canonical-format" accesskey="n" rel="next">Canonical format</a>, Up: <a href="BFD-outline.html#BFD-outline" accesskey="u" rel="up">BFD outline</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LD-Index.html#LD-Index" title="Index" rel="index">Index</a>]</p>
  112. </div>
  113. </body>
  114. </html>