gcc question : pic or non-pic objects stored inside a static archive (not a spam)
Wed Nov 30 19:13:00 GMT 2005
> 1 - is there an importance that stored objects have been built with
> the pic or non-pic option ?
If you need PIC (position independent code), then the answer is yes: it is
important that you build your objects with PIC.
If you do not need PIC, then the answer is yes: it is important that you
build your objects non-PIC.
> 2 - is it normal that the lib archive has a bigger size than the
> shared archive ( +15% ) ?
Library archives (.a) are a container storage format. Think of them as akin
to a .zip (albeit without compression).
Shared objects (.so) are a binary executable format, used as SSO or DSO.
They are different animals with different purposes.
> 3 - is there an importance that stored objects have been built with
> the pic option in a library archive ?
Yes. If you need PIC, then it is important that you build with PIC. If you
do not need PIC, then it is important that you do not build with PIC.
> 4 - if question 3 why the default format is not pic.o ( in shared
> and static lib ? libtool compatibility with gcc < 4 ) ?
You can designate the output format with a .pic.o extension, if you so
More information about the Gcc-help