public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/44139]  New: Exporting emutls symbols from a DLL broken on w32 targets
@ 2010-05-14 14:23 dougsemler at gmail dot com
  2010-05-15  9:06 ` [Bug target/44139] " davek at gcc dot gnu dot org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: dougsemler at gmail dot com @ 2010-05-14 14:23 UTC (permalink / raw)
  To: gcc-bugs

Windows targets that use emutls add a "." character as a separator from the
_emutls_{t,v} and the true symbol name.  However, exporting these symbol names
from a DLL is problematic (i.e. a thread local data variable), because the "."
in the symbol name tells the Windows loader to treat the symbol as a forwarding
RVA to a second DLL (in this case, it will look for the symbol "varname" in
__emutls_v.dll, the symbol exported is __emutls_v.varname).  Note that this is
a runtime issue, not a compile/link issue.

This can be worked around by

#define TARGET_EMUTLS_VAR_PREFIX "__emutls_v_"
#define TARGET_EMUTLS_TMPL_PREFIX "__emutls_t_"

in the config header (e.g. config/i386/cygming.h or config/i386/mingw-w64.h,
etc).

However, this breaks backward compatibility with object files that were built
with previous versions of the compiler (e.g libold.a would have a global name
of __emutls_v.varname, while the patch would cause gcc to look for
__emutls_v_varname, which would cause linker errors).


-- 
           Summary: Exporting emutls symbols from a DLL broken on w32
                    targets
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dougsemler at gmail dot com
GCC target triplet: i686-pc-mingw32 x86_64-*-mingw32 i686-pc-cygwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44139


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2010-05-21 11:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-14 14:23 [Bug target/44139] New: Exporting emutls symbols from a DLL broken on w32 targets dougsemler at gmail dot com
2010-05-15  9:06 ` [Bug target/44139] " davek at gcc dot gnu dot org
2010-05-15  9:34 ` davek at gcc dot gnu dot org
2010-05-15  9:37 ` davek at gcc dot gnu dot org
2010-05-15  9:38 ` davek at gcc dot gnu dot org
2010-05-15  9:38 ` davek at gcc dot gnu dot org
2010-05-15  9:38 ` davek at gcc dot gnu dot org
2010-05-15  9:45 ` davek at gcc dot gnu dot org
2010-05-15 13:03 ` dougsemler at gmail dot com
2010-05-15 13:48 ` davek at gcc dot gnu dot org
2010-05-17 18:26 ` davek at gcc dot gnu dot org
2010-05-17 18:26 ` davek at gcc dot gnu dot org
2010-05-18 14:22 ` ktietz at gcc dot gnu dot org
2010-05-18 14:29 ` davek at gcc dot gnu dot org
2010-05-18 14:33 ` davek at gcc dot gnu dot org
2010-05-18 15:18 ` ktietz at gcc dot gnu dot org
2010-05-18 15:26 ` davek at gcc dot gnu dot org
2010-05-18 16:28 ` dominiq at lps dot ens dot fr
2010-05-18 22:43 ` dannysmith at users dot sourceforge dot net
2010-05-19  9:15 ` ktietz at gcc dot gnu dot org
2010-05-19 15:41 ` dje at gcc dot gnu dot org
2010-05-19 16:18 ` ktietz at gcc dot gnu dot org
2010-05-20 17:52 ` dje at gcc dot gnu dot org
2010-05-21 11:28 ` ktietz at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).