The SECTIONS Directive
7-39
Linker Description
You can explicitly specify the input sections that form an output section. Each
input section is identified by its filename and section name:
SECTIONS
{
.text : /* Build .text output section */
{
f1.obj(.text) /* Link .text section from f1.obj */
f2.obj(sec1) /* Link sec1 section from f2.obj */
f3.obj /* Link ALL sections from f3.obj */
f4.obj(.text,sec2) /* Link .text and sec2 from f4.obj */
}
}
It is not necessary for input sections to have the same name as each other or
as the output section they become part of. If a file is listed with no sections,
all
of its sections are included in the output section. If any additional input sections
have the same name as an output section, but are not explicitly specified by
the SECTIONS directive, they are automatically linked in at the end of the
output section. For example, if the linker found more .text sections in the
preceding example, and these .text sections
were not specified anywhere in
the SECTIONS directive, the linker would concatenate these extra sections
after f4.obj(sec2).
The specifications in Example 7–5 are actually a shorthand method for the
following:
SECTIONS
{
.text: { *(.text) }
.data: { *(.data) }
.bss: { *(.bss) }
}
The specification *(.text) means
the unallocated .text sections from all the
input files. This format is useful when:
-
You want the output section to contain all input sections that have a
specified name, but the output section name is different than the input
sections’ name.
-
You want the linker to allocate the input sections
before it processes addi-
tional input sections or commands within the braces.
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: ......