1 .\" $NetBSD: ar.5,v 1.6 2003/04/16 13:35:22 wiz Exp $
3 .\" Copyright (c) 1990, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)ar.5.5 8.2 (Berkeley) 6/1/94
37 .Nd a.out archive (library) file format
43 combines several files into one.
44 Archives are mainly used as libraries of object files intended to be
45 loaded using the link-editor
53 .Dq Li "!\*[Lt]arch\*[Gt]\en" .
54 The rest of the archive is made up of objects, each of which is composed
55 of a header for a file, a possible file name, and the file contents.
56 The header is portable between machine architectures, and, if the file
57 contents are printable, the archive is itself printable.
59 The header is made up of six variable length
62 two character trailer.
63 The fields are the object name (16 characters), the file last modification
64 time (12 characters), the user and group id's (each 6 characters), the file
65 mode (8 characters) and the file size (10 characters).
66 All numeric fields are in decimal, except for the file mode which is in
69 The modification time is the file
75 The user and group id's are the file
80 The file mode is the file
83 The file size is the file
86 The two-byte trailer is the string "\`\en".
88 Only the name field has any provision for overflow.
89 If any file name is more than 16 characters in length or contains an
90 embedded space, the string "#1/" followed by the
93 name is written in the name field.
94 The file size (stored in the archive header) is incremented by the length
96 The name is then written immediately following the archive header.
98 Any unused characters in any of these fields are written as space
100 If any fields are their particular maximum number of characters in
101 length, there will be no separation between the fields.
103 Objects in the archive are always an even number of bytes long; files
104 which are an odd number of bytes long are padded with a newline
106 character, although the size in the header does not reflect this.
111 There have been at least four
114 The first was denoted by the leading
116 number 0177555 (stored as type int).
117 These archives were almost certainly created on a 16-bit machine, and
118 contain headers made up of five fields.
119 The fields are the object name (8 characters), the file last modification
120 time (type long), the user id (type char), the file mode (type char) and
121 the file size (type unsigned int).
122 Files were padded to an even number of bytes.
124 The second was denoted by the leading
126 number 0177545 (stored as type int).
127 These archives may have been created on either 16 or 32-bit machines, and
128 contain headers made up of six fields.
129 The fields are the object name (14 characters), the file last modification
130 time (type long), the user and group id's (each type char), the file mode
131 (type int), and the file size (type long).
132 Files were padded to an even number of bytes.
134 Both of these historical formats may be read with
137 The current archive format (without support for long character names and
138 names with embedded spaces) was introduced in
140 The headers were the same as the current format, with the exception that
141 names longer than 16 characters were truncated, and names with embedded
142 spaces (and often trailing spaces) were not supported.
143 It has been extended for these reasons,
145 This format first appeared in
148 The current a.out archive format is not specified by any standard.
152 format specified by the
154 ABI, with the same headers but different long file name handling.
160 manual page, do not currently describe the ELF archive format.