Specifying a Section’s Runtime Address
7-41
Linker Description
7.9
Specifying a Section’s Runtime Address
At times, you may want to load code into one area of memory and run it in
another. For example, you may have performance-critical code in a ROM-
based system. The code must be loaded into ROM, but it would run faster in
RAM.
The linker provides a simple way to accomplish this. You can use the
SECTIONS directive to direct the linker to allocate a section twice: once to set
its load address and again to set its run address. For example:
.fir: load = ROM, run = RAM
Use the
load keyword for the load address and the run keyword for the run
address.
Refer to Section 2.6,
Runtime Relocation, on page 2-17 for an overview on
runtime relocation.
7.9.1
Specifying Load and Run Addresses
The load address determines where a loader will place the raw data for the
section. All references to the section (such as labels in it) refer to its run
address. The application must copy the section from its load address to its run
address; this does
not happen automatically when you specify a separate run
address.
If you provide only one allocation (either load or run) for a section, the section
is allocated only once and will load and run at the same address. If you provide
both allocations, the section is allocated as if it were two sections of the same
size. This means that both allocations occupy space in the memory map and
cannot overlay each other or other sections. (The UNION directive provides
a way to overlay sections; see subsection 7.10.1,
Overlaying Sections With the
UNION Statement, on page 7-45.)
If either the load or run address has additional parameters, such as alignment
or blocking, list them after the appropriate keyword. Everything related to
allocation after the keyword
load affects the load address until the keyword run
is seen, after which, everything affects the run address. The load and run
allocations are completely independent, so any qualification of one (such as
alignment) has no effect on the other. You may also specify run first, then load.
Use parentheses to improve readability.
Содержание TMS320C54x
Страница 38: ......
Страница 39: ......
Страница 40: ......
Страница 41: ......
Страница 42: ......
Страница 43: ......
Страница 44: ......
Страница 45: ......
Страница 46: ......
Страница 47: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 51: ......
Страница 52: ......
Страница 53: ......
Страница 54: ......
Страница 55: ......
Страница 56: ......
Страница 57: ......
Страница 58: ......
Страница 59: ......
Страница 60: ......
Страница 61: ......
Страница 62: ......
Страница 276: ......
Страница 277: ......
Страница 278: ......
Страница 279: ......
Страница 280: ......
Страница 281: ......
Страница 282: ......
Страница 283: ......
Страница 284: ......
Страница 285: ......
Страница 286: ......
Страница 287: ......
Страница 288: ......
Страница 289: ......
Страница 290: ......
Страница 291: ......
Страница 292: ......
Страница 293: ......
Страница 294: ......
Страница 295: ......
Страница 296: ......
Страница 297: ......
Страница 298: ......
Страница 299: ......
Страница 300: ......
Страница 301: ......
Страница 302: ......