This directive is used to set the type of a symbol.
For COFF targets, this directive is permitted only within
.endef pairs. It is used like this:
This records the integer int as the type attribute of a symbol table entry.
For ELF targets, the
.type directive is used like this:
.type name , type description
This sets the type of symbol name to be either a function symbol or an object symbol. There are five different syntaxes supported for the type description field, in order to provide compatibility with various other assemblers.
Because some of the characters used in these syntaxes (such as `@' and `#') are comment characters for some architectures, some of the syntaxes below do not work on all architectures. The first variant will be accepted by the GNU assembler on all architectures so that variant should be used for maximum portability, if you do not need to assemble your code with other assemblers.
The syntaxes supported are:
.type <name> STT_FUNCTION .type <name> STT_OBJECT .type <name>,#function .type <name>,#object .type <name>,@function .type <name>,@object .type <name>,%function .type <name>,%object .type <name>,"function" .type <name>,"object"