enoft Manual

TNS/E Native Object Files
eNOFT Manual527507-005
A-18
Archives
.debug_relocs
This section describes the places in DWARF sections of DLL's that contain code and
data addresses, so that they can be updated by the -alf option of the linker when that
option is used to rebase the DLL.
Archives
An archive is a single file that contains within it copies of other files, called the
"members" of the archive. Archives are created by the tool named ar. An archive may
be used for various purposes, one of which is to be an input for the linker. The linker
uses archives as a source of linkfiles. Archives are not used at load time.
The format described here, used for TNS/E archives differs in various ways from what
was used in the TNS/R implementation.
An archive contains "symbol table" information that tells which linkfile within the
archive, if any, provides a definition for a given symbol. These would be the symbols
defined in that linkfile and visible outside, that is, their binding is STB_GLOBAL and
their st_scndx field is not SHN_UNDEF in the ELF symbol table.
The first eight bytes of an archive contain the string "!<arch>", followed by a newline
character (ASCII LF). This identifies the file as an archive. After that the archive is a
concatenation of "pieces", each of which contains the following items, which always
begin at file offsets that are multiples of 2 bytes.
an ar_hdr structure
the contents of this piece
The first one or two pieces of the archive may be special. The first special piece is the
archive symbol table, which is present if the archive contains any linkfiles. The other
special piece is the "long member name string space", which is present if any of the
names of the members of the archive are longer than 16 characters. The contents of
the remaining pieces are the members of the archive.
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