The SECTIONS Directive
7-34
Example 7–4. The SECTIONS Directive
/**************************************************/
/* Sample command file with SECTIONS directive */
/**************************************************/
file1.obj file2.obj /* Input files */
–o prog.out /* Options */
SECTIONS
{
.text: load = ROM, run = 800h
.const: load = ROM
.bss: load = RAM
.vectors: load = FF80h
{
t1.obj(.intvec1)
t2.obj(.intvec2)
endvec = .;
}
.data: align = 16
}
SECTIONS
directive
section
specifications
Figure 7–3 shows the five output sections defined by the sections directive in
Example 7–4: .vectors, .text, .const, .bss, and .data.
Figure 7–3. Section Allocation Defined by Example 7–4
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ROM
RAM
.vectors
.text
– bound at 0FF80h
– allocated in ROM
.const
– allocated in ROM
.bss
– allocated in RAM
.data
– aligned on 16-word
boundary
00h
The .text section combines the .text sections from
file1.obj and file2.obj. The linker combines all sec-
tions named .text into this section. The application
must relocate the section to run at 0800h.
The .const section combines the .const sections
from file1.obj and file2.obj.
The .bss section combines the .bss sections from
file1.obj and file2.obj.
The .vectors section is composed of the .intvec1
section from t1.obj and the .intvec2 section from
t2.obj.
The .data section combines the .data sections from
file1.obj and file2.obj. The linker will place it any-
where there is space for it (in RAM in this illustration)
and align it to a 16-word boundary.
FF80h
Summary of Contents for TMS320C54x
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 276: ......
Page 277: ......
Page 278: ......
Page 279: ......
Page 280: ......
Page 281: ......
Page 282: ......
Page 283: ......
Page 284: ......
Page 285: ......
Page 286: ......
Page 287: ......
Page 288: ......
Page 289: ......
Page 290: ......
Page 291: ......
Page 292: ......
Page 293: ......
Page 294: ......
Page 295: ......
Page 296: ......
Page 297: ......
Page 298: ......
Page 299: ......
Page 300: ......
Page 301: ......
Page 302: ......