This is the mail archive of the
mailing list for the libstdc++ project.
Re: V3 static data in classes vs AIX
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: V3 static data in classes vs AIX
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Mon, 04 Jun 2001 16:36:11 -0400
- cc: gdr at codesourcery dot com, bkoz at redhat dot com, libstdc++ at gcc dot gnu dot org
I have not had time to track down the exact lines in the headers
which create the problem and I have not had time to test the compiler with
I suspect that the library header *does* have some form of
definition. And that is exactly my point: the header has a definition
which the compiler is emitting correctly. Why should the compiler be
changed to not allocate storage for a proper definition. The problem is
that use of the header ends up generating multiple definitions.
Why is it correct for the header to produce multiple definitions?
Why isn't this a problem on systems with weak symbols? Your answer relies
on the fact that this works on systems with WEAK symbols and *NOT* on the
fact that the compiler is producing correct code.
Just because it works, does not mean that it is correct. IBM's
compiler generates a common symbol as well. It seems that GCC is behaving
correctly and V3 is relying on some special behavior to merge multiple
definitions. Does the definition of WEAK symbols specifically allow this,
or is this an issue of runtime binding of the symbols?
Both multiple common symbols and multiple weak symbols are okay.