2000-05-10 H.J. Lu <hjl@gnu.org>
[binutils-gdb.git] / ld / ld.texinfo
index a786dd2c7520522ce03fe1592d6dc285960404e4..e8c11d9544cdd0cb91c27a7ba3f04e1d92790fa6 100644 (file)
@@ -1680,12 +1680,6 @@ You write the @samp{SECTIONS} command as the keyword @samp{SECTIONS},
 followed by a series of symbol assignments and output section
 descriptions enclosed in curly braces.
 
-The first line in the above example sets the special symbol @samp{.},
-which is the location counter.  If you do not specify the address of an
-output section in some other way (other ways are described later), the
-address is set from the current value of the location counter.  The
-location counter is then incremented by the size of the output section.
-
 The first line inside the @samp{SECTIONS} command of the above example
 sets the value of the special symbol @samp{.}, which is the location
 counter.  If you do not specify the address of an output section in some
@@ -2127,7 +2121,7 @@ The full description of an output section looks like this:
     @var{output-section-command}
     @var{output-section-command}
     @dots{}
-  @} [>@var{region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
+  @} [>@var{region}] [AT>@var{lma_region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
 @end group
 @end smallexample
 
@@ -2255,10 +2249,10 @@ of files from matching the file name wildcard, EXCLUDE_FILE may be used to
 match all files except the ones specified in the EXCLUDE_FILE list.  For
 example:
 @smallexample
-(*(EXCLUDE_FILE (*crtend.o, *otherfile.o) .ctors))
+(*(EXCLUDE_FILE (*crtend.o *otherfile.o) .ctors))
 @end smallexample
-will cause all .ctors sections from all files except crtend.o and otherfile.o
-to be included.
+will cause all .ctors sections from all files except @file{crtend.o} and
+@file{otherfile.o} to be included.
 
 There are two ways to include more than one section:
 @smallexample
@@ -2492,6 +2486,16 @@ When the object file format does not have an explicit endianness, as is
 true of, for example, S-records, the value will be stored in the
 endianness of the first input object file.
 
+Note - these commands only work inside a section description and not
+between them, so the following will produce an error from the linker:
+@smallexample
+SECTIONS @{@ .text : @{@ *(.text) @}@ LONG(1) .data : @{@ *(.data) @}@ @}@
+@end smallexample
+whereas this will work:
+@smallexample
+SECTIONS @{@ .text : @{@ *(.text) ; LONG(1) @}@ .data : @{@ *(.data) @}@ @}@
+@end smallexample
+
 @kindex FILL(@var{expression})
 @cindex holes, filling
 @cindex unspecified memory
@@ -2632,7 +2636,7 @@ like this:
     @var{output-section-command}
     @var{output-section-command}
     @dots{}
-  @} [>@var{region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
+  @} [>@var{region}] [AT>@var{lma_region}] [:@var{phdr} :@var{phdr} @dots{}] [=@var{fillexp}]
 @end group
 @end smallexample
 We've already described @var{section}, @var{address}, and
@@ -2686,6 +2690,7 @@ SECTIONS @{
 
 @node Output Section LMA
 @subsubsection Output section LMA
+@kindex AT>@var{lma_region}
 @kindex AT(@var{lma})
 @cindex load address
 @cindex section load address
@@ -2696,7 +2701,9 @@ Address}).
 
 The linker will normally set the LMA equal to the VMA.  You can change
 that by using the @code{AT} keyword.  The expression @var{lma} that
-follows the @code{AT} keyword specifies the load address of the section.
+follows the @code{AT} keyword specifies the load address of the
+section.  Alternatively, with @samp{AT>@var{lma_region}} expression,
+you may specify a memory region for the section's load address. @xref{MEMORY}.
 
 @cindex ROM initialized data
 @cindex initialized data in ROM