Previous: REGION_ALIAS, Up: Simple Commands
There are a few other linker scripts commands.
ASSERT(
exp,
message)
EXTERN(
symbol symbol ...)
EXTERN
, and you may use EXTERN
multiple times. This
command has the same effect as the `-u' command-line option.
FORCE_COMMON_ALLOCATION
INHIBIT_COMMON_ALLOCATION
ld
omit the assignment of addresses
to common symbols even for a non-relocatable output file.
INSERT [ AFTER | BEFORE ]
output_sectionSECTIONS
with, for example, overlays. It
inserts all prior linker script statements after (or before)
output_section, and also causes `-T' to not override the
default linker script. The exact insertion point is as for orphan
sections. See Location Counter. The insertion happens after the
linker has mapped input sections to output sections. Prior to the
insertion, since `-T' scripts are parsed before the default
linker script, statements in the `-T' script occur before the
default linker script statements in the internal linker representation
of the script. In particular, input section assignments will be made
to `-T' output sections before those in the default script. Here
is an example of how a `-T' script using INSERT
might look:
SECTIONS { OVERLAY : { .ov1 { ov1*(.text) } .ov2 { ov2*(.text) } } } INSERT AFTER .text;
NOCROSSREFS(
section section ...)
In certain types of programs, particularly on embedded systems when using overlays, when one section is loaded into memory, another section will not be. Any direct references between the two sections would be errors. For example, it would be an error if code in one section called a function defined in the other section.
The NOCROSSREFS
command takes a list of output section names. If
ld detects any cross references between the sections, it reports
an error and returns a non-zero exit status. Note that the
NOCROSSREFS
command uses output section names, not input section
names.
OUTPUT_ARCH(
bfdarch)
objdump
program with
the `-f' option.