5.1.5 Section Directive

The .section name [, attr1[,...,attrn]] directive, where the optional argument is not quoted, assembles the code following a section with name.

If the character * is specified for name, the assembler will generate a unique name for the section based on the input file name in the format filename.s.scnn, where n represents the number of auto-
generated section names.

Sections named * can be used to conserve memory because the assembler will not add alignment padding to these sections. Sections that are not named * may be combined across several files, so the assembler must add padding in order to guarantee the requested alignment.

If the optional argument is not present, the section attributes depend on the section name. A table of reserved section names with implied attributes is given in 9.3 Default Linker Script. If the section name matches a reserved name, the implied attributes will be assigned to that section. If the section name is not recognized as a reserved name, the default attribute will be data (initialized storage in data memory).

Implied attributes for reserved section names other than [.text, .data, .bss] are deprecated.

A warning will be issued if implied attributes for these reserved sections are used.

If the first optional argument is quoted, it is taken as one or more flags that describe the section attributes. Quoted section flags are deprecated (see 16 Deprecated Features). A warning will be issued if quoted section flags are used.

If the first optional argument is not quoted, it is taken as the first element of an attribute list. Attributes may be specified in any order and are case-insensitive. Two categories of section attributes exist: attributes that represent section types and attributes that modify section types.