From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: "Munagala V. S. Ramanath" Cc: Manfred.Hollstein@ks.sel.alcatel.de, manfred@s-direktnet.de, egcs@cygnus.com Subject: Re: SunOS shared libs ? Date: Wed, 08 Jul 1998 22:15:00 -0000 Message-id: <14465.899961057@hurl.cygnus.com> References: <199806101546.IAA05334@netcom13.netcom.com> X-SW-Source: 1998-07/msg00337.html 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