User's Manual
ActionFlag
Sets the "code" hint for a segment. When this flag is set, it indicates that the segment mostly contains
code that may be executed. When not set, it indicates that it is unlikely that the segment contains code.
This flag is not set by default. The code hint is off by default.
c
Groups segments together. A segment declared with g 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
g
addresses are assigned to segments. The segments in one group are assigned consecutive virtual
addresses.
Tells 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
o
attribute specifications (for this segment) as hints and change or modify them as it thinks fit for space
and/or time optimization.
ReadableR
WritableW
ExecutableX
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;
Defining Mapfile Section Mapping Directives
A section mapping directive specifies how the linker must map the input section onto output
segments. This directive tells the linker what attributes of a section must be matched in order to
map that section into the named segment. The set of attribute values that a section must have to
map into a specific segment is called the entrance criteria.
segment_name : {section_attribute_value}*
;
The section attributes and their valid values are as follows:
ValueSection Attribute
Any valid section namesection_name
$PROGBITS, $NOBITS, $UNWIND, $NOTE, $REL, $RELA
section_type
?[[!]A][[!]W][[!]X][[!][S]][[!][T]]
section_flags
ValueFlag
Allocatable (takes up virtual memory)A
WritableW
ExecutableX
Short dataS
TLS (thread local storage)T
Defining Mapfile Section Mapping Directives 197