Download CA830, CA850 C COMPILER PACKAGES OPERATION

Transcript
3.3 Section and Segment
Here, let’s discuss the types and attributes of the “sections” and “segments” handled by the ld. For the internal
configuration of a section, refer to APPENDIX B. For the details of section allocation by program, refer to V800
Series C Compiler Package User’s Manual - C Language/Assembly Language.
Section
Basic unit configuring a program. Sections (input sections) included in two or more object files
and having the same type and attribute are linked and sections (output sections) constituting a
segment are created. A section name, attribute, and address to which a program is loaded can
be freely specified by a link directive.
Segment
A cluster of sections having the same attribute and type, and is a basic unit in which a program
is loaded to memory. A segment name, attribute, and address to which a program is loaded can
be freely specified by a link directive.
Figure 3-1. Section and Segment
Input section
file1.o
(NOBITS AW)
Output section
Segment
.bss
DATA → RAM
(NOBITS AWG)
(PROGBITS AWG)
(PROGBITS AW)
.sbss
(PROGBITS AX)
__gp_DATA
.sdata
file2.o
(NOBITS AW)
.data
(NOBITS AWG)
(PROGBITS AX)
file3.o
TEXT → ROM
.text
(PROGBITS AWG)
(PROGBITS AW)
(PROGBITS AX)
256
__tp_TEXT