<html lang="en">
<head>
<title>Literal Directive - 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="Xtensa-Directives.html#Xtensa-Directives" title="Xtensa Directives">
<link rel="prev" href="Transform-Directive.html#Transform-Directive" title="Transform Directive">
<link rel="next" href="Literal-Position-Directive.html#Literal-Position-Directive" title="Literal Position Directive">
<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="Literal-Directive"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Literal-Position-Directive.html#Literal-Position-Directive">Literal Position Directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Transform-Directive.html#Transform-Directive">Transform Directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Xtensa-Directives.html#Xtensa-Directives">Xtensa Directives</a>
<hr>
</div>

<h5 class="subsubsection">8.34.5.4 literal</h5>

<p><a name="index-g_t_0040code_007bliteral_007d-directive-1811"></a>
The <code>.literal</code> directive is used to define literal pool data, i.e.,
read-only 32-bit data accessed via <code>L32R</code> instructions.

<pre class="smallexample">         .literal <var>label</var>, <var>value</var>[, <var>value</var>...]
</pre>
   <p>This directive is similar to the standard <code>.word</code> directive, except
that the actual location of the literal data is determined by the
assembler and linker, not by the position of the <code>.literal</code>
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:

<pre class="smallexample">         entry sp, 40
         .literal .L1, sym
         l32r    a4, .L1
</pre>
   <p>can be used to load a pointer to the symbol <code>sym</code> into register
<code>a4</code>.  The value of <code>sym</code> will not be placed between the
<code>ENTRY</code> and <code>L32R</code> instructions; instead, the assembler puts
the data in a literal pool.

   <p>Literal pools for absolute mode <code>L32R</code> instructions
(see <a href="Absolute-Literals-Directive.html#Absolute-Literals-Directive">Absolute Literals Directive</a>) are placed in a separate
<code>.lit4</code> section.  By default literal pools for PC-relative mode
<code>L32R</code> instructions are placed in a separate <code>.literal</code>
section; however, when using the `<samp><span class="samp">--text-section-literals</span></samp>'
option (see <a href="Xtensa-Options.html#Xtensa-Options">Command Line Options</a>), the literal
pools are placed in the current section.  These text section literal
pools are created automatically before <code>ENTRY</code> instructions and
manually after `<samp><span class="samp">.literal_position</span></samp>' directives (see <a href="Literal-Position-Directive.html#Literal-Position-Directive">literal_position</a>).  If there are no preceding
<code>ENTRY</code> instructions, explicit <code>.literal_position</code> directives
must be used to place the text section literal pools; otherwise,
<samp><span class="command">as</span></samp> will report an error.

   </body></html>

