How the Assembler Handles Sections
2-7
Introduction to Common Object File Format
2.3.3
Named Sections
Named sections are sections that
you create. You can use them like the default
.text, .data, and .bss sections, but they are assembled separately.
For example, repeated use of the .text directive builds up a single .text section
in the object file. When linked, this .text section is allocated into memory as a
single unit. Suppose there is a portion of executable code (perhaps an initiali-
zation routine) that you don’t want allocated with .text. If you assemble this
segment of code into a named section, it is assembled separately from .text,
and you can allocate it into memory separately. You can also assemble initial-
ized data that is separate from the .data section, and you can reserve space
for uninitialized variables that is separate from the .bss section.
Two directives let you create named sections:
-
The .usect directive creates sections that are used like the .bss section.
These sections reserve space in RAM for variables.
-
The .sect directive creates sections, like the default .text and .data
sections, that can contain code or data. The .sect directive creates named
sections with relocatable addresses.
The syntax for these directives is shown below:
symbol .usect ”section name”, size in words [, [blocking flag] [, alignment flag]]
.sect ”
section name”
The
section name parameter is the name of the section. You can create up to
32 767 separate named sections. A section name can be up to 200 characters.
For COFF1 files, only the first 8 characters are significant. For the .sect and
.usect directives, a section name can refer to a subsection (see subsection
2.3.4,
Subsections, for details).
Each time you invoke one of these directives with a new name, you create a
new named section. Each time you invoke one of these directives with a name
that was already used, the assembler assembles code or data (or reserves
space) into the section with that name.
You cannot use the same names with
different directives. That is, you cannot create a section with the .usect direc-
tive and then try to use the same section with .sect.
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: ......