summaryrefslogtreecommitdiff
path: root/gcc/target.h
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-27 15:35:19 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-27 15:35:19 +0000
commit38475469c32d0b66a793399839b363109aea3cc2 (patch)
tree2fa1779872e1658a836ad7c6225a1303bfacea23 /gcc/target.h
parent7b86c9bc5150f65f8ae3ae018a38f3f800aa25a3 (diff)
downloadgcc-38475469c32d0b66a793399839b363109aea3cc2.tar.gz
* targhooks.h (default_emutls_var_fields,
default_emutls_var_init): Declare. * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL. * target.h (struct gcc_target): Add struct emutls member. * target-def.h (TARGET_EMUTLS_GET_ADDRESS, TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION, TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX, TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS, TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS, TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New. (TARGET_INITIALIZER): Add TARGET_EMUTLS. * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS, BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure. * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can emit debug information. * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL. * varasm.c: Include targhooks.h. (emutls_object_section, emutls_tmpl_section): New. (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove. (EMUTLS_SEPARATOR): New. (prefix_name): New. (get_emutls_object_name): New. (default_emutls_var_fields): New, broken out of ... (get_emutls_object_type): ... here. Adjust to use target hooks. (get_emutls_init_templ_addr): Adjust to use target hooks. (emutls_decl): Adjust to use target hooks. (emutls_finish): Likewise. (default_emutls_var_init): New, broken out of ... (assemble_variable): ... here. Adjust to use target hooks. * output.h (enum section_category): Add SECCAT_EMUTLS_VAR, SECCAT_EMUTLS_TMPL. * c-common.c (handle_section_attribute): Prevent overriding sections for emulated tls with special sections. * config/i386/i386.c (x86_64_elf_select_section): Add SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL. (x86_64_elf_unique_section): Likewise. * config/vxworks.c: Include tree.h. (vxworks_emutls_var_fields, vxworks_emutls_var_init): New. (vxworks_override_options): Set TLS scheme. * gcc/doc/tm.texi (Emulated TLS): New node. gcc/testsuite/ * gcc.dg/tls/section-2.c: New. * gcc.dg/tls/emutls-1.c: New. * lib/target-supports.exp (check_effective_target_tls_native): Exclude vxworks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134729 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/target.h')
-rw-r--r--gcc/target.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/target.h b/gcc/target.h
index 128a0292a15..c331020b6ab 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -917,6 +917,34 @@ struct gcc_target
void (*adjust_class_at_definition) (tree type);
} cxx;
+ /* Functions and data for emulated TLS support. */
+ struct emutls {
+ /* Name of the address and common functions. */
+ const char *get_address;
+ const char *register_common;
+
+ /* Prefixes for proxy variable and template. */
+ const char *var_section;
+ const char *tmpl_section;
+
+ /* Prefixes for proxy variable and template. */
+ const char *var_prefix;
+ const char *tmpl_prefix;
+
+ /* Function to generate field definitions of the proxy variable. */
+ tree (*var_fields) (tree, tree *);
+
+ /* Function to initialize a proxy variable. */
+ tree (*var_init) (tree, tree, tree);
+
+ /* Whether we are allowed to alter the usual alignment of the
+ proxy variable. */
+ bool var_align_fixed;
+
+ /* Whether we can emit debug information for TLS vars. */
+ bool debug_form_tls_address;
+ } emutls;
+
/* For targets that need to mark extra registers as live on entry to
the function, they should define this target hook and set their
bits in the bitmap passed in. */