5.2.2 Section definition directives

A "section definition directive" is a directive that indicates the start or end of a section.

Sections are the unit of allocation in the optimizing linker.

Example

.SECTION    SecA, TEXT
    :
.SECTION    SecB, DATA
    :
.SECTION    SecC, BSS
    :

 

Two sections with relocation attributes SBSS and SBSS_BIT may have the same section name. Two sections with relocation attributes BSS and BSS_BIT may have the same section name.

Regarding other relocation attributes, two sections with the same section name must have the same relocation attribute. Consequently, multiple sections with differing relocation attributes cannot be given the same section name. If two sections with the same section name have different relocation attributes, an error will occur. The contents that can be written in a section depend on the relocation attribute of the section. For the details of description, see "Table 5.15 Relocation Attributes".

 

Sections can be broken up. In other words, sections in a single source program file with the same relocation attribute and section name will be processed as a single continuous section in the assembler.

If a section is broken into separate modules (assembly source files), then they are linked by the optimizing linker.

by the optimizing linker.

 

The start address can be specified for a section. The section with the start address specified is an absolute section.

 

The following section definition directives are available.

Table 5.14

Section Definition Directives

Directive

Overview

.SECTION

Indicates to the assembler the start of a section

.CSEG

Indicates to the assembler the starting of a code section

.DSEG

Indicates to the assembler the start of a data section

.BSEG

Indicates to the assembler the start of a bit section

.ORG

Indicates to the assembler the start of a section at an absolute address

.OFFSET

Specifies an offset from the first address of a section