Skip to main content

7 `.attribute`

The .attribute directive is used to record information about an object file/binary that a linker or runtime loader needs to check for compatibility.

For more information like attribute name, number, value type and description, please refer to attribute section in RISC-V psABI.

.attribute take two arguments. The first argument of .attribute is the symbolic name of attribute or the attribute number, the prefix Tag_RISCV_ can be omitted, the second argument can be string or number.

Syntax for .attribute:

.attribute \<NAME_OR_NUMBER>, \<ATTRIBUTE_VALUE>

NAME_OR_NUMBER := \<attribute-name>
| [1-9][0-9]*

ATTRIBUTE_VALUE := \<string>
| \<number>