This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Constructor called twice on global objects
- To: binutils at sourceware dot cygnus dot com
- Subject: Constructor called twice on global objects
- From: Barry Haddow <bhaddow at orbism dot com>
- Date: Mon, 27 Sep 1999 15:55:55 +0100
- Organization: Orbism
- Reply-To: bhaddow at orbism dot com
RedHat Linux 6.0 (kernel 2.2.10)
ld version 2.91
egcs version 2.95.1
Hi
I have the same global object in two different source files. One source
file is compiled and linked into a shared
object and the other is compiled and linked into the executable, the
executable being linked with the
shared object. I find that only one instance of the global object is
created, but its constructor and destructor are called twice.
Surely this can't be correct? - I don't observer this behaviour on other
UNIX platforms.
I have attached a simple testcase which illustrates the problem.
thanks
Barry
double.tar.gz