eld Manual

Table Of Contents
TNS/E Native Object Files
eld Manual527255-009
A-28
Archives
Here is the declaration for the ar_hdr structure:
typedef struct ar_hdr {
char ar_name [16];
char ar_date [12];
char ar_uid [6];
char ar_gid [6];
char ar_mode [8];
char ar_size [10];
char ar_fmag [2];
} ar_hdr;
The size of this structure is 60 bytes.
The ar_size field tells the size of the contents of this piece of the archive, and the
ar_name field tells its name. When the name is less than 16 characters long, the rest
of the field is filled with blanks. The other fields of the ar_hdr are all readable ASCII
character fields.
In the ar_hdr for the symbol table piece, the ar_name is a single slash ("/").
The contents of the symbol table piece are the following (in this order):
a four-byte integer that tells the number of symbols in the symbol table piece
an array of four-byte integers
a string space (see below)
The integers mentioned above are binary integers (big endian).
The string space is a concatenation of strings, telling the names of the symbols in the
symbol table piece. Each name is terminated by a zero byte. If the total size is odd,
an extra zero byte at the end makes it even. These strings are in the same order as
the previous array of four-byte integers. For each name, the corresponding four-byte
integer tells the file offset within the archive for the ar_hdr of the member that defines
that symbol. Symbols are only listed in the symbol table if they are defined
somewhere. A symbol may be defined in more than one member, but the symbol table
only points at one place.
In the ar_hdr for the long member name string space, the ar_name is two slashes ("//").
The long member name string space is a concatenation of strings, telling the names of
the members whose names are longer than 16 bytes. Each name is terminated by a
slash ("/") and a newline character. If the total size is odd, an extra newline character
at the end makes it even.
In the ar_hdr for an archive member, the ar_name tells the name of the file that was
placed into the archive. If the name is longer than 16 bytes then it is stored instead in
the long member name string space and the ar_name field for the member consists of
a slash ("/") followed by an ASCII string for the integer value that is the byte offset of
the member's name in the long member name string space. Leading zeroes are
removed from this string, and it is blank filled on the right.