.section

Previous Assembler Directives Next

Syntax: .section name[, "flags"] or .section name[, subsegment]

Use the .section directive to assemble the following code into a section named name.

If the optional argument is quoted, it is taken as flags to use for the section. Each flag is a single character. The following flags are recognized:

b
bss section (uninitialized data)

n
section is not loaded

w
writable section

d
data section

r
read-only section

x
executable section

s
shared section (meaningful for PE targets)

a
ignored (for compatibility with the ELF version)
If no flags are specified, the default flags depend upon the section name. If the section name is not recognized, the default will be for the section to be loaded and writable. Note the n and w flags remove attributes from the section, rather than adding them, so if they are used on their own it will be as if no flags had been specified at all.

If the optional argument to the .section directive is not quoted, it is taken as a subsegment number (see Sub-Sections).