This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Main in Lib
- From: John Love-Jensen <eljay at adobe dot com>
- To: Bharathi S <bharathi at lantana dot tenet dot res dot in>, GNU GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 21 Apr 2003 11:39:37 -0500
- Subject: Re: Main in Lib
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