Chapter 4. Linker Scripts
TARGET(
)
bfdname
The
command names the BFD format to use when reading input files. It affects sub-
TARGET
sequent
INPUT
mand line (refer to Section 3.1 Command Line Options). If the
OUTPUT_FORMAT
output file. Refer to Chapter 6 BFD.
4.4.4. Other Linker Script Commands
There are a few other linker scripts commands.
ASSERT(
,
exp
message
Ensure that
exp
.
message
EXTERN(
symbol symbol
Force
to be entered in the output file as an undefined symbol. Doing this may, for exam-
symbol
ple, trigger linking of additional modules from standard libraries. You may list several
for each
EXTERN
as the
command-line option.
-u
FORCE_COMMON_ALLOCATION
This command has the same effect as the
common symbols even if a relocatable output file is specified (
INHIBIT_COMMON_ALLOCATION
This command has the same effect as the
omit the assignment of addresses to common symbols even for a non-relocatable output file.
ld
NOCROSSREFS(
section section
This command may be used to tell
sections.
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
ences between the sections, it reports an error and returns a non-zero exit status. Note that the
command uses output section names, not input section names.
NOCROSSREFS
OUTPUT_ARCH(
bfdarch
Specify a particular output machine architecture. The argument is one of the names used by the
BFD library (refer to Chapter 6 BFD). You can see the architecture of an object file by using the
program with the
objdump
4.5. Assigning Values to Symbols
You may assign a value to a symbol in a linker script. This will define the symbol as a global symbol.
and
commands. This command is like using
GROUP
is not, then the last
)
is non-zero. If it is zero, then exit the linker with an error code, and print
...)
, and you may use
EXTERN
...)
ld
command takes a list of output section names. If
)
option.
-f
command is also used to set the format for the
TARGET
multiple times. This command has the same effect
command-line option: to make
-d
-no-define-common
to issue an error about any references among certain output
-b
bfdname
command is used but
TARGET
assign space to
ld
).
-r
command-line option: to make
detects any cross refer-
ld
33
on the com-
s
symbol
Need help?
Do you have a question about the ENTERPRISE LINUX 4 - USING ID and is the answer not in the manual?
Questions and answers