From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18811 invoked by alias); 26 Jan 2010 10:29:58 -0000 Received: (qmail 18725 invoked by uid 48); 26 Jan 2010 10:29:35 -0000 Date: Tue, 26 Jan 2010 10:29:00 -0000 Subject: [Bug c++/42870] New: [4.5 regression] __attribute__ ((dllexport)) produces broken linkage X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jojelino at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg02937.txt.bz2 testcase test.cpp #ifdef FOOBAR #define ATTRIBUTE __attribute__ ((dllexport)) #else #define ATTRIBUTE __attribute__ ((visibility ("default"))) #endif class ATTRIBUTE Sa { public: Sa() {} ~Sa(); }; ATTRIBUTE Sa::~Sa() {return;} bool DllMain(void *a,void*b,int) { Sa s; return true; } -- test2.cpp class __attribute__((dllimport)) Sa { public: Sa() {} __attribute__((dllimport)) ~Sa(); }; Sa a; bool DllMain(void *a,void*b,int) { Sa s; return true; } the following are directives that gcc emit when given attribute is __attribute__ ((dllexport)) surely it must emit _ZN2SaD1Ev symbol or linker cannot find this symbol. .section .drectve .ascii " -export:_ZN2SaD2Ev" .ascii " -export:_ZN2SaC1Ev" .ascii " -export:_ZN2SaC2Ev" for now i workaround this using __attribute__ ((visibility ("default"))) -- Summary: [4.5 regression] __attribute__ ((dllexport)) produces broken linkage Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jojelino at gmail dot com GCC build triplet: i686-pc-cygwin GCC host triplet: i686-pc-cygwin GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42870