• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2011.09/share/doc/arm-arm-none-eabi/html/binutils.html/
1<html lang="en">
2<head>
3<title>ar - GNU Binary Utilities</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="GNU Binary Utilities">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="prev" href="index.html#Top" title="Top">
9<link rel="next" href="nm.html#nm" title="nm">
10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
11<!--
12Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
132000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
14Free Software Foundation, Inc.
15
16Permission is granted to copy, distribute and/or modify this document
17under the terms of the GNU Free Documentation License, Version 1.3
18or any later version published by the Free Software Foundation;
19with no Invariant Sections, with no Front-Cover Texts, and with no
20Back-Cover Texts.  A copy of the license is included in the
21section entitled ``GNU Free Documentation License''.
22
23-->
24<meta http-equiv="Content-Style-Type" content="text/css">
25<style type="text/css"><!--
26  pre.display { font-family:inherit }
27  pre.format  { font-family:inherit }
28  pre.smalldisplay { font-family:inherit; font-size:smaller }
29  pre.smallformat  { font-family:inherit; font-size:smaller }
30  pre.smallexample { font-size:smaller }
31  pre.smalllisp    { font-size:smaller }
32  span.sc    { font-variant:small-caps }
33  span.roman { font-family:serif; font-weight:normal; } 
34  span.sansserif { font-family:sans-serif; font-weight:normal; } 
35--></style>
36<link rel="stylesheet" type="text/css" href="../cs.css">
37</head>
38<body>
39<div class="node">
40<a name="ar"></a>
41<p>
42Next:&nbsp;<a rel="next" accesskey="n" href="nm.html#nm">nm</a>,
43Previous:&nbsp;<a rel="previous" accesskey="p" href="index.html#Top">Top</a>,
44Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
45<hr>
46</div>
47
48<h2 class="chapter">1 ar</h2>
49
50<p><a name="index-ar-2"></a><a name="index-archives-3"></a><a name="index-collections-of-files-4"></a>
51<!-- man title ar create, modify, and extract from archives -->
52
53<pre class="smallexample">     ar [<samp><span class="option">--plugin</span></samp> <var>name</var>] [-]<var>p</var>[<var>mod</var> [<var>relpos</var>] [<var>count</var>]] [<samp><span class="option">--target</span></samp> <var>bfdname</var>] <var>archive</var> [<var>member</var>...]
54     ar -M [ &lt;mri-script ]
55</pre>
56   <!-- man begin DESCRIPTION ar -->
57   <p>The <span class="sc">gnu</span> <samp><span class="command">ar</span></samp> program creates, modifies, and extracts from
58archives.  An <dfn>archive</dfn> is a single file holding a collection of
59other files in a structure that makes it possible to retrieve
60the original individual files (called <dfn>members</dfn> of the archive).
61
62   <p>The original files' contents, mode (permissions), timestamp, owner, and
63group are preserved in the archive, and can be restored on
64extraction.
65
66   <p><a name="index-name-length-5"></a><span class="sc">gnu</span> <samp><span class="command">ar</span></samp> can maintain archives whose members have names of any
67length; however, depending on how <samp><span class="command">ar</span></samp> is configured on your
68system, a limit on member-name length may be imposed for compatibility
69with archive formats maintained with other tools.  If it exists, the
70limit is often 15 characters (typical of formats related to a.out) or 16
71characters (typical of formats related to coff).
72
73   <p><a name="index-libraries-6"></a><samp><span class="command">ar</span></samp> is considered a binary utility because archives of this sort
74are most often used as <dfn>libraries</dfn> holding commonly needed
75subroutines.
76
77   <p><a name="index-symbol-index-7"></a><samp><span class="command">ar</span></samp> creates an index to the symbols defined in relocatable
78object modules in the archive when you specify the modifier &lsquo;<samp><span class="samp">s</span></samp>&rsquo;. 
79Once created, this index is updated in the archive whenever <samp><span class="command">ar</span></samp>
80makes a change to its contents (save for the &lsquo;<samp><span class="samp">q</span></samp>&rsquo; update operation). 
81An archive with such an index speeds up linking to the library, and
82allows routines in the library to call each other without regard to
83their placement in the archive.
84
85   <p>You may use &lsquo;<samp><span class="samp">nm -s</span></samp>&rsquo; or &lsquo;<samp><span class="samp">nm --print-armap</span></samp>&rsquo; to list this index
86table.  If an archive lacks the table, another form of <samp><span class="command">ar</span></samp> called
87<samp><span class="command">ranlib</span></samp> can be used to add just the table.
88
89   <p><a name="index-thin-archives-8"></a><span class="sc">gnu</span> <samp><span class="command">ar</span></samp> can optionally create a <em>thin</em> archive,
90which contains a symbol index and references to the original copies
91of the member files of the archives.  Such an archive is useful
92for building libraries for use within a local build, where the
93relocatable objects are expected to remain available, and copying the
94contents of each object would only waste time and space.  Thin archives
95are also <em>flattened</em>, so that adding one or more archives to a
96thin archive will add the elements of the nested archive individually. 
97The paths to the elements of the archive are stored relative to the
98archive itself.
99
100   <p><a name="index-compatibility_002c-_0040command_007bar_007d-9"></a><a name="index-g_t_0040command_007bar_007d-compatibility-10"></a><span class="sc">gnu</span> <samp><span class="command">ar</span></samp> is designed to be compatible with two different
101facilities.  You can control its activity using command-line options,
102like the different varieties of <samp><span class="command">ar</span></samp> on Unix systems; or, if you
103specify the single command-line option <samp><span class="option">-M</span></samp>, you can control it
104with a script supplied via standard input, like the MRI &ldquo;librarian&rdquo;
105program.
106
107<!-- man end -->
108<ul class="menu">
109<li><a accesskey="1" href="ar-cmdline.html#ar-cmdline">ar cmdline</a>:                   Controlling <samp><span class="command">ar</span></samp> on the command line
110<li><a accesskey="2" href="ar-scripts.html#ar-scripts">ar scripts</a>:                   Controlling <samp><span class="command">ar</span></samp> with a script
111</ul>
112
113   </body></html>
114
115