aboutsummaryrefslogtreecommitdiff
path: root/ld/ld.texinfo
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-11-19 09:31:55 +0000
committerNick Clifton <nickc@redhat.com>2004-11-19 09:31:55 +0000
commit3ec5763260bc86f8b87d3ad985336665120edf0b (patch)
treea439afd60ee9c63fd5442c7e84865527da2914eb /ld/ld.texinfo
parent288f74fae975740b6219cf135110bc3e2f4bb05a (diff)
downloadfsf-binutils-gdb-3ec5763260bc86f8b87d3ad985336665120edf0b.zip
fsf-binutils-gdb-3ec5763260bc86f8b87d3ad985336665120edf0b.tar.gz
fsf-binutils-gdb-3ec5763260bc86f8b87d3ad985336665120edf0b.tar.bz2
Add ORIGIN and LENGTH linker script operators.
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r--ld/ld.texinfo18
1 files changed, 18 insertions, 0 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index e2a971b..ab78ece 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -3886,6 +3886,16 @@ the next available address within the memory region. If the combined
output sections directed to a memory region are too large for the
region, the linker will issue an error message.
+It is possible to access the origin and length of a memory in an
+expression via the @code{ORIGIN(@var{memory})} and
+@code{LENGTH(@var{memory})} functions:
+
+@smallexample
+@group
+ _fstack = ORIGIN(ram) + LENGTH(ram) - 4;
+@end group
+@end smallexample
+
@node PHDRS
@section PHDRS Command
@kindex PHDRS
@@ -4661,6 +4671,10 @@ SECTIONS @{ @dots{}
@end group
@end smallexample
+@item LENGTH(@var{memory})
+@kindex LENGTH(@var{memory})
+Return the length of the memory region named @var{memory}.
+
@item LOADADDR(@var{section})
@kindex LOADADDR(@var{section})
@cindex section load address in expression
@@ -4685,6 +4699,10 @@ This function is closely related to @code{ALIGN(@var{exp})}; unless you
use the @code{MEMORY} command to define discontinuous memory for the
output file, the two functions are equivalent.
+@item ORIGIN(@var{memory})
+@kindex ORIGIN(@var{memory})
+Return the origin of the memory region named @var{memory}.
+
@item SEGMENT_START(@var{segment}, @var{default})
@kindex SEGMENT_START(@var{segment}, @var{default})
Return the base address of the named @var{segment}. If an explicit