Chapter 9 Writing Machine Language Instructions and Directive Statements
154 Writing Directive Statements
9.4.1 section
Syntax
label operation operand
section_name section [definition1 [,definition2 [,expression]]]
definition1 Section attribute (CODE or DATA)
definition2 Link type (PUBLIC)
(Note that the words PRIVATE and COMMON are reserved for use in expansion.
However, they are treated as PUBLIC for now.)
expression Alignment factor for the location counter (2 to the specified power)
Default settings
If the section name appears for the first time in the file, the following defaults are used.
definition1 CODE
definition2 PUBLIC
expression 1
For subsequent appearances of the section name, the section inherits the values from previous appear-
ances.
Functional description
The section directive specifies a section name, as well as its attribute, link type, and location boundary.
During linking the linker gathers sections with the same name and links them together by attribute. The
order of linking is determined by the link type and the order in which the linker encounters the sections.

Section linking rules

1. Link sections in order of appearance.
2. Link by attribute.
3. Link by link type.
PUBLIC Link across all linked files.