This commit was generated by cvs2svn to track changes on a CVS vendor
[external/binutils.git] / include / ranlib.h
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
33 /* Format of __.SYMDEF:
34    First, a longword containing the size of the 'symdef' data that follows.
35    Second, zero or more 'symdef' structures.
36    Third, a longword containing the length of symbol name strings.
37    Fourth, zero or more symbol name strings (each followed by a null).  */
38
39 struct symdef
40   {
41     union
42       {
43         unsigned long string_offset;    /* In the file */
44         char *name;                     /* In memory, sometimes */
45       } s;
46     unsigned long file_offset;
47   };
48
49 /* Compatability with BSD code */
50
51 #define ranlib  symdef
52 #define ran_un  s
53 #define ran_str string_offset
54 #define ran_name name
55 #define ran_off file_offset