Uninitialized Sections - Texas Instruments TMS320C54x User Manual

Digital signal processors
Hide thumbs Also See for TMS320C54x:
Table of Contents

Advertisement

Specifying a Section's Runtime Address
7.9.2

Uninitialized Sections

7.9.3
Referring to the Load Address by Using the .label Directive
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)
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
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.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C54x and is the answer not in the manual?

Table of Contents