This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch]: PR/44139 Exporting emutls symbols from a DLL broken on w32 targets


Hello,

This patch handles dllimport/dllexport semantics for TLS variables.

ChangeLog

      PR/44139
      * varasm.c (emutls_decl): Merge attributes to new decl.

Patch tested for i686-pc-mingw32, x86_64-pc-mingw32, and AIX (see bug-report).

Ok for apply to trunk and 4.5 branch?

Regards,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

Index: gcc/gcc/varasm.c
===================================================================
--- gcc.orig/gcc/varasm.c       2010-05-18 13:19:20.000000000 +0200
+++ gcc/gcc/varasm.c    2010-05-18 17:10:11.385445300 +0200
@@ -403,6 +403,8 @@ emutls_decl (tree decl)
        int foo() { return i; }
        __thread int i = 1;
      in which I goes from external to locally defined and initialized.  */
+  DECL_DLLIMPORT_P (to) = DECL_DLLIMPORT_P (decl);
+  DECL_ATTRIBUTES (to) = targetm.merge_decl_attributes (decl, to);

   TREE_STATIC (to) = TREE_STATIC (decl);
   TREE_USED (to) = TREE_USED (decl);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]