Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

154 lines
7.2KB

  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>PowerPC ELF32 (LD)</title>
  17. <meta name="description" content="PowerPC ELF32 (LD)">
  18. <meta name="keywords" content="PowerPC ELF32 (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="Machine-Dependent.html#Machine-Dependent" rel="up" title="Machine Dependent">
  26. <link href="PowerPC64-ELF64.html#PowerPC64-ELF64" rel="next" title="PowerPC64 ELF64">
  27. <link href="Nios-II.html#Nios-II" rel="prev" title="Nios II">
  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="PowerPC-ELF32"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="PowerPC64-ELF64.html#PowerPC64-ELF64" accesskey="n" rel="next">PowerPC64 ELF64</a>, Previous: <a href="Nios-II.html#Nios-II" accesskey="p" rel="prev">Nios II</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>
  61. </div>
  62. <hr>
  63. <a name="ld-and-PowerPC-32_002dbit-ELF-Support"></a>
  64. <h3 class="section">4.11 <code>ld</code> and PowerPC 32-bit ELF Support</h3>
  65. <a name="index-PowerPC-long-branches"></a>
  66. <a name="index-_002d_002drelax-on-PowerPC"></a>
  67. <p>Branches on PowerPC processors are limited to a signed 26-bit
  68. displacement, which may result in <code>ld</code> giving
  69. &lsquo;<samp>relocation truncated to fit</samp>&rsquo; errors with very large programs.
  70. &lsquo;<samp>--relax</samp>&rsquo; enables the generation of trampolines that can access
  71. the entire 32-bit address space. These trampolines are inserted at
  72. section boundaries, so may not themselves be reachable if an input
  73. section exceeds 33M in size. You may combine &lsquo;<samp>-r</samp>&rsquo; and
  74. &lsquo;<samp>--relax</samp>&rsquo; to add trampolines in a partial link. In that case
  75. both branches to undefined symbols and inter-section branches are also
  76. considered potentially out of range, and trampolines inserted.
  77. </p>
  78. <a name="index-PowerPC-ELF32-options"></a>
  79. <dl compact="compact">
  80. <dd><a name="index-PowerPC-PLT"></a>
  81. <a name="index-_002d_002dbss_002dplt"></a>
  82. </dd>
  83. <dt><samp>--bss-plt</samp></dt>
  84. <dd><p>Current PowerPC GCC accepts a &lsquo;<samp>-msecure-plt</samp>&rsquo; option that
  85. generates code capable of using a newer PLT and GOT layout that has
  86. the security advantage of no executable section ever needing to be
  87. writable and no writable section ever being executable. PowerPC
  88. <code>ld</code> will generate this layout, including stubs to access the
  89. PLT, if all input files (including startup and static libraries) were
  90. compiled with &lsquo;<samp>-msecure-plt</samp>&rsquo;. &lsquo;<samp>--bss-plt</samp>&rsquo; forces the old
  91. BSS PLT (and GOT layout) which can give slightly better performance.
  92. </p>
  93. <a name="index-_002d_002dsecure_002dplt"></a>
  94. </dd>
  95. <dt><samp>--secure-plt</samp></dt>
  96. <dd><p><code>ld</code> will use the new PLT and GOT layout if it is linking new
  97. &lsquo;<samp>-fpic</samp>&rsquo; or &lsquo;<samp>-fPIC</samp>&rsquo; code, but does not do so automatically
  98. when linking non-PIC code. This option requests the new PLT and GOT
  99. layout. A warning will be given if some object file requires the old
  100. style BSS PLT.
  101. </p>
  102. <a name="index-PowerPC-GOT"></a>
  103. <a name="index-_002d_002dsdata_002dgot"></a>
  104. </dd>
  105. <dt><samp>--sdata-got</samp></dt>
  106. <dd><p>The new secure PLT and GOT are placed differently relative to other
  107. sections compared to older BSS PLT and GOT placement. The location of
  108. <code>.plt</code> must change because the new secure PLT is an initialized
  109. section while the old PLT is uninitialized. The reason for the
  110. <code>.got</code> change is more subtle: The new placement allows
  111. <code>.got</code> to be read-only in applications linked with
  112. &lsquo;<samp>-z relro -z now</samp>&rsquo;. However, this placement means that
  113. <code>.sdata</code> cannot always be used in shared libraries, because the
  114. PowerPC ABI accesses <code>.sdata</code> in shared libraries from the GOT
  115. pointer. &lsquo;<samp>--sdata-got</samp>&rsquo; forces the old GOT placement. PowerPC
  116. GCC doesn&rsquo;t use <code>.sdata</code> in shared libraries, so this option is
  117. really only useful for other compilers that may do so.
  118. </p>
  119. <a name="index-PowerPC-stub-symbols"></a>
  120. <a name="index-_002d_002demit_002dstub_002dsyms"></a>
  121. </dd>
  122. <dt><samp>--emit-stub-syms</samp></dt>
  123. <dd><p>This option causes <code>ld</code> to label linker stubs with a local
  124. symbol that encodes the stub type and destination.
  125. </p>
  126. <a name="index-PowerPC-TLS-optimization"></a>
  127. <a name="index-_002d_002dno_002dtls_002doptimize"></a>
  128. </dd>
  129. <dt><samp>--no-tls-optimize</samp></dt>
  130. <dd><p>PowerPC <code>ld</code> normally performs some optimization of code
  131. sequences used to access Thread-Local Storage. Use this option to
  132. disable the optimization.
  133. </p></dd>
  134. </dl>
  135. <hr>
  136. <div class="header">
  137. <p>
  138. Next: <a href="PowerPC64-ELF64.html#PowerPC64-ELF64" accesskey="n" rel="next">PowerPC64 ELF64</a>, Previous: <a href="Nios-II.html#Nios-II" accesskey="p" rel="prev">Nios II</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>
  139. </div>
  140. </body>
  141. </html>