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.

138 lines
6.1KB

  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>H8/300 (LD)</title>
  17. <meta name="description" content="H8/300 (LD)">
  18. <meta name="keywords" content="H8/300 (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="M68HC11_002f68HC12.html#M68HC11_002f68HC12" rel="next" title="M68HC11/68HC12">
  27. <link href="Machine-Dependent.html#Machine-Dependent" rel="prev" title="Machine Dependent">
  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="H8_002f300"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="M68HC11_002f68HC12.html#M68HC11_002f68HC12" accesskey="n" rel="next">M68HC11/68HC12</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-the-H8_002f300"></a>
  64. <h3 class="section">4.1 <code>ld</code> and the H8/300</h3>
  65. <a name="index-H8_002f300-support"></a>
  66. <p>For the H8/300, <code>ld</code> can perform these global optimizations when
  67. you specify the &lsquo;<samp>--relax</samp>&rsquo; command-line option.
  68. </p>
  69. <dl compact="compact">
  70. <dd><a name="index-relaxing-on-H8_002f300"></a>
  71. </dd>
  72. <dt><em>relaxing address modes</em></dt>
  73. <dd><p><code>ld</code> finds all <code>jsr</code> and <code>jmp</code> instructions whose
  74. targets are within eight bits, and turns them into eight-bit
  75. program-counter relative <code>bsr</code> and <code>bra</code> instructions,
  76. respectively.
  77. </p>
  78. <a name="index-synthesizing-on-H8_002f300"></a>
  79. </dd>
  80. <dt><em>synthesizing instructions</em></dt>
  81. <dd><p><code>ld</code> finds all <code>mov.b</code> instructions which use the
  82. sixteen-bit absolute address form, but refer to the top
  83. page of memory, and changes them to use the eight-bit address form.
  84. (That is: the linker turns &lsquo;<samp>mov.b <code>@</code><var>aa</var>:16</samp>&rsquo; into
  85. &lsquo;<samp>mov.b <code>@</code><var>aa</var>:8</samp>&rsquo; whenever the address <var>aa</var> is in the
  86. top page of memory).
  87. </p>
  88. <p><code>ld</code> finds all <code>mov</code> instructions which use the register
  89. indirect with 32-bit displacement addressing mode, but use a small
  90. displacement inside 16-bit displacement range, and changes them to use
  91. the 16-bit displacement form. (That is: the linker turns &lsquo;<samp>mov.b
  92. <code>@</code><var>d</var>:32,ERx</samp>&rsquo; into &lsquo;<samp>mov.b <code>@</code><var>d</var>:16,ERx</samp>&rsquo;
  93. whenever the displacement <var>d</var> is in the 16 bit signed integer
  94. range. Only implemented in ELF-format ld).
  95. </p>
  96. </dd>
  97. <dt><em>bit manipulation instructions</em></dt>
  98. <dd><p><code>ld</code> finds all bit manipulation instructions like <code>band, bclr,
  99. biand, bild, bior, bist, bixor, bld, bnot, bor, bset, bst, btst, bxor</code>
  100. which use 32 bit and 16 bit absolute address form, but refer to the top
  101. page of memory, and changes them to use the 8 bit address form.
  102. (That is: the linker turns &lsquo;<samp>bset #xx:3,<code>@</code><var>aa</var>:32</samp>&rsquo; into
  103. &lsquo;<samp>bset #xx:3,<code>@</code><var>aa</var>:8</samp>&rsquo; whenever the address <var>aa</var> is in
  104. the top page of memory).
  105. </p>
  106. </dd>
  107. <dt><em>system control instructions</em></dt>
  108. <dd><p><code>ld</code> finds all <code>ldc.w, stc.w</code> instructions which use the
  109. 32 bit absolute address form, but refer to the top page of memory, and
  110. changes them to use 16 bit address form.
  111. (That is: the linker turns &lsquo;<samp>ldc.w <code>@</code><var>aa</var>:32,ccr</samp>&rsquo; into
  112. &lsquo;<samp>ldc.w <code>@</code><var>aa</var>:16,ccr</samp>&rsquo; whenever the address <var>aa</var> is in
  113. the top page of memory).
  114. </p></dd>
  115. </dl>
  116. <hr>
  117. <div class="header">
  118. <p>
  119. Next: <a href="M68HC11_002f68HC12.html#M68HC11_002f68HC12" accesskey="n" rel="next">M68HC11/68HC12</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>
  120. </div>
  121. </body>
  122. </html>