Kenwood HP 9000 Personal Computer User Manual


 
Appendix A 311
Using Mapfiles
Internal Map Structure
Figure A-1 shows the map structure. The entrance criteria boxes
correspond to the information from the section mapping directives and
the segment attribute descriptors correspond to the information from the
segment declarations. The output section descriptors boxes group the
sections that fall under each segment based on their section attributes.
The linker associates each entrance criteria with a list of “output section
descriptors”. In Figure A-1, the entrance criteria are labeled with
numbers to illustrate their associated output section descriptors.
The linker performs the following steps when mapping sections to
segments:
1. When a section is read in, the liner checks the list of entrance criteria
looking for a match. All specified criteria must be matched. When an
entrance criteria matches, the linker traverses its associated “output
section descriptor” list.
2. If the section attribute values match those of an existing output
section descriptor exactly, the linker places the section at the end of
the list of sections associated with that output section descriptor.
3. If no matching output section descriptor is found, but output section
descriptors of the same section_type exists, the linker creates a new
output section descriptor with the same attribute values as the
section and adds that section to the new output section descriptor. It
places the new output section descriptor after the last output section
descriptor with the same section type.
4. If no other output section descriptor of the indicated section_type
exists, the linker creates a new output section descriptor and
associates the section with the new output section descriptor. It
places the new output section descriptor after the last output section
descriptor associated with that entrance criteria.
5. If no entrance criteria match is found, the linker places the section at
the end of the “nonsegment”. It does not create a program header
entry for the nonsegment.
The following rules apply when the linker adds a new output section
descriptor to a list of output section descriptors associated with an
entrance criteria:
If an entrance criteria selects both $PROGBITS and $NOBITS sections,
the linker enforces an order such that the $PROGBITS sections
precede $NOBITS sections.