|
|
The ld command has three built-in segments
(text
, data
, and note
)
with default segment_attribute_values
and corresponding default mapping directives as
described under
``Segment declarations''.
Even though the ld
command does not use an actual ``mapfile'' to store the defaults,
the model of a ``default mapfile'' helps to illustrate what happens when
the ld command encounters your mapfile.
``Default mapfile'' shows how a mapfile would appear for the ld command defaults. The ld command begins execution behaving as if the mapfile in ``Default mapfile'' has already been read in. Then ld reads your mapfile and either augments or makes changes to the defaults.
interp
segment, which precedes all others,
and the dynamic
segment,
which follows the data
segment,
are not shown in
``Default mapfile''
and
``Simple map structure''
because you cannot manipulate them.
Default mapfile
text = LOAD ?RX; text : $PROGBITS ?A!W;As each segment declaration in your mapfile is read in, it is compared to the existing list of segment declarations as follows:data = LOAD ?RWX; data : $PROGBITS ?AW; data : $NOBITS ?AW;
note = NOTE; note : $NOTE;
INTERP
LOAD
DYNAMIC
NOTE
LOAD
and
you have defined a virtual_address
value for this LOAD
able segment, the
segment is placed before any LOAD
able segments without a defined
virtual_address value
or with a higher virtual_address value,
but after any segments with
a virtual_address value that is lower.