aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-02-05 17:17:09 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-02-05 17:17:09 -0500
commitb2469a9bbb9c5390c8fc08dba85a41a86301d441 (patch)
treea4aea5e524eeaed258fc573ff1435860cfba78cb
parentbc23518671eb6d05ac19c4d2be738ba991ae9233 (diff)
downloadgcc-b2469a9bbb9c5390c8fc08dba85a41a86301d441.zip
gcc-b2469a9bbb9c5390c8fc08dba85a41a86301d441.tar.gz
gcc-b2469a9bbb9c5390c8fc08dba85a41a86301d441.tar.bz2
re PR c++/42870 (__attribute__ ((dllexport)) produces broken linkage)
PR c++/42870 * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Call i386_pe_maybe_record_exported_symbol. From-SVN: r156529
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/cygming.h1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ext/dllexport3.C19
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index be49d98..c970912 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/42870
+ * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Call
+ i386_pe_maybe_record_exported_symbol.
+
2010-02-05 Steve Ellcey <sje@cup.hp.com>
PR target/42924
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index ddec95a..54a61d7 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -361,6 +361,7 @@ do { \
{ \
const char *alias \
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ i386_pe_maybe_record_exported_symbol (DECL, alias, 0); \
if (TREE_CODE (DECL) == FUNCTION_DECL) \
i386_pe_declare_function_type (STREAM, alias, \
TREE_PUBLIC (DECL)); \
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fdb7495..f7a43f5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/42870
+ * g++.dg/ext/dllexport3.C: New.
+
2010-02-05 Ozkan Sezer <sezeroz@gmail.com>
* gcc.dg/format/ms-format3.c: New test for specific MS types.
diff --git a/gcc/testsuite/g++.dg/ext/dllexport3.C b/gcc/testsuite/g++.dg/ext/dllexport3.C
new file mode 100644
index 0000000..a47a5e0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport3.C
@@ -0,0 +1,19 @@
+// PR c++/42870
+// { dg-do compile { target i?86-*-cygwin *-*-mingw* } }
+// { dg-final { scan-assembler "-export:_ZN2SaD1Ev" } }
+
+#define ATTRIBUTE __attribute__ ((dllexport))
+class ATTRIBUTE Sa {
+ public:
+ Sa()
+ {}
+ ~Sa();
+};
+ATTRIBUTE Sa::~Sa()
+{return;}
+
+bool DllMain(void *a,void*b,int)
+{
+ Sa s;
+ return true;
+}