|
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <!-- This file documents the GNU Assembler "as".
-
- Copyright (C) 1991-2020 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".
- -->
- <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Comm (Using as)</title>
-
- <meta name="description" content="Comm (Using as)">
- <meta name="keywords" content="Comm (Using as)">
- <meta name="resource-type" content="document">
- <meta name="distribution" content="global">
- <meta name="Generator" content="makeinfo">
- <link href="index.html#Top" rel="start" title="Top">
- <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
- <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
- <link href="Pseudo-Ops.html#Pseudo-Ops" rel="up" title="Pseudo Ops">
- <link href="Data.html#Data" rel="next" title="Data">
- <link href="CFI-directives.html#CFI-directives" rel="prev" title="CFI directives">
- <style type="text/css">
- <!--
- a.summary-letter {text-decoration: none}
- blockquote.indentedblock {margin-right: 0em}
- blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
- blockquote.smallquotation {font-size: smaller}
- div.display {margin-left: 3.2em}
- div.example {margin-left: 3.2em}
- div.lisp {margin-left: 3.2em}
- div.smalldisplay {margin-left: 3.2em}
- div.smallexample {margin-left: 3.2em}
- div.smalllisp {margin-left: 3.2em}
- kbd {font-style: oblique}
- pre.display {font-family: inherit}
- pre.format {font-family: inherit}
- pre.menu-comment {font-family: serif}
- pre.menu-preformatted {font-family: serif}
- pre.smalldisplay {font-family: inherit; font-size: smaller}
- pre.smallexample {font-size: smaller}
- pre.smallformat {font-family: inherit; font-size: smaller}
- pre.smalllisp {font-size: smaller}
- span.nolinebreak {white-space: nowrap}
- span.roman {font-family: initial; font-weight: normal}
- span.sansserif {font-family: sans-serif; font-weight: normal}
- ul.no-bullet {list-style: none}
- -->
- </style>
-
-
- </head>
-
- <body lang="en">
- <a name="Comm"></a>
- <div class="header">
- <p>
- Next: <a href="Data.html#Data" accesskey="n" rel="next">Data</a>, Previous: <a href="CFI-directives.html#CFI-directives" accesskey="p" rel="prev">CFI directives</a>, Up: <a href="Pseudo-Ops.html#Pseudo-Ops" accesskey="u" rel="up">Pseudo Ops</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <hr>
- <a name="g_t_002ecomm-symbol-_002c-length-"></a>
- <h3 class="section">7.11 <code>.comm <var>symbol</var> , <var>length</var> </code></h3>
-
- <a name="index-comm-directive"></a>
- <a name="index-symbol_002c-common"></a>
- <p><code>.comm</code> declares a common symbol named <var>symbol</var>. When linking, a
- common symbol in one object file may be merged with a defined or common symbol
- of the same name in another object file. If <code>ld</code> does not see a
- definition for the symbol–just one or more common symbols–then it will
- allocate <var>length</var> bytes of uninitialized memory. <var>length</var> must be an
- absolute expression. If <code>ld</code> sees multiple common symbols with
- the same name, and they do not all have the same size, it will allocate space
- using the largest size.
- </p>
- <p>When using ELF or (as a GNU extension) PE, the <code>.comm</code> directive takes
- an optional third argument. This is the desired alignment of the symbol,
- specified for ELF as a byte boundary (for example, an alignment of 16 means
- that the least significant 4 bits of the address should be zero), and for PE
- as a power of two (for example, an alignment of 5 means aligned to a 32-byte
- boundary). The alignment must be an absolute expression, and it must be a
- power of two. If <code>ld</code> allocates uninitialized memory for the
- common symbol, it will use the alignment when placing the symbol. If no
- alignment is specified, <code>as</code> will set the alignment to the
- largest power of two less than or equal to the size of the symbol, up to a
- maximum of 16 on ELF, or the default section alignment of 4 on PE<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>.
- </p>
- <p>The syntax for <code>.comm</code> differs slightly on the HPPA. The syntax is
- ‘<samp><var>symbol</var> .comm, <var>length</var></samp>’; <var>symbol</var> is optional.
- </p>
- <div class="footnote">
- <hr>
- <h4 class="footnotes-heading">Footnotes</h4>
-
- <h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
- <p>This
- is not the same as the executable image file alignment controlled by <code>ld</code>’s
- ‘<samp>--section-alignment</samp>’ option; image file sections in PE are aligned to
- multiples of 4096, which is far too large an alignment for ordinary variables.
- It is rather the default alignment for (non-debug) sections within object
- (‘<samp>*.o</samp>’) files, which are less strictly aligned.</p>
- </div>
- <hr>
- <div class="header">
- <p>
- Next: <a href="Data.html#Data" accesskey="n" rel="next">Data</a>, Previous: <a href="CFI-directives.html#CFI-directives" accesskey="p" rel="prev">CFI directives</a>, Up: <a href="Pseudo-Ops.html#Pseudo-Ops" accesskey="u" rel="up">Pseudo Ops</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
- </div>
-
-
-
- </body>
- </html>
|