egcs & Dynamic Libraries
Richard Henderson
rth@cygnus.com
Thu Oct 15 21:35:00 GMT 1998
On Tue, Oct 13, 1998 at 05:07:56PM +0200, Jean-Michel Paris wrote:
> 1ð/ Should I prefer -fPIC to -fpic ? What are the differents meanings ?
-fpic assumes that a small number of dynamic symbols (for some machine-
dependant definition of small) will be required in the resulting library.
-fPIC does not. This may affect the number of instructions needed to load
a symbol's address. In the case of Sparc this is 3 insns for -fPIC and
1 for -fpic.
Generally you can use -fpic until your library grows large enough that
you get relocation overflow errors from the linker.
> 2ð/ Doing that on a little example, the library size go from 15kb
> (static .a) to 350Kb. I suppose this
> overhead is due to some dynamic resolution ?!
Configuring egcs with --enable-shared will build libstdc++ shared,
so that it does not get included in your library image.
> 3ð/ How can I write the compilation command to produce the desired
> executable.
Um, like using any other library? What are you asking?
r~
More information about the Gcc
mailing list