PageRenderTime 55ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/share/doc/ld/ld.html/PowerPC64-ELF64.html

https://gitlab.com/infected_/linaro_aarch64-linux-android-5.3.x
HTML | 244 lines | 194 code | 11 blank | 39 comment | 0 complexity | 13837f862528b99dc943e97e0c3932cf MD5 | raw file
  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.25.
  6. Copyright (C) 1991-2014 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: PowerPC64 ELF64</title>
  16. <meta name="description" content="LD: PowerPC64 ELF64">
  17. <meta name="keywords" content="LD: PowerPC64 ELF64">
  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="SPU-ELF.html#SPU-ELF" rel="next" title="SPU ELF">
  27. <link href="PowerPC-ELF32.html#PowerPC-ELF32" rel="prev" title="PowerPC ELF32">
  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="PowerPC64-ELF64"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="SPU-ELF.html#SPU-ELF" accesskey="n" rel="next">SPU ELF</a>, Previous: <a href="PowerPC-ELF32.html#PowerPC-ELF32" accesskey="p" rel="prev">PowerPC ELF32</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-PowerPC64-64_002dbit-ELF-Support"></a>
  65. <h3 class="section">4.13 <code>ld</code> and PowerPC64 64-bit ELF Support</h3>
  66. <a name="index-PowerPC64-ELF64-options"></a>
  67. <dl compact="compact">
  68. <dd><a name="index-PowerPC64-stub-grouping"></a>
  69. <a name="index-_002d_002dstub_002dgroup_002dsize"></a>
  70. </dd>
  71. <dt><samp>--stub-group-size</samp></dt>
  72. <dd><p>Long branch stubs, PLT call stubs and TOC adjusting stubs are placed
  73. by <code>ld</code> in stub sections located between groups of input sections.
  74. &lsquo;<samp>--stub-group-size</samp>&rsquo; specifies the maximum size of a group of input
  75. sections handled by one stub section. Since branch offsets are signed,
  76. a stub section may serve two groups of input sections, one group before
  77. the stub section, and one group after it. However, when using
  78. conditional branches that require stubs, it may be better (for branch
  79. prediction) that stub sections only serve one group of input sections.
  80. A negative value for &lsquo;<samp>N</samp>&rsquo; chooses this scheme, ensuring that
  81. branches to stubs always use a negative offset. Two special values of
  82. &lsquo;<samp>N</samp>&rsquo; are recognized, &lsquo;<samp>1</samp>&rsquo; and &lsquo;<samp>-1</samp>&rsquo;. These both instruct
  83. <code>ld</code> to automatically size input section groups for the branch types
  84. detected, with the same behaviour regarding stub placement as other
  85. positive or negative values of &lsquo;<samp>N</samp>&rsquo; respectively.
  86. </p>
  87. <p>Note that &lsquo;<samp>--stub-group-size</samp>&rsquo; does not split input sections. A
  88. single input section larger than the group size specified will of course
  89. create a larger group (of one section). If input sections are too
  90. large, it may not be possible for a branch to reach its stub.
  91. </p>
  92. <a name="index-PowerPC64-stub-symbols"></a>
  93. <a name="index-_002d_002demit_002dstub_002dsyms-1"></a>
  94. </dd>
  95. <dt><samp>--emit-stub-syms</samp></dt>
  96. <dd><p>This option causes <code>ld</code> to label linker stubs with a local
  97. symbol that encodes the stub type and destination.
  98. </p>
  99. <a name="index-PowerPC64-dot-symbols"></a>
  100. <a name="index-_002d_002ddotsyms"></a>
  101. <a name="index-_002d_002dno_002ddotsyms"></a>
  102. </dd>
  103. <dt><samp>--dotsyms, --no-dotsyms</samp></dt>
  104. <dd><p>These two options control how <code>ld</code> interprets version patterns
  105. in a version script. Older PowerPC64 compilers emitted both a
  106. function descriptor symbol with the same name as the function, and a
  107. code entry symbol with the name prefixed by a dot (&lsquo;<samp>.</samp>&rsquo;). To
  108. properly version a function &lsquo;<samp>foo</samp>&rsquo;, the version script thus needs
  109. to control both &lsquo;<samp>foo</samp>&rsquo; and &lsquo;<samp>.foo</samp>&rsquo;. The option
  110. &lsquo;<samp>--dotsyms</samp>&rsquo;, on by default, automatically adds the required
  111. dot-prefixed patterns. Use &lsquo;<samp>--no-dotsyms</samp>&rsquo; to disable this
  112. feature.
  113. </p>
  114. <a name="index-PowerPC64-TLS-optimization"></a>
  115. <a name="index-_002d_002dno_002dtls_002doptimize-1"></a>
  116. </dd>
  117. <dt><samp>--no-tls-optimize</samp></dt>
  118. <dd><p>PowerPC64 <code>ld</code> normally performs some optimization of code
  119. sequences used to access Thread-Local Storage. Use this option to
  120. disable the optimization.
  121. </p>
  122. <a name="index-PowerPC64-OPD-optimization"></a>
  123. <a name="index-_002d_002dno_002dopd_002doptimize"></a>
  124. </dd>
  125. <dt><samp>--no-opd-optimize</samp></dt>
  126. <dd><p>PowerPC64 <code>ld</code> normally removes <code>.opd</code> section entries
  127. corresponding to deleted link-once functions, or functions removed by
  128. the action of &lsquo;<samp>--gc-sections</samp>&rsquo; or linker script <code>/DISCARD/</code>.
  129. Use this option to disable <code>.opd</code> optimization.
  130. </p>
  131. <a name="index-PowerPC64-OPD-spacing"></a>
  132. <a name="index-_002d_002dnon_002doverlapping_002dopd"></a>
  133. </dd>
  134. <dt><samp>--non-overlapping-opd</samp></dt>
  135. <dd><p>Some PowerPC64 compilers have an option to generate compressed
  136. <code>.opd</code> entries spaced 16 bytes apart, overlapping the third word,
  137. the static chain pointer (unused in C) with the first word of the next
  138. entry. This option expands such entries to the full 24 bytes.
  139. </p>
  140. <a name="index-PowerPC64-TOC-optimization"></a>
  141. <a name="index-_002d_002dno_002dtoc_002doptimize"></a>
  142. </dd>
  143. <dt><samp>--no-toc-optimize</samp></dt>
  144. <dd><p>PowerPC64 <code>ld</code> normally removes unused <code>.toc</code> section
  145. entries. Such entries are detected by examining relocations that
  146. reference the TOC in code sections. A reloc in a deleted code section
  147. marks a TOC word as unneeded, while a reloc in a kept code section
  148. marks a TOC word as needed. Since the TOC may reference itself, TOC
  149. relocs are also examined. TOC words marked as both needed and
  150. unneeded will of course be kept. TOC words without any referencing
  151. reloc are assumed to be part of a multi-word entry, and are kept or
  152. discarded as per the nearest marked preceding word. This works
  153. reliably for compiler generated code, but may be incorrect if assembly
  154. code is used to insert TOC entries. Use this option to disable the
  155. optimization.
  156. </p>
  157. <a name="index-PowerPC64-multi_002dTOC"></a>
  158. <a name="index-_002d_002dno_002dmulti_002dtoc"></a>
  159. </dd>
  160. <dt><samp>--no-multi-toc</samp></dt>
  161. <dd><p>If given any toc option besides <code>-mcmodel=medium</code> or
  162. <code>-mcmodel=large</code>, PowerPC64 GCC generates code for a TOC model
  163. where TOC
  164. entries are accessed with a 16-bit offset from r2. This limits the
  165. total TOC size to 64K. PowerPC64 <code>ld</code> extends this limit by
  166. grouping code sections such that each group uses less than 64K for its
  167. TOC entries, then inserts r2 adjusting stubs between inter-group
  168. calls. <code>ld</code> does not split apart input sections, so cannot
  169. help if a single input file has a <code>.toc</code> section that exceeds
  170. 64K, most likely from linking multiple files with <code>ld -r</code>.
  171. Use this option to turn off this feature.
  172. </p>
  173. <a name="index-PowerPC64-TOC-sorting"></a>
  174. <a name="index-_002d_002dno_002dtoc_002dsort"></a>
  175. </dd>
  176. <dt><samp>--no-toc-sort</samp></dt>
  177. <dd><p>By default, <code>ld</code> sorts TOC sections so that those whose file
  178. happens to have a section called <code>.init</code> or <code>.fini</code> are
  179. placed first, followed by TOC sections referenced by code generated
  180. with PowerPC64 gcc&rsquo;s <code>-mcmodel=small</code>, and lastly TOC sections
  181. referenced only by code generated with PowerPC64 gcc&rsquo;s
  182. <code>-mcmodel=medium</code> or <code>-mcmodel=large</code> options. Doing this
  183. results in better TOC grouping for multi-TOC. Use this option to turn
  184. off this feature.
  185. </p>
  186. <a name="index-PowerPC64-PLT-stub-alignment"></a>
  187. <a name="index-_002d_002dplt_002dalign"></a>
  188. <a name="index-_002d_002dno_002dplt_002dalign"></a>
  189. </dd>
  190. <dt><samp>--plt-align</samp></dt>
  191. <dt><samp>--no-plt-align</samp></dt>
  192. <dd><p>Use these options to control whether individual PLT call stubs are
  193. padded so that they don&rsquo;t cross a 32-byte boundary, or to the
  194. specified power of two boundary when using <code>--plt-align=</code>. Note
  195. that this isn&rsquo;t alignment in the usual sense. By default PLT call
  196. stubs are packed tightly.
  197. </p>
  198. <a name="index-PowerPC64-PLT-call-stub-static-chain"></a>
  199. <a name="index-_002d_002dplt_002dstatic_002dchain"></a>
  200. <a name="index-_002d_002dno_002dplt_002dstatic_002dchain"></a>
  201. </dd>
  202. <dt><samp>--plt-static-chain</samp></dt>
  203. <dt><samp>--no-plt-static-chain</samp></dt>
  204. <dd><p>Use these options to control whether PLT call stubs load the static
  205. chain pointer (r11). <code>ld</code> defaults to not loading the static
  206. chain since there is never any need to do so on a PLT call.
  207. </p>
  208. <a name="index-PowerPC64-PLT-call-stub-thread-safety"></a>
  209. <a name="index-_002d_002dplt_002dthread_002dsafe"></a>
  210. <a name="index-_002d_002dno_002dplt_002dthread_002dsafe"></a>
  211. </dd>
  212. <dt><samp>--plt-thread-safe</samp></dt>
  213. <dt><samp>--no-thread-safe</samp></dt>
  214. <dd><p>With power7&rsquo;s weakly ordered memory model, it is possible when using
  215. lazy binding for ld.so to update a plt entry in one thread and have
  216. another thread see the individual plt entry words update in the wrong
  217. order, despite ld.so carefully writing in the correct order and using
  218. memory write barriers. To avoid this we need some sort of read
  219. barrier in the call stub, or use LD_BIND_NOW=1. By default, <code>ld</code>
  220. looks for calls to commonly used functions that create threads, and if
  221. seen, adds the necessary barriers. Use these options to change the
  222. default behaviour.
  223. </p></dd>
  224. </dl>
  225. <hr>
  226. <div class="header">
  227. <p>
  228. Next: <a href="SPU-ELF.html#SPU-ELF" accesskey="n" rel="next">SPU ELF</a>, Previous: <a href="PowerPC-ELF32.html#PowerPC-ELF32" accesskey="p" rel="prev">PowerPC ELF32</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>
  229. </div>
  230. </body>
  231. </html>