as: Type
1
1 7.95 '.type'
1 ============
1
1 This directive is used to set the type of a symbol.
1
1 COFF Version
1 ------------
1
1 For COFF targets, this directive is permitted only within
1 '.def'/'.endef' pairs. It is used like this:
1
1 .type INT
1
1 This records the integer INT as the type attribute of a symbol table
1 entry.
1
1 ELF Version
1 -----------
1
1 For ELF targets, the '.type' directive is used like this:
1
1 .type NAME , TYPE DESCRIPTION
1
1 This sets the type of symbol NAME to be either a function symbol or
1 an object symbol. There are five different syntaxes supported for the
1 TYPE DESCRIPTION field, in order to provide compatibility with various
1 other assemblers.
1
1 Because some of the characters used in these syntaxes (such as '@'
1 and '#') are comment characters for some architectures, some of the
1 syntaxes below do not work on all architectures. The first variant will
1 be accepted by the GNU assembler on all architectures so that variant
1 should be used for maximum portability, if you do not need to assemble
1 your code with other assemblers.
1
1 The syntaxes supported are:
1
1 .type <name> STT_<TYPE_IN_UPPER_CASE>
1 .type <name>,#<type>
1 .type <name>,@<type>
1 .type <name>,%<type>
1 .type <name>,"<type>"
1
1 The types supported are:
1
1 'STT_FUNC'
1 'function'
1 Mark the symbol as being a function name.
1
1 'STT_GNU_IFUNC'
1 'gnu_indirect_function'
1 Mark the symbol as an indirect function when evaluated during reloc
1 processing. (This is only supported on assemblers targeting GNU
1 systems).
1
1 'STT_OBJECT'
1 'object'
1 Mark the symbol as being a data object.
1
1 'STT_TLS'
1 'tls_object'
1 Mark the symbol as being a thread-local data object.
1
1 'STT_COMMON'
1 'common'
1 Mark the symbol as being a common data object.
1
1 'STT_NOTYPE'
1 'notype'
1 Does not mark the symbol in any way. It is supported just for
1 completeness.
1
1 'gnu_unique_object'
1 Marks the symbol as being a globally unique data object. The
1 dynamic linker will make sure that in the entire process there is
1 just one symbol with this name and type in use. (This is only
1 supported on assemblers targeting GNU systems).
1
1 Note: Some targets support extra types in addition to those listed
1 above.
1