bfd.h: added alignment field
[deliverable/binutils-gdb.git] / include / ranlib.h
CommitLineData
61a153e5
RP
1/* ranlib.h -- archive library index member definition for GNU.
2 Copyright (C) 1990 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
16
17/* The Symdef member of an archive contains two things:
18 a table that maps symbol-string offsets to file offsets,
19 and a symbol-string table. All the symbol names are
20 run together (each with trailing null) in the symbol-string
21 table. There is a single longword bytecount on the front
22 of each of these tables. Thus if we have two symbols,
23 "foo" and "_bar", that are in archive members at offsets
24 200 and 900, it would look like this:
25 16 ; byte count of index table
26 0 ; offset of "foo" in string table
27 200 ; offset of foo-module in file
28 4 ; offset of "bar" in string table
29 900 ; offset of bar-module in file
30 9 ; byte count of string table
31 "foo\0_bar\0" ; string table */
32
bad3df67
JG
33#define RANLIBMAG "__.SYMDEF" /* Archive file name containing index */
34#define RANLIBSKEW 3 /* Creation time offset */
35
61a153e5
RP
36/* Format of __.SYMDEF:
37 First, a longword containing the size of the 'symdef' data that follows.
38 Second, zero or more 'symdef' structures.
39 Third, a longword containing the length of symbol name strings.
40 Fourth, zero or more symbol name strings (each followed by a null). */
41
42struct symdef
43 {
44 union
45 {
46 unsigned long string_offset; /* In the file */
47 char *name; /* In memory, sometimes */
48 } s;
bad3df67
JG
49 /* this points to the front of the file header (AKA member header --
50 a struct ar_hdr), not to the front of the file or into the file).
51 in other words it only tells you which file to read */
61a153e5
RP
52 unsigned long file_offset;
53 };
54
55/* Compatability with BSD code */
56
57#define ranlib symdef
58#define ran_un s
bad3df67 59#define ran_strx string_offset
61a153e5
RP
60#define ran_name name
61#define ran_off file_offset
This page took 0.028099 seconds and 4 git commands to generate.