From owner-cvs-lib Wed Apr 9 12:14:33 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA09593 for cvs-lib-outgoing; Wed, 9 Apr 1997 12:14:33 -0700 (PDT) Received: (from jdp@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA09586; Wed, 9 Apr 1997 12:14:32 -0700 (PDT) Date: Wed, 9 Apr 1997 12:14:32 -0700 (PDT) From: John Polstra Message-Id: <199704091914.MAA09586@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-lib Subject: cvs commit: src/lib/csu/i386 c++rt0.c Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk jdp 97/04/09 12:14:32 Modified: lib/csu/i386 c++rt0.c Log: Declare the constructor/destructor linker sets as extern rather than common. Add one do-nothing element to each set. This ensures that the linker realizes that they are linker sets rather than simple commons, and makes it possible to link c++rt0.o into every shared library regardless of whether it is a C++ library or not. Without this change, the constructors and destructors in the main program could be executed multiple times. This change is going to make it possible to get rid of the CPLUSPLUSLIB makefile variable once and for all. It is a piece of the solution to PR gnu/3505 (gcc -shared). Finally, it fixes a heretofore unreported bug: If CPLUSPLUSLIB was set in a makefile for a C++ shared library that had no static constructors or destructors in it, then the main program's constructors and destructors would be executed multiple times. Revision Changes Path 1.8 +24 -3 src/lib/csu/i386/c++rt0.c