H8_002f300.html 6.1 KB

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