11.1 Organization of Libraries

Libraries and import libraries have identical formats but typically differ in content. Each library consists of one or more 512-byte blocks and has the following general form:

A LibraryHeader record

One or more object modules

A Marker record

A dictionary containing a prime number of DictionaryBlock structures

The first record in the library, the LibraryHeader record, marks the beginning of the library and contains information that specifies the page size of the library and the location of the dictionary.

Immediately following the LibraryHeader record are one or more object modules. Each module, in Microsoft object-module format (OMF), starts with a THEADR record containing the module name and ends with a MODEND record. Each module is also aligned on a page boundary. If an object module is not an exact multiple of the library's page size, it is padded with null bytes.

A Marker record follows the last object module in the library. This record marks the end of the object modules and the start of the dictionary.

The remaining blocks in the library make up the dictionary, which contains entries that specify the locations of public symbols defined in the object modules for the library. The number of blocks in the dictionary is given in the LibraryHeader record.