blob: 2578a32ef434e7ecded64769ca3b102ea61d5409 [file] [log] [blame]
<html lang="en">
<head>
<title>Nios II - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Machine-Dependent.html#Machine-Dependent" title="Machine Dependent">
<link rel="prev" href="NDS32.html#NDS32" title="NDS32">
<link rel="next" href="PowerPC-ELF32.html#PowerPC-ELF32" title="PowerPC ELF32">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU linker LD
(GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))
version 2.33.1.
Copyright (C) 1991-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Nios-II"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="PowerPC-ELF32.html#PowerPC-ELF32">PowerPC ELF32</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="NDS32.html#NDS32">NDS32</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Machine-Dependent.html#Machine-Dependent">Machine Dependent</a>
<hr>
</div>
<h3 class="section">4.10 <samp><span class="command">ld</span></samp> and the Altera Nios II</h3>
<p><a name="index-Nios-II-call-relaxation-700"></a><a name="index-g_t_002d_002drelax-on-Nios-II-701"></a>
Call and immediate jump instructions on Nios II processors are limited to
transferring control to addresses in the same 256MB memory segment,
which may result in <samp><span class="command">ld</span></samp> giving
&lsquo;<samp><span class="samp">relocation truncated to fit</span></samp>&rsquo; errors with very large programs.
The command-line option <samp><span class="option">--relax</span></samp> enables the generation of
trampolines that can access the entire 32-bit address space for calls
outside the normal <code>call</code> and <code>jmpi</code> address range. These
trampolines are inserted at section boundaries, so may not themselves
be reachable if an input section and its associated call trampolines are
larger than 256MB.
<p>The <samp><span class="option">--relax</span></samp> option is enabled by default unless <samp><span class="option">-r</span></samp>
is also specified. You can disable trampoline generation by using the
<samp><span class="option">--no-relax</span></samp> linker option. You can also disable this optimization
locally by using the &lsquo;<samp><span class="samp">set .noat</span></samp>&rsquo; directive in assembly-language
source files, as the linker-inserted trampolines use the <code>at</code>
register as a temporary.
<p>Note that the linker <samp><span class="option">--relax</span></samp> option is independent of assembler
relaxation options, and that using the GNU assembler's <samp><span class="option">-relax-all</span></samp>
option interferes with the linker's more selective call instruction relaxation.
</body></html>