📄 input-section-common.html
字号:
<html lang="en">
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
</head>
<body>
<div class="node">
<p>
Node:<a name="Input%20Section%20Common">Input Section Common</a>,
Next:<a rel="next" accesskey="n" href="Input-Section-Keep.html#Input%20Section%20Keep">Input Section Keep</a>,
Previous:<a rel="previous" accesskey="p" href="Input-Section-Wildcards.html#Input%20Section%20Wildcards">Input Section Wildcards</a>,
Up:<a rel="up" accesskey="u" href="Input-Section.html#Input%20Section">Input Section</a>
<hr><br>
</div>
<h5 class="subsubsection">Input section for common symbols</h5>
<p>A special notation is needed for common symbols, because in many object
file formats common symbols do not have a particular input section. The
linker treats common symbols as though they are in an input section
named <code>COMMON</code>.
<p>You may use file names with the <code>COMMON</code> section just as with any
other input sections. You can use this to place common symbols from a
particular input file in one section while common symbols from other
input files are placed in another section.
<p>In most cases, common symbols in input files will be placed in the
<code>.bss</code> section in the output file. For example:
<pre class="smallexample"> .bss { *(.bss) *(COMMON) }
</pre>
<p>Some object file formats have more than one type of common symbol. For
example, the MIPS ELF object file format distinguishes standard common
symbols and small common symbols. In this case, the linker will use a
different special section name for other types of common symbols. In
the case of MIPS ELF, the linker uses <code>COMMON</code> for standard common
symbols and <code>.scommon</code> for small common symbols. This permits you
to map the different types of common symbols into memory at different
locations.
<p>You will sometimes see <code>[COMMON]</code> in old linker scripts. This
notation is now considered obsolete. It is equivalent to
<code>*(COMMON)</code>.
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -