[comp.os.msdos.programmer] .LIB format

weiss@theory.lcs.mit.edu (Paul G. Weiss) (01/09/91)

I just received the Microsoft C Developers Toolkit and the good news is
that the Reference finally documents the .LIB format.  The bad news is that
the documentation is poor and incomplete.

For example, the documentation describes the hash table in each dictionary
block and states that symbols are hashed to find which block to place it in
and which bucket within that block.  Collisions are resolved by means of 
linear open addressing.  This means that for each symbol you must be able to
calculate:
	a block hash value
	a bucket hash value
	a block delta
	a bucket delta
Unfortunately the documentation does not specify how these hash functions
are computed.  Does anyone have this information.  It is most annoying not
to find it in the format specification.

Also, they document the extended dictionary but again the documentation is
quite poor.  The extended dictionary is used to store intermodule dependencies.
Each module has a list of modules that it depends on.  There is a module table
which contains (supposedly) for each module:  its location in the library and
a list of other modules that it depends on.  The list is given as an offset
from the beginning of the extended dictionary and is null-terminated.  However
when I dumped out a few libraries to take a look, I found that the offsets
given and the beginning of list differed by 9 bytes?!  Does anyone know what
is going on here?