The ld command has three built-in segments
with default segment_attribute_values
and corresponding default mapping directives as
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.
interpsegment, which precedes all others, and the
dynamicsegment, which follows the
datasegment, are not shown in ``Default mapfile'' and ``Simple map structure'' because you cannot manipulate them.
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;
LOADand you have defined a virtual_address value for this
LOADable segment, the segment is placed before any
LOADable 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.