This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc question : pic or non-pic objects stored inside a static archive (not a spam)
- From: John Love-Jensen <eljay at adobe dot com>
- To: plumber Idraulico <plumber at gnu-darwin dot org>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 28 Nov 2005 06:40:13 -0600
- Subject: Re: gcc question : pic or non-pic objects stored inside a static archive (not a spam)
Hi Plum,
> 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
choose.
HTH,
--Eljay