]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-visibility.c (varpool_node::externally_visible_p): Do not privatize dynamic TLS...
authorJan Hubicka <hubicka@ucw.cz>
Sat, 20 Sep 2014 03:11:04 +0000 (05:11 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 20 Sep 2014 03:11:04 +0000 (03:11 +0000)
* ipa-visibility.c (varpool_node::externally_visible_p): Do not
privatize dynamic TLS variables.

From-SVN: r215417

gcc/ChangeLog
gcc/ipa-visibility.c

index 4c03408368fea24e4e53b41f2a0e0a10de90e747..87907fdd6fdf30a5c454fd12c444fa1915b4ca9b 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-19  Jan Hubicka  <hubicka@ucw.cz>
+
+       * ipa-visibility.c (varpool_node::externally_visible_p): Do not
+       privatize dynamic TLS variables.
+
 2014-09-19  Jan Hubicka  <hubicka@ucw.cz>
 
        * diagnostic.c (warning_n): New function.
index 32199af252f00a79201d34cb09f37d129f2279b2..ea6052f8861f10781b2dbdd8140d6403468c2e05 100644 (file)
@@ -277,6 +277,13 @@ varpool_node::externally_visible_p (void)
   if (used_from_object_file_p ())
     return true;
 
+  /* Bringing TLS variables local may cause dynamic linker failures
+     on limits of static TLS vars.  */
+  if (DECL_THREAD_LOCAL_P (decl)
+      && (DECL_TLS_MODEL (decl) != TLS_MODEL_EMULATED
+         && DECL_TLS_MODEL (decl) != TLS_MODEL_INITIAL_EXEC))
+    return true;
+
   if (DECL_HARD_REGISTER (decl))
     return true;
   if (DECL_PRESERVE_P (decl))