<html lang="en">
<head>
<title>Literal Prefix 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="Literal-Position-Directive.html#Literal-Position-Directive" title="Literal Position Directive">
<link rel="next" href="Absolute-Literals-Directive.html#Absolute-Literals-Directive" title="Absolute Literals 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-Prefix-Directive"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Absolute-Literals-Directive.html#Absolute-Literals-Directive">Absolute Literals Directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Literal-Position-Directive.html#Literal-Position-Directive">Literal Position 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.6 literal_prefix</h5>

<p><a name="index-g_t_0040code_007bliteral_005fprefix_007d-directive-1813"></a>
The <code>literal_prefix</code> directive allows you to specify different
sections to hold literals from different portions of an assembly file. 
With this directive, a single assembly file can be used to generate code
into multiple sections, including literals generated by the assembler.

<pre class="smallexample">         .begin literal_prefix [<var>name</var>]
         .end literal_prefix
</pre>
   <p>By default the assembler places literal pools in sections separate from
the instructions, using the default literal section names of
<code>.literal</code> for PC-relative mode <code>L32R</code> instructions and
<code>.lit4</code> for absolute mode <code>L32R</code> instructions (see <a href="Absolute-Literals-Directive.html#Absolute-Literals-Directive">Absolute Literals Directive</a>).  The <code>literal_prefix</code> directive causes
different literal sections to be used for the code inside the delimited
region.  The new literal sections are determined by including <var>name</var>
as a prefix to the default literal section names.  If the <var>name</var>
argument is omitted, the literal sections revert to the defaults.  This
directive has no effect 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>).

   <p>Except for two special cases, the assembler determines the new literal
sections by simply prepending <var>name</var> to the default section names,
resulting in <var>name</var><code>.literal</code> and <var>name</var><code>.lit4</code>
sections.  The <code>literal_prefix</code> directive is often used with the
name of the current text section as the prefix argument.  To facilitate
this usage, the assembler uses special case rules when it recognizes
<var>name</var> as a text section name.  First, if <var>name</var> ends with
<code>.text</code>, that suffix is not included in the literal section name. 
For example, if <var>name</var> is <code>.iram0.text</code>, then the literal
sections will be <code>.iram0.literal</code> and <code>.iram0.lit4</code>.  Second,
if <var>name</var> begins with <code>.gnu.linkonce.t.</code>, then the literal
section names are formed by replacing the <code>.t</code> substring with
<code>.literal</code> and <code>.lit4</code>.  For example, if <var>name</var> is
<code>.gnu.linkonce.t.func</code>, the literal sections will be
<code>.gnu.linkonce.literal.func</code> and <code>.gnu.linkonce.lit4.func</code>.

   </body></html>

