From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14841 invoked by alias); 29 Jun 2003 15:58:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14833 invoked by uid 48); 29 Jun 2003 15:58:49 -0000 Date: Sun, 29 Jun 2003 15:58:00 -0000 Message-ID: <20030629155849.14832.qmail@sources.redhat.com> From: "pinskia at physics dot uc dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030609194942.11137.jcalcote@novell.com> References: <20030609194942.11137.jcalcote@novell.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/11137] [3.3 Regression] Linux shared library constructors not called unless there's one global object X-Bugzilla-Reason: CC X-SW-Source: 2003-06/txt/msg03099.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11137 ------- Additional Comments From pinskia at physics dot uc dot edu 2003-06-29 15:58 ------- I forgot to put the testcase I used: pr11137.cc: extern "C" int printf(const char*,...); void f() __attribute__((constructor)); void f() { printf("Hi\n"); } pr11137.1.cc: int main() {return 0;} gcc -shared -o pr11137.so pr11137.cc gcc pr11137.1.cc pr11137.so env LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH} ./a.out It should be print "Hi" but it does not on 3.3.1 (20030616) because gcc does not create a function which calls f() but 3.4 does.