rimez wrote:
>
> Does anyone know where I can find info on making statically linked binaries?
> thanks,
> rimez
> --
> To get out of this list, please send email to [EMAIL PROTECTED] with
> this text in its body: unsubscribe suse-linux-e
> Check out the SuSE-FAQ at http://www.suse.com/Support/Doku/FAQ/ and the
> archive at http://www.suse.com/Mailinglists/suse-linux-e/index.html
Static libraries are simply collections of object files (*.o) arranged
by the ar (archiver) utility. ar collects object files into one archive
file and adds a table that tells which object files in the archive
define what symbols. The linker, ld, then binds references to a symbol
in one object file to the definition of that symbol in an object file in
the archive. Static libraries use the suffix (*.a). You can convert a
group of object files into a state library with a command like:
ar rcs libname.a foo.o bar1.0 bar2.o
You can also ad one object file at a time to an existing archive:
ar rcs libname.a foo.o
ar rcs libname.a bar1.o
ar rcs libname.a bar2.o
In either case, libname.a will be the same. The options used here are:
r replace any object files the library that have the same name
c silently create library if it does not exist
s maintain the table mapping symbol names to object file names.
ar has other options and the man pages describe them. The command,
ranlib, generates an index for the library, which enables the linker to
find the routines within the library. Read its man pages on it also.
If you want to see which functions are included in an object file,
library or executable file use the nm command. You can see which shared
libraries are required by a program by running the utility ldd.
--
JLK
Linux, because it's STABLE, the source code is included, the price is
right.
--
To get out of this list, please send email to [EMAIL PROTECTED] with
this text in its body: unsubscribe suse-linux-e
Check out the SuSE-FAQ at http://www.suse.com/Support/Doku/FAQ/ and the
archive at http://www.suse.com/Mailinglists/suse-linux-e/index.html