Note - if the linker is being invoked indirectly, via a compiler driver
(eg @samp{gcc}) then all the linker command line options should be
-prefixed by @samp{-Wl,} like this:
+prefixed by @samp{-Wl,} (or whatever is appropriate for the particular
+compiler driver) like this:
@smallexample
gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
@kindex --nmagic
@item -n
@itemx --nmagic
-Set the text segment to be read only, and mark the output as
-@code{NMAGIC} if possible.
+Turn off page alignment of sections, and mark the output as
+@code{NMAGIC} if possible.
@kindex -N
@kindex --omagic
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
@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
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
@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
@node Output Section LMA
@subsubsection Output section LMA
+@kindex AT>@var{lma_region}
@kindex AT(@var{lma})
@cindex load address
@cindex section load 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