SPU-ELF.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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: SPU ELF</title>
  16. <meta name="description" content="LD: SPU ELF">
  17. <meta name="keywords" content="LD: SPU ELF">
  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="Machine-Dependent.html#Machine-Dependent" rel="up" title="Machine Dependent">
  26. <link href="TI-COFF.html#TI-COFF" rel="next" title="TI COFF">
  27. <link href="PowerPC64-ELF64.html#PowerPC64-ELF64" rel="prev" title="PowerPC64 ELF64">
  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="SPU-ELF"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="TI-COFF.html#TI-COFF" accesskey="n" rel="next">TI COFF</a>, Previous: <a href="PowerPC64-ELF64.html#PowerPC64-ELF64" accesskey="p" rel="prev">PowerPC64 ELF64</a>, Up: <a href="Machine-Dependent.html#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</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="ld-and-SPU-ELF-Support"></a>
  65. <h3 class="section">4.14 <code>ld</code> and SPU ELF Support</h3>
  66. <a name="index-SPU-ELF-options"></a>
  67. <dl compact="compact">
  68. <dd>
  69. <a name="index-SPU-plugins"></a>
  70. <a name="index-_002d_002dplugin"></a>
  71. </dd>
  72. <dt><samp>--plugin</samp></dt>
  73. <dd><p>This option marks an executable as a PIC plugin module.
  74. </p>
  75. <a name="index-SPU-overlays"></a>
  76. <a name="index-_002d_002dno_002doverlays"></a>
  77. </dd>
  78. <dt><samp>--no-overlays</samp></dt>
  79. <dd><p>Normally, <code>ld</code> recognizes calls to functions within overlay
  80. regions, and redirects such calls to an overlay manager via a stub.
  81. <code>ld</code> also provides a built-in overlay manager. This option
  82. turns off all this special overlay handling.
  83. </p>
  84. <a name="index-SPU-overlay-stub-symbols"></a>
  85. <a name="index-_002d_002demit_002dstub_002dsyms-2"></a>
  86. </dd>
  87. <dt><samp>--emit-stub-syms</samp></dt>
  88. <dd><p>This option causes <code>ld</code> to label overlay stubs with a local
  89. symbol that encodes the stub type and destination.
  90. </p>
  91. <a name="index-SPU-extra-overlay-stubs"></a>
  92. <a name="index-_002d_002dextra_002doverlay_002dstubs"></a>
  93. </dd>
  94. <dt><samp>--extra-overlay-stubs</samp></dt>
  95. <dd><p>This option causes <code>ld</code> to add overlay call stubs on all
  96. function calls out of overlay regions. Normally stubs are not added
  97. on calls to non-overlay regions.
  98. </p>
  99. <a name="index-SPU-local-store-size"></a>
  100. <a name="index-_002d_002dlocal_002dstore_003dlo_003ahi"></a>
  101. </dd>
  102. <dt><samp>--local-store=lo:hi</samp></dt>
  103. <dd><p><code>ld</code> usually checks that a final executable for SPU fits in
  104. the address range 0 to 256k. This option may be used to change the
  105. range. Disable the check entirely with <samp>--local-store=0:0</samp>.
  106. </p>
  107. <a name="index-SPU"></a>
  108. <a name="index-_002d_002dstack_002danalysis"></a>
  109. </dd>
  110. <dt><samp>--stack-analysis</samp></dt>
  111. <dd><p>SPU local store space is limited. Over-allocation of stack space
  112. unnecessarily limits space available for code and data, while
  113. under-allocation results in runtime failures. If given this option,
  114. <code>ld</code> will provide an estimate of maximum stack usage.
  115. <code>ld</code> does this by examining symbols in code sections to
  116. determine the extents of functions, and looking at function prologues
  117. for stack adjusting instructions. A call-graph is created by looking
  118. for relocations on branch instructions. The graph is then searched
  119. for the maximum stack usage path. Note that this analysis does not
  120. find calls made via function pointers, and does not handle recursion
  121. and other cycles in the call graph. Stack usage may be
  122. under-estimated if your code makes such calls. Also, stack usage for
  123. dynamic allocation, e.g. alloca, will not be detected. If a link map
  124. is requested, detailed information about each function&rsquo;s stack usage
  125. and calls will be given.
  126. </p>
  127. <a name="index-SPU-1"></a>
  128. <a name="index-_002d_002demit_002dstack_002dsyms"></a>
  129. </dd>
  130. <dt><samp>--emit-stack-syms</samp></dt>
  131. <dd><p>This option, if given along with <samp>--stack-analysis</samp> will result
  132. in <code>ld</code> emitting stack sizing symbols for each function.
  133. These take the form <code>__stack_&lt;function_name&gt;</code> for global
  134. functions, and <code>__stack_&lt;number&gt;_&lt;function_name&gt;</code> for static
  135. functions. <code>&lt;number&gt;</code> is the section id in hex. The value of
  136. such symbols is the stack requirement for the corresponding function.
  137. The symbol size will be zero, type <code>STT_NOTYPE</code>, binding
  138. <code>STB_LOCAL</code>, and section <code>SHN_ABS</code>.
  139. </p></dd>
  140. </dl>
  141. <hr>
  142. <div class="header">
  143. <p>
  144. Next: <a href="TI-COFF.html#TI-COFF" accesskey="n" rel="next">TI COFF</a>, Previous: <a href="PowerPC64-ELF64.html#PowerPC64-ELF64" accesskey="p" rel="prev">PowerPC64 ELF64</a>, Up: <a href="Machine-Dependent.html#Machine-Dependent" accesskey="u" rel="up">Machine Dependent</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>
  145. </div>
  146. </body>
  147. </html>