linking question
Ian Lance Taylor
ian@airs.com
Tue Dec 21 16:22:00 GMT 2004
Karsten Fuhrmann <karsten_fuhrmann@cartoon-film.de> writes:
> I want to compile a c program with both static and dynamic linking in
> the same program, e.g. i want to link against LIB_A static but
> against LIB_B shared.
> I dicovered the static and dy options in ld but it seems to me that it
> is only possible to link at whole static or dynamic, but not mixed.
The -Bstatic and -Bdynamic linker options apply only to libraries
which follow them, so you can do:
-Bstatic LIB_A -Bdynamic LIB_B
When linking from the gcc command line, you will need to use -Wl, as
in:
-Wl,-Bstatic LIB_A -Wl,-Bdynamic LIB_B
Ian
More information about the Binutils
mailing list