------- Comment #19 from hjl dot tools at gmail dot com 2009-09-15 17:41 ------- Index: varasm.c =================================================================== --- varasm.c (revision 151703) +++ varasm.c (working copy) @@ -6420,6 +6420,8 @@ default_encode_section_info (tree decl, rtx rtl, i if (targetm.have_tls && TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)) flags |= DECL_TLS_MODEL (decl) << SYMBOL_FLAG_TLS_SHIFT; + else if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)) + flags |= TLS_MODEL_EMULATED << SYMBOL_FLAG_TLS_SHIFT; else if (targetm.in_small_data_p (decl)) flags |= SYMBOL_FLAG_SMALL; /* ??? Why is DECL_EXTERNAL ever set for non-PUBLIC names? Without
Can't you do if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)) { if (targetm.have_tls) else } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41357