📄 ar.html
字号:
<html lang="en">
<head>
<title>GNU Binary Utilities</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Binary Utilities">
<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="ar">ar</a>,
Next:<a rel="next" accesskey="n" href="nm.html#nm">nm</a>,
Previous:<a rel="previous" accesskey="p" href="index.html#Top">Top</a>,
Up:<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr><br>
</div>
<h2 class="chapter">ar</h2>
<pre class="smallexample"> ar [-]<var>p</var>[<var>mod</var> [<var>relpos</var>] [<var>count</var>]] <var>archive</var> [<var>member</var>...]
ar -M [ <mri-script ]
</pre>
<p>The <small>GNU</small> <code>ar</code> program creates, modifies, and extracts from
archives. An <dfn>archive</dfn> is a single file holding a collection of
other files in a structure that makes it possible to retrieve
the original individual files (called <dfn>members</dfn> of the archive).
<p>The original files' contents, mode (permissions), timestamp, owner, and
group are preserved in the archive, and can be restored on
extraction.
<p><small>GNU</small> <code>ar</code> can maintain archives whose members have names of any
length; however, depending on how <code>ar</code> is configured on your
system, a limit on member-name length may be imposed for compatibility
with archive formats maintained with other tools. If it exists, the
limit is often 15 characters (typical of formats related to a.out) or 16
characters (typical of formats related to coff).
<p><code>ar</code> is considered a binary utility because archives of this sort
are most often used as <dfn>libraries</dfn> holding commonly needed
subroutines.
<p><code>ar</code> creates an index to the symbols defined in relocatable
object modules in the archive when you specify the modifier <code>s</code>.
Once created, this index is updated in the archive whenever <code>ar</code>
makes a change to its contents (save for the <code>q</code> update operation).
An archive with such an index speeds up linking to the library, and
allows routines in the library to call each other without regard to
their placement in the archive.
<p>You may use <code>nm -s</code> or <code>nm --print-armap</code> to list this index
table. If an archive lacks the table, another form of <code>ar</code> called
<code>ranlib</code> can be used to add just the table.
<p><small>GNU</small> <code>ar</code> is designed to be compatible with two different
facilities. You can control its activity using command-line options,
like the different varieties of <code>ar</code> on Unix systems; or, if you
specify the single command-line option <code>-M</code>, you can control it
with a script supplied via standard input, like the MRI "librarian"
program.
<ul class="menu">
<li><a accesskey="1" href="ar-cmdline.html#ar%20cmdline">ar cmdline</a>: Controlling <code>ar</code> on the command line
<li><a accesskey="2" href="ar-scripts.html#ar%20scripts">ar scripts</a>: Controlling <code>ar</code> with a script
</ul>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -