What is the Object librarian

When the compiler compiles a program or module, it produces eitheran object file or an object library, depending on the compiler option settings.  Assemblersand other compilers also produce object modules.

The object module contains the machine language instructionsand the data definitions that result from compilation.

An object library is a collection of object modules in a singlefile, in a format that allows the linker to selectively extract those modules thatare needed when linking a program.

Object Libraries

The Stony Brook Object Librarian supports object libraries identicalin format to those supported by the Microsoft LIB utility and the UNIX archive utility.Object libraries have a default file extension of .LIB.

OMF Object Libraries

An OMF object library contains:

The index is a hash table containing the names of all publicsymbols in all modules in the library.  Each public symbol contains a pointerto the object module that defines it.

The object modules in a library are all aligned on a specificbyte boundary, which is determined by the library header.  The size of thisboundary also determines the maximum size of the library.

The only option you have to consider when creating a libraryis to specify this boundary, and thus determine the limit on the library size.  sblibsupports creation of libraries with maximum sizes of 1, 2, 4, and 8 megabytes.

UNIX Object Libraries (Archives)

A UNIX object library contains:

The magic string is simply a string designating this file asa UNIX archive.

The symbol list is a record containing the number of symbolsin the library, their names, and file offsets of the symbols respective COFF or ELFobject modules.

What the Librarian Does

You can use the object librarian, sblib, to manipulate objectlibraries.  sblib can perform the following functions:

You use sblib in two ways:

  1. From the environment, you can create an object library from all of the modules in a Project.
  2. From a command prompt, you can use all of the object librarian features.