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: multiple definitions of 'xxx keyed to...' in egcs-1.1.1


>>>>> "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>:

> For ELF targets, do you really think this is a widely-used approach?
> I'd rather think you'd typically use -ldl and dlopen, which means
> that you have to produce a shared library first. If you do that,
> libdl will call the constructors even though it doesn't have a
> symbol name.

That's what I did and that's where my application croaked.  I
implemented singleton subclasses of an abstract class, and put a
static instance of each class in the compilation unit it was defined
in.

When the .so is loaded the constructor of the singleton is run, and it 
registers itself.

My application croaked on the static instances.  It didn't want more
than one of those in each executable or .so.

For a minimal test case, please see:
	http://egcs.cygnus.com/ml/egcs-bugs/1999-02/msg00469.html



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