Sections Command; Output Section Description - Red Hat ENTERPRISE LINUX 4 - USING ID Using Manual

Gnu linker
Hide thumbs Also See for ENTERPRISE LINUX 4 - USING ID:
Table of Contents

Advertisement

Chapter 4. Linker Scripts
SECTIONS
{
.text :
{
*(.text)
_etext = .;
PROVIDE(etext = .);
}
}
In this example, if the program defines
tiple definition error. If, on the other hand, the program defines
the linker will silently use the definition in the program. If the program references
define it, the linker will use the definition in the linker script.

4.6. SECTIONS Command

The
command tells the linker how to map input sections into output sections, and how to
SECTIONS
place the output sections in memory.
The format of the
SECTIONS
SECTIONS
{
sections-command
sections-command
...
}
Each
sections-command
an
command (refer to Section 4.4.1 Setting the Entry Point)
ENTRY
a symbol assignment (refer to Section 4.5 Assigning Values to Symbols)
an output section description
an overlay description
The
command and symbol assignments are permitted inside the
ENTRY
venience in using the location counter in those commands. This can also make the linker script easier
to understand because you can use those commands at meaningful points in the layout of the output
file.
Output section descriptions and overlay descriptions are described below.
If you do not use a
SECTIONS
into an identically named output section in the order that the sections are first encountered in the input
files. If all input sections are present in the first file, for example, the order of sections in the output
file will match the order in the first input file. The first section will be at address zero.

4.6.1. Output Section Description

The full description of an output section looks like this:
[
] [(
section
address
{
output-section-command
output-section-command
_etext
command is:
may of be one of the following:
command in your linker script, the linker will place each input section
)] : [AT(
)]
type
lma
(with a leading underscore), the linker will give a mul-
etext
(with no leading underscore),
but does not
etext
command for con-
SECTIONS
35

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents