Main in Lib

John Love-Jensen eljay@adobe.com
Mon Apr 21 16:40:00 GMT 2003


Hi Bharathi,

libfoo.so is a shared object library.  Shared object libraries are linked in
at runtime.  libfoo.so must be resolvable by the running program.  Shared
object libraries can be either "hard linked" as static shared objects (SSO),
or as dynamic shared objects (DSO).  A DSO uses the dlopen command to
explicitly open and refer to the resources of the shared object library.

libfoo.a is an archive library.  Archive libraries are linked in at link
time, instead of being deferred until runtime.  Linking against an archive
library makes the application larger, on disk.  Either kind of library is
about the same size in memory, although shared object libraries can
(possibly) be shared across multiple applications using the same library,
reducing overall physical memory footprints.

The 'nm' command and the 'objdump' can display information about shared
object libraries.

The 'ar' command can display information about archive libraries.

Sincerely,
--Eljay




More information about the Gcc-help mailing list