This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SunOS shared libs ?
- To: "Munagala V. S. Ramanath" <ram at netcom dot com>
- Subject: Re: SunOS shared libs ?
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 08 Jul 1998 23:10:57 -0600
- cc: Manfred dot Hollstein at ks dot sel dot alcatel dot de, manfred at s-direktnet dot de, egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199806101546.IAA05334@netcom13.netcom.com>you write:
> write_c_file - output name is ../../../lib/libtype1.so, prefix is libtype1_
> so
> static int count;
> typedef void entry_pt();
> void _GLOBAL__FI_libtype1_so() {
> ++count;
> }
Here's the reason why you still need the -fPIC option when building
a shared library out of just pure C code. The reference to "count"
must be PIC. I don't know why we need to increment that counter.
Someone familiar with C++ and collect2 would have to comment.
jeff