Commands Dealing With Object File Formats - Red Hat ENTERPRISE LINUX 3 - USING ID Using Instructions

Using ld, the gnu linker
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING ID:
Table of Contents

Advertisement

32
If you use
INPUT (-l
line argument
-l
When you use the
link at the point at which the linker script file is included. This can affect archive searching.
GROUP(
,
, ...)
file
file
GROUP(
...)
file file
The
command is like
GROUP
are searched repeatedly until no new undefined references are created. See the description of
in Section 3.1 Command Line Options.
OUTPUT(
)
filename
The
command names the output file. Using
OUTPUT
is exactly like using
Options). If both are used, the command line option takes precedence.
You can use the
usual default of
SEARCH_DIR(
)
path
The
SEARCH_DIR
Using
SEARCH_DIR(
tion 3.1 Command Line Options). If both are used, then the linker will search both paths. Paths
specified using the command line option are searched first.
STARTUP(
)
filename
The
command is just like the
STARTUP
first input file to be linked, as though it were specified first on the command line. This may be
useful when using a system in which the entry point is always the start of the first file.

4.4.3. Commands Dealing with Object File Formats

A couple of linker script commands deal with object file formats.
OUTPUT_FORMAT(
bfdname
OUTPUT_FORMAT(
default
The
OUTPUT_FORMAT
6 BFD). Using
command line (refer to Section 3.1 Command Line Options). If both are used, the command line
option takes precedence.
You can use
OUTPUT_FORMAT
and
command line options. This permits the linker script to set the output format based on
-EL
the desired endianness.
If neither
nor
-EB
If
is used, the output format will be the second argument,
-EB
format will be the third argument,
For example, the default linker script for the MIPS ELF target uses this command:
UTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-littlemips)
This says that the default format for the output file is
command line option, the output file will be created in the
-EL
,
will transform the name to
)
ld
file
.
command in an implicit linker script, the files will be included in the
INPUT
, except that the named files should all be archives, and they
INPUT
on the command line (refer to Section 3.1 Command Line
-o
filename
command to define a default name for the output file other than the
OUTPUT
.
a.out
command adds
path
is exactly like using
)
path
)
,
,
big
little
command names the BFD format to use for the output file (refer to Chapter
OUTPUT_FORMAT(
bfdname
with three arguments to use different formats based on the
are used, then the output format will be the first argument,
-EL
little
OUTPUT(
to the list of paths where
-L
path
command, except that
INPUT
)
is exactly like using
)
.
elf32-bigmips
Chapter 4. Linker Scripts
, as with the command
lib
.a
file
in the linker script
)
filename
looks for archive libraries.
ld
on the command line (refer to Sec-
will become the
filename
-oformat
bfdname
. If
is used, the output
big
-EL
, but if the user uses the
elf32-littlemips
-(
on the
-EB
.
default
format.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents