Section Flags and Section Type Operands

The flags operand specifies one or more flag attributes of a section. The flags operand is a string constant composed of one or more characters. Table Section Flag Characters lists the valid flag characters. The flags operand is case-sensitive. The assembler does not detect invalid specifications made by the programmer, such as stores to a section that is a non-writable section. A non-writable section is not flagged by the w flag character.

Section Flag Characters

Flag Characters

Description

w

Write access allowed.

a

Section is allocated in memory.

x

Section contains executable instructions.

s

Section contains "short" data.

o

Section adds ordering requirement.

The 'o' flag is only for ELF (Unix*) files.

The type operand specifies a section’s type attribute. The type operand is a string constant containing one of the valid section types listed in Table Section Types. The section types listed in the table correspond directly to ELF (UNIX*) section types, except for the "comdat" section type, which corresponds to COFF32 (Windows NT). The type operand is case-sensitive.

 

Section Types

Section Type

Description

"progbits"

Sections with initialized data or code.

"nobits"

Sections with uninitialized data (bss).

"comdat"

COMDAT sections, Windows NT

specific. See Windows NT (COFF32) Specific Section Flag Operands.

"note"

Note sections.