306 Appendix A
Using Mapfiles
Defining Mapfile Segment Declarations
Mapfile Segment Declaration Examples
The following example declares a segment with segment_type LOAD
and segment_flags readable and executable.
text = LOAD ?RX;
The following example declares a LOADable segment (default) with
segment_flags readable and writable. The virtual_address and
alignment values are set to V0x80000000 and A0x1000 respectively.
mydata = ?RW V0x80000000 A0x1000;
kLocks a particular segment into memory when loaded. This
flag is set off for all segments.
gGroups segments together. A segment declared withg flag is
grouped with a segment preceding it in the mapfile. Any
number of segments can be grouped together. The grouping
affects the way in which addresses are assigned to segments.
The segments in one group are assigned consecutive virtual
addresses.
oTells the linker that all the segment attributes declared for
this segment can be changed or modified to achieve space
and/or time optimization. When this flag is set, the linker
considers all other segment attribute specifications (for this
segment) as hints and change or modify them as it thinks fit
for space and/or time optimization.
Flag Action