You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
8.4 KiB
HTML
144 lines
8.4 KiB
HTML
4 years ago
|
<html lang="en">
|
||
|
<head>
|
||
|
<title>s390 Directives - Using as</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html">
|
||
|
<meta name="description" content="Using as">
|
||
|
<meta name="generator" content="makeinfo 4.13">
|
||
|
<link title="Top" rel="start" href="index.html#Top">
|
||
|
<link rel="up" href="S_002f390_002dDependent.html#S_002f390_002dDependent" title="S/390-Dependent">
|
||
|
<link rel="prev" href="s390-Syntax.html#s390-Syntax" title="s390 Syntax">
|
||
|
<link rel="next" href="s390-Floating-Point.html#s390-Floating-Point" title="s390 Floating Point">
|
||
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||
|
<!--
|
||
|
This file documents the GNU Assembler "as".
|
||
|
|
||
|
Copyright (C) 1991-2015 Free Software Foundation, Inc.
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document
|
||
|
under the terms of the GNU Free Documentation License, Version 1.3
|
||
|
or any later version published by the Free Software Foundation;
|
||
|
with no Invariant Sections, with no Front-Cover Texts, and with no
|
||
|
Back-Cover Texts. A copy of the license is included in the
|
||
|
section entitled ``GNU Free Documentation License''.
|
||
|
|
||
|
-->
|
||
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||
|
<style type="text/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">
|
||
|
<a name="s390-Directives"></a>
|
||
|
<p>
|
||
|
Next: <a rel="next" accesskey="n" href="s390-Floating-Point.html#s390-Floating-Point">s390 Floating Point</a>,
|
||
|
Previous: <a rel="previous" accesskey="p" href="s390-Syntax.html#s390-Syntax">s390 Syntax</a>,
|
||
|
Up: <a rel="up" accesskey="u" href="S_002f390_002dDependent.html#S_002f390_002dDependent">S/390-Dependent</a>
|
||
|
<hr>
|
||
|
</div>
|
||
|
|
||
|
<h4 class="subsection">9.38.4 Assembler Directives</h4>
|
||
|
|
||
|
<p><code>as</code> for s390 supports all of the standard ELF
|
||
|
assembler directives as outlined in the main part of this document.
|
||
|
Some directives have been extended and there are some additional
|
||
|
directives, which are only available for the s390 <code>as</code>.
|
||
|
|
||
|
|
||
|
<a name="index-g_t_0040code_007b_002einsn_007d-directive_002c-s390-1907"></a>
|
||
|
<dl><dt><code>.insn</code><dd>This directive permits the numeric representation of an instructions
|
||
|
and makes the assembler insert the operands according to one of the
|
||
|
instructions formats for ‘<samp><span class="samp">.insn</span></samp>’ (<a href="s390-Formats.html#s390-Formats">s390 Formats</a>).
|
||
|
For example, the instruction ‘<samp><span class="samp">l %r1,24(%r15)</span></samp>’ could be written as
|
||
|
‘<samp><span class="samp">.insn rx,0x58000000,%r1,24(%r15)</span></samp>’.
|
||
|
<a name="index-g_t_0040code_007b_002eshort_007d-directive_002c-s390-1908"></a><a name="index-g_t_0040code_007b_002elong_007d-directive_002c-s390-1909"></a><a name="index-g_t_0040code_007b_002equad_007d-directive_002c-s390-1910"></a><br><dt><code>.short</code><dt><code>.long</code><dt><code>.quad</code><dd>This directive places one or more 16-bit (.short), 32-bit (.long), or
|
||
|
64-bit (.quad) values into the current section. If an ELF or TLS modifier
|
||
|
is used only the following expressions are allowed:
|
||
|
‘<samp><span class="samp">symbol@modifier + constant</span></samp>’,
|
||
|
‘<samp><span class="samp">symbol@modifier + label + constant</span></samp>’, and
|
||
|
‘<samp><span class="samp">symbol@modifier - label + constant</span></samp>’.
|
||
|
The following modifiers are available:
|
||
|
<dl>
|
||
|
<dt><code>@got</code><dt><code>@got12</code><dd>The @got modifier can be used for .short, .long and .quad. The @got12
|
||
|
modifier is synonym to @got. The symbol is added to the GOT. The symbol
|
||
|
term is replaced with offset from the start of the GOT to the GOT slot for
|
||
|
the symbol.
|
||
|
<br><dt><code>@gotoff</code><dd>The @gotoff modifier can be used for .short, .long and .quad. The symbol
|
||
|
term is replaced with the offset from the start of the GOT to the address
|
||
|
of the symbol.
|
||
|
<br><dt><code>@gotplt</code><dd>The @gotplt modifier can be used for .long and .quad. A procedure linkage
|
||
|
table entry is generated for the symbol and a jump slot for the symbol
|
||
|
is added to the GOT. The symbol term is replaced with the offset from the
|
||
|
start of the GOT to the jump slot for the symbol.
|
||
|
<br><dt><code>@plt</code><dd>The @plt modifier can be used for .long and .quad. A procedure linkage
|
||
|
table entry us generated for the symbol. The symbol term is replaced with
|
||
|
the address of the PLT entry for the symbol.
|
||
|
<br><dt><code>@pltoff</code><dd>The @pltoff modifier can be used for .short, .long and .quad. The symbol
|
||
|
term is replaced with the offset from the start of the PLT to the address
|
||
|
of the symbol.
|
||
|
<br><dt><code>@tlsgd</code><dt><code>@tlsldm</code><dd>The @tlsgd and @tlsldm modifier can be used for .long and .quad. A
|
||
|
tls_index structure for the symbol is added to the GOT. The symbol term is
|
||
|
replaced with the offset from the start of the GOT to the tls_index structure.
|
||
|
<br><dt><code>@gotntpoff</code><dt><code>@indntpoff</code><dd>The @gotntpoff and @indntpoff modifier can be used for .long and .quad.
|
||
|
The symbol is added to the static TLS block and the negated offset to the
|
||
|
symbol in the static TLS block is added to the GOT. For @gotntpoff the
|
||
|
symbol term is replaced with the offset from the start of the GOT to the
|
||
|
GOT slot, for @indntpoff the symbol term is replaced with the address
|
||
|
of the GOT slot.
|
||
|
<br><dt><code>@dtpoff</code><dd>The @dtpoff modifier can be used for .long and .quad. The symbol term
|
||
|
is replaced with the offset of the symbol relative to the start of the
|
||
|
TLS block it is contained in.
|
||
|
<br><dt><code>@ntpoff</code><dd>The @ntpoff modifier can be used for .long and .quad. The symbol term
|
||
|
is replaced with the offset of the symbol relative to the TCB pointer.
|
||
|
</dl>
|
||
|
|
||
|
<p>For more information about the thread local storage modifiers see the
|
||
|
ELF extension documentation ‘<samp><span class="samp">ELF Handling For Thread-Local Storage</span></samp>’.
|
||
|
|
||
|
<p><a name="index-g_t_0040code_007b_002eltorg_007d-directive_002c-s390-1911"></a><br><dt><code>.ltorg</code><dd>This directive causes the current contents of the literal pool to be
|
||
|
dumped to the current location (<a href="s390-Literal-Pool-Entries.html#s390-Literal-Pool-Entries">s390 Literal Pool Entries</a>).
|
||
|
|
||
|
<p><a name="index-g_t_0040code_007b_002emachine_007d-directive_002c-s390-1912"></a><br><dt><code>.machine </code><var>STRING</var><code>[+</code><var>EXTENSION</var><code>]...</code><dd>
|
||
|
This directive allows changing the machine for which code is
|
||
|
generated. <code>string</code> may be any of the <code>-march=</code>
|
||
|
selection options, or <code>push</code>, or <code>pop</code>. <code>.machine
|
||
|
push</code> saves the currently selected cpu, which may be restored with
|
||
|
<code>.machine pop</code>. Be aware that the cpu string has to be put
|
||
|
into double quotes in case it contains characters not appropriate
|
||
|
for identifiers. So you have to write <code>"z9-109"</code> instead of
|
||
|
just <code>z9-109</code>. Extensions can be specified after the cpu
|
||
|
name, separated by plus charaters. Valid extensions are:
|
||
|
<code>htm</code>,
|
||
|
<code>nohtm</code>,
|
||
|
<code>vx</code>,
|
||
|
<code>novx</code>.
|
||
|
They extend the basic instruction set with features from a higher
|
||
|
cpu level, or remove support for a feature from the given cpu
|
||
|
level.
|
||
|
|
||
|
<p>Example: <code>z13+nohtm</code> allows all instructions of the z13 cpu
|
||
|
except instructions from the HTM facility.
|
||
|
|
||
|
<p><a name="index-g_t_0040code_007b_002emachinemode_007d-directive_002c-s390-1913"></a><br><dt><code>.machinemode string</code><dd>This directive allows to change the architecture mode for which code
|
||
|
is being generated. <code>string</code> may be <code>esa</code>, <code>zarch</code>,
|
||
|
<code>zarch_nohighgprs</code>, <code>push</code>, or <code>pop</code>.
|
||
|
<code>.machinemode zarch_nohighgprs</code> can be used to prevent the
|
||
|
<code>highgprs</code> flag from being set in the ELF header of the output
|
||
|
file. This is useful in situations where the code is gated with a
|
||
|
runtime check which makes sure that the code is only executed on
|
||
|
kernels providing the <code>highgprs</code> feature.
|
||
|
<code>.machinemode push</code> saves the currently selected mode, which may
|
||
|
be restored with <code>.machinemode pop</code>.
|
||
|
</dl>
|
||
|
|
||
|
</body></html>
|
||
|
|