<html lang="en">
<head>
<title>Type - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Pseudo-Ops.html#Pseudo-Ops" title="Pseudo Ops">
<link rel="prev" href="Title.html#Title" title="Title">
<link rel="next" href="Uleb128.html#Uleb128" title="Uleb128">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
@import url("../raisonance.css");
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Type"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Uleb128.html#Uleb128">Uleb128</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Title.html#Title">Title</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Pseudo-Ops.html#Pseudo-Ops">Pseudo Ops</a>
<hr>
</div>

<h3 class="section">7.100 <code>.type</code></h3>

<p>This directive is used to set the type of a symbol.

<!-- only print the extra heading if both COFF and ELF are set -->
<h4 class="subheading">COFF Version</h4>

   <p><a name="index-COFF-symbol-type-473"></a><a name="index-symbol-type_002c-COFF-474"></a><a name="index-g_t_0040code_007btype_007d-directive-_0028COFF-version_0029-475"></a>For COFF targets, this directive is permitted only within
<code>.def</code>/<code>.endef</code> pairs.  It is used like this:

<pre class="smallexample">     .type <var>int</var>
</pre>
   <p>This records the integer <var>int</var> as the type attribute of a symbol table
entry.

<!-- only print the extra heading if both COFF and ELF are set -->
<h4 class="subheading">ELF Version</h4>

   <p><a name="index-ELF-symbol-type-476"></a><a name="index-symbol-type_002c-ELF-477"></a><a name="index-g_t_0040code_007btype_007d-directive-_0028ELF-version_0029-478"></a>For ELF targets, the <code>.type</code> directive is used like this:

<pre class="smallexample">     .type <var>name</var> , <var>type description</var>
</pre>
   <p>This sets the type of symbol <var>name</var> to be either a
function symbol or an object symbol.  There are five different syntaxes
supported for the <var>type description</var> field, in order to provide
compatibility with various other assemblers.

   <p>Because some of the characters used in these syntaxes (such as `<samp><span class="samp">@</span></samp>' and
`<samp><span class="samp">#</span></samp>') 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 assembler on all architectures, so that syntax should be used if you
require maximum portability.

   <p>The syntaxes supported are:

<pre class="smallexample">       .type &lt;name&gt;,#function
       .type &lt;name&gt;,#object
     
       .type &lt;name&gt;,@function
       .type &lt;name&gt;,@object
     
       .type &lt;name&gt;,%function
       .type &lt;name&gt;,%object
     
       .type &lt;name&gt;,"function"
       .type &lt;name&gt;,"object"
     
       .type &lt;name&gt; STT_FUNCTION
       .type &lt;name&gt; STT_OBJECT
</pre>
   </body></html>

