Using UNION and GROUP Statements
7-46
Figure 7–5. Memory Allocation Shown in Example 7–7 and Example 7–8
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ROM
RAM
.text 2 (run)
.text 1 (load)
.text 1 (run)
.text 2 (load)
Copies at
runtime
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ÉÉÉÉÉÉÉ
ROM
RAM
.text
.bss2
.bss1
.bss3
Allocation for Example 7–7
Allocation for Example 7–8
Sections cannot
load as a union.
Sections can run
as a union. This is
runtime allocation
only.
Since the .text sections contain data, they cannot
load as a union, although
they can be
run as a union. Therefore, each requires its own load address. If
you fail to provide a load allocation for an initialized section within a union, the
linker issues a warning and allocates load space anywhere it fits in configured
memory.
Uninitialized sections are not loaded and do not require load addresses.
The UNION statement applies only to allocation of run addresses, so it is
redundant to specify a load address for the union itself. For purposes of
allocation, the union is treated as an uninitialized section: any one allocation
specified is considered a run address, and, if both are specified, the linker
issues a warning and ignores the load address.
Note:
UNION and Overlay Page Are Not the Same
The UNION capability and the
overlay page capability (see Section 7.11,
Overlay Pages, on page 7-48) may sound similar because they both deal
with overlays. They are, in fact, quite different. UNION allows multiple
sections to be overlaid
within the same memory space. Overlay pages, on
the other hand, define
multiple memory spaces. It is possible to use the page
facility to approximate the function of UNION, but this is cumbersome.
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: ......