308 Appendix A
Using Mapfiles
Defining Mapfile Section Mapping Directives
• If a section flag is preceded by an exclamation mark (!), it indicates
that the flag should not be set to meet the entrance criteria.
If you do not specify section_flags, the flag can have any value to
meet the entrance criteria.
S1 : ?XR;
The linker maps all executable sections with static branch prediction
enabled onto segment S1.
• The section_name attribute indicates that the linker should map the
input sections with the specified name onto the named segment.
text : .rodata;
• An input section can satisfy more than one entrance criteria.
S1 : $PROGBITS;
S2 : $PROGBITS;
In this case, all sections with section type $PROGBITS are mapped
onto segment S1 as the first rule takes precedence.
• An AND relationship exits between attributes specified on the same
line. An OR relationship exits between attributes specified for the
same segment that span more than one line.
• Example 1:
All sections with section_type $PROGBITS and section_flags AX
(allocatable and executable) are mapped onto the text segment.
text : $PROGBITS ?AX;
• Example 2
text : $PROGBITS ?AX;
text : .rodata;
In this case, the linker maps a section onto the text segment if:
Its section_type is $PROGBITS and section_flags is AX.
(or)
Its section_name is .rodata.