This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SunOS shared libs ?


On Wed, 10 June 1998, 07:35:59, ram@netcom.com wrote:

 > > You need to add "-fPIC" to the linker command line  as well. If any of
 > > your  *.o files  contain  static CTOR/DTORs, a   small .c file will be
 > > generated by the  collect2 program which  in turn will be compiled and
 > > linked into  your shared lib.  Since you  didn't specify "-fPIC"  when
 > > linking, bloody  StunOS ld starts complaining...  Of course, using GNU
 > > ld (e.g. from  binutils-2.9.1) would cure  this; the current  mainline
 > > sources (the  snapshots)  address  this   differently, i.e.  you   can
 > > continue using SunOS ld.
 > 
 >     Ok, thanks that seems to have fixed the problem. I'd strongly
 >     suggest adding this to the FAQ.

Jeff Law, do you think it's worthwhile?

 > 
 >     I still don't understand a couple of items:
 >     -- My files are all C (no C++) so there is CTOR/DTOR issue at all;
 >        how come I still need the -fPIC linker option ?
 >     -- How come I did not need -fPIC linker option with gcc-2.7.2 ?

Looks like your pulling in some C++ related stuff, e.g. via libgcc.a?

Try adding `-Wl,-debug' to your linker command; it'll tell you lots of
information about which CTOR/DTORs have been found and the like.

 > 
 >     Anyway, thanks for the help.
 > 
 >     Ram

manfred


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]