Specifying a Section’s Runtime Address
7-42
The examples below specify load and run addresses:
.data: load = ROM, align = 32, run = RAM
(align applies only to load )
.data: load = (ROM align 32), run = RAM
(identical to previous example)
.data: run
=
RAM, align 32,
load
=
align 16
(align 32 in RAM for run; align 16 anywhere for load)
7.9.2
Uninitialized Sections
Uninitialized sections (such as .bss) are not loaded, so their only significant
address is the run address. The linker allocates uninitialized sections only
once: if you specify both run and load addresses, the linker warns you and
ignores the load address. Otherwise, if you specify only one address, the linker
treats it as a run address, regardless of whether you call it load or run. The
example below specifies load and run addresses for an uninitialized section:
.bss: load = 0x1000, run = RAM
A warning is issued, load is ignored, and space is allocated in RAM. All of the
following examples have the same effect. The .bss section is allocated in RAM.
.bss: load = RAM
.bss: run = RAM
.bss: > RAM
7.9.3
Referring to the Load Address by Using the .label Directive
Normally, any reference to a symbol in a section refers to its runtime address.
However, it may be necessary at runtime to refer to a load-time address.
Specifically, the code that copies a section from its load address to its run
address must have access to the load address. The .label directive defines a
special symbol that refers to the section’s load address. Thus, whereas normal
symbols are relocated with respect to the run address, .label symbols are
relocated with respect to the load address. For more information on the .label
directive, see page 4-59.
Example 7–6 shows the use of the .label directive.
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: ......