📄 evaluation.html
字号:
<html lang="en">
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
</head>
<body>
<div class="node">
<p>
Node:<a name="Evaluation">Evaluation</a>,
Next:<a rel="next" accesskey="n" href="Expression-Section.html#Expression%20Section">Expression Section</a>,
Previous:<a rel="previous" accesskey="p" href="Operators.html#Operators">Operators</a>,
Up:<a rel="up" accesskey="u" href="Expressions.html#Expressions">Expressions</a>
<hr><br>
</div>
<h4 class="subsection">Evaluation</h4>
<p>The linker evaluates expressions lazily. It only computes the value of
an expression when absolutely necessary.
<p>The linker needs some information, such as the value of the start
address of the first section, and the origins and lengths of memory
regions, in order to do any linking at all. These values are computed
as soon as possible when the linker reads in the linker script.
<p>However, other values (such as symbol values) are not known or needed
until after storage allocation. Such values are evaluated later, when
other information (such as the sizes of output sections) is available
for use in the symbol assignment expression.
<p>The sizes of sections cannot be known until after allocation, so
assignments dependent upon these are not performed until after
allocation.
<p>Some expressions, such as those depending upon the location counter
<code>.</code>, must be evaluated during section allocation.
<p>If the result of an expression is required, but the value is not
available, then an error results. For example, a script like the
following
<pre class="smallexample"> SECTIONS
{
.text 9+this_isnt_constant :
{ *(.text) }
}
</pre>
<p>will cause the error message <code>non constant expression for initial
address</code>.
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -