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] Section anchors and thread-local storage


I have been working to enable native thread-local storage on AIX. One
problem I encountered is the AIX assembler has difficulty with the
anchor symbol for TLS CSECTs.  While the section anchors machinery
uses a separate pool for TLS entries, should section anchor blocks be
used for TLS symbols at all?

powerpc-linux uses GOT annotations directly and never places TLS
symbols in the TOC at all. Section anchors seem to be avoided by TLS
code already.  The appended patch rejects TLS symbols for object
blocks in general. I could add a target hook, but I wanted to propose
this policy in general before pursing a target-specific hook.

Thanks, David

        * varasm.c: (use_blocks_for_decl_p): Do not place thread-local symbols
        refs in object blocks.

Index: varasm.c
===================================================================
--- varasm.c    (revision 193785)
+++ varasm.c    (working copy)
@@ -1108,6 +1108,10 @@
   if (DECL_INITIAL (decl) == decl)
     return false;

+  /* Do not place thread-local symbols refs in the object blocks.  */
+  if (DECL_TLS_MODEL (decl) != 0)
+    return false;
+
   /* If this decl is an alias, then we don't want to emit a
      definition.  */
   if (lookup_attribute ("alias", DECL_ATTRIBUTES (decl)))


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