Node: Literal Directive, Next: Literal Position Directive, Previous: Generics Directive, Up: Xtensa Directives

### literal

The `.literal` directive is used to define literal pool data, i.e., read-only 32-bit data accessed via `L32R` instructions.

             .literal label, value[, value...]

This directive is similar to the standard `.word` directive, except that the actual location of the literal data is determined by the assembler and linker, not by the position of the `.literal` directive. Using this directive gives the assembler freedom to locate the literal data in the most appropriate place and possibly to combine identical literals. For example, the code:

             entry sp, 40
             .literal .L1, sym
             l32r    a4, .L1

can be used to load a pointer to the symbol `sym` into register `a4`. The value of `sym` will not be placed between the `ENTRY` and `L32R` instructions; instead, the assembler puts the data in a literal pool.

By default literal pools are placed in a separate section; however, when using the `--text-section-literals` option (see Command Line Options), the literal pools are placed in the current section. These text section literal pools are created automatically before `ENTRY` instructions and manually after `.literal_position` directives (see literal_position). If there are no preceding `ENTRY` instructions or `.literal_position` directives, the assembler will print a warning and place the literal pool at the beginning of the current section. In such cases, explicit `.literal_position` directives should be used to place the literal pools.