summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-03-19 23:26:00 -0400
committermidipix <writeonce@midipix.org>2015-03-19 23:26:00 -0400
commit5621b0947f362f74f04dabeb3ac09969ec9d1ded (patch)
tree52ca0ffbbc727773cefa5375d18f81e9b8784a93
parent71f7603808e3e9e704b393480c60b29a5ed40eb6 (diff)
downloadcbb-gcc-4.6.4-5621b0947f362f74f04dabeb3ac09969ec9d1ded.tar.bz2
cbb-gcc-4.6.4-5621b0947f362f74f04dabeb3ac09969ec9d1ded.tar.xz
emutls:
+ add support for platform-provided __emutls_get_address(); + add support for .emutlsv and .emutlst as named sections storing tls variable definitions and default values, respectively. According to the documentation, this could have also been achieved by assigning a value to TARGET_EMUTLS_VAR_SECTION; doing so, however, resulted in a compiler crash, so for now we are using a designated conditional macro instead. signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information.
-rw-r--r--gcc/emutls.c4
-rw-r--r--gcc/tree-emutls.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/emutls.c b/gcc/emutls.c
index fcf6eb56f..92a3deae7 100644
--- a/gcc/emutls.c
+++ b/gcc/emutls.c
@@ -29,6 +29,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "tm.h"
#include "gthr.h"
+#ifndef EMUTLS_PROVIDED_BY_PLATFORM
+
typedef unsigned int word __attribute__((mode(word)));
typedef unsigned int pointer __attribute__((mode(pointer)));
@@ -203,3 +205,5 @@ __emutls_register_common (struct __emutls_object *obj,
if (templ && size == obj->size)
obj->templ = templ;
}
+
+#endif /* EMUTLS_PROVIDED_BY_PLATFORM */
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index 899888dfb..7bade9f49 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -257,6 +257,10 @@ get_emutls_init_templ_addr (tree decl)
targetm.emutls.tmpl_section);
}
+ #ifdef TARGET_EMUTLS_VAR_SECTION_EMUTLS
+ DECL_SECTION_NAME (to) = build_string(strlen(".emutlst"),".emutlst");
+ #endif
+
/* Create varpool node for the new variable and finalize it if it is
not external one. */
if (DECL_EXTERNAL (to))
@@ -316,6 +320,10 @@ new_emutls_decl (tree decl)
targetm.emutls.tmpl_section);
}
+ #ifdef TARGET_EMUTLS_VAR_SECTION_EMUTLS
+ DECL_SECTION_NAME (to) = build_string(strlen(".emutlsv"),".emutlsv");
+ #endif
+
/* If this variable is defined locally, then we need to initialize the
control structure with size and alignment information. Initialization
of COMMON block variables happens elsewhere via a constructor. */