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.

110 satır
5.0KB

  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 Arm Embedded Toolchain 10-2020-q4-major)
  5. version 2.35.1.
  6. Copyright (C) 1991-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>Input Section Common (LD)</title>
  17. <meta name="description" content="Input Section Common (LD)">
  18. <meta name="keywords" content="Input Section Common (LD)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  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="Input-Section.html#Input-Section" rel="up" title="Input Section">
  26. <link href="Input-Section-Keep.html#Input-Section-Keep" rel="next" title="Input Section Keep">
  27. <link href="Input-Section-Wildcards.html#Input-Section-Wildcards" rel="prev" title="Input Section Wildcards">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="Input-Section-Common"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Input-Section-Keep.html#Input-Section-Keep" accesskey="n" rel="next">Input Section Keep</a>, Previous: <a href="Input-Section-Wildcards.html#Input-Section-Wildcards" accesskey="p" rel="prev">Input Section Wildcards</a>, Up: <a href="Input-Section.html#Input-Section" accesskey="u" rel="up">Input Section</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>
  61. </div>
  62. <hr>
  63. <a name="Input-Section-for-Common-Symbols"></a>
  64. <h4 class="subsubsection">3.6.4.3 Input Section for Common Symbols</h4>
  65. <a name="index-common-symbol-placement"></a>
  66. <a name="index-uninitialized-data-placement"></a>
  67. <p>A special notation is needed for common symbols, because in many object
  68. file formats common symbols do not have a particular input section. The
  69. linker treats common symbols as though they are in an input section
  70. named &lsquo;<samp>COMMON</samp>&rsquo;.
  71. </p>
  72. <p>You may use file names with the &lsquo;<samp>COMMON</samp>&rsquo; section just as with any
  73. other input sections. You can use this to place common symbols from a
  74. particular input file in one section while common symbols from other
  75. input files are placed in another section.
  76. </p>
  77. <p>In most cases, common symbols in input files will be placed in the
  78. &lsquo;<samp>.bss</samp>&rsquo; section in the output file. For example:
  79. </p><div class="smallexample">
  80. <pre class="smallexample">.bss { *(.bss) *(COMMON) }
  81. </pre></div>
  82. <a name="index-scommon-section"></a>
  83. <a name="index-small-common-symbols"></a>
  84. <p>Some object file formats have more than one type of common symbol. For
  85. example, the MIPS ELF object file format distinguishes standard common
  86. symbols and small common symbols. In this case, the linker will use a
  87. different special section name for other types of common symbols. In
  88. the case of MIPS ELF, the linker uses &lsquo;<samp>COMMON</samp>&rsquo; for standard common
  89. symbols and &lsquo;<samp>.scommon</samp>&rsquo; for small common symbols. This permits you
  90. to map the different types of common symbols into memory at different
  91. locations.
  92. </p>
  93. <a name="index-_005bCOMMON_005d"></a>
  94. <p>You will sometimes see &lsquo;<samp>[COMMON]</samp>&rsquo; in old linker scripts. This
  95. notation is now considered obsolete. It is equivalent to
  96. &lsquo;<samp>*(COMMON)</samp>&rsquo;.
  97. </p>
  98. </body>
  99. </html>