X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fld.texinfo;h=b21313a6b2b7ee812a379ff7948673bebfd1e05c;hb=9cd6d51a560c784509b87b6d5bca7470b43dd9bc;hp=5a494c236f5a688ca1450abd9b6b1c609665c8b4;hpb=b58f81aef6a84930bcb58db39f2bad0c45383a6d;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 5a494c236f..b21313a6b2 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -1234,6 +1234,16 @@ Normally when a symbol has an undefined version, the linker will ignore it. This option disallows symbols with undefined version and a fatal error will be issued instead. +@kindex --default-symver +@item --default-symver +Create and use a default symbol version (the soname) for unversioned +exported symbols. + +@kindex --default-imported-symver +@item --default-imported-symver +Create and use a default symbol version (the soname) for unversioned +imported symbols. + @kindex --no-warn-mismatch @item --no-warn-mismatch Normally @command{ld} will give an error if you try to link together input @@ -3833,19 +3843,19 @@ attributes. @kindex ORIGIN = @kindex o = @kindex org = -The @var{origin} is an expression for the start address of the memory -region. The expression must evaluate to a constant before memory -allocation is performed, which means that you may not use any section -relative symbols. The keyword @code{ORIGIN} may be abbreviated to -@code{org} or @code{o} (but not, for example, @code{ORG}). +The @var{origin} is an numerical expression for the start address of +the memory region. The expression must evaluate to a constant and it +cannot involve any symbols. The keyword @code{ORIGIN} may be +abbreviated to @code{org} or @code{o} (but not, for example, +@code{ORG}). @kindex LENGTH = @kindex len = @kindex l = The @var{len} is an expression for the size in bytes of the memory region. As with the @var{origin} expression, the expression must -evaluate to a constant before memory allocation is performed. The -keyword @code{LENGTH} may be abbreviated to @code{len} or @code{l}. +be numerical only and must evaluate to a constant. The keyword +@code{LENGTH} may be abbreviated to @code{len} or @code{l}. In the following example, we specify that there are two memory regions available for allocation: one starting at @samp{0} for 256 kilobytes, @@ -3876,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 @@ -4651,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 @@ -4675,6 +4699,20 @@ 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 +value has been given for this segment (with a command-line @samp{-T} +option) that value will be returned; otherwise the value will be +@var{default}. At present, the @samp{-T} command-line option can only +be used to set the base address for the ``text'', ``data'', and +``bss'' sections, but you use @code{SEGMENT_START} with any segment +name. + @item SIZEOF(@var{section}) @kindex SIZEOF(@var{section}) @cindex section size