aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index d110b32..5858523 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5476,6 +5476,13 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
*node);
*no_add_attrs = true;
}
+ else if (TREE_CODE (decl) == VAR_DECL
+ && !targetm.have_tls && targetm.emutls.tmpl_section
+ && DECL_THREAD_LOCAL_P (decl))
+ {
+ error ("section of %q+D cannot be overridden", *node);
+ *no_add_attrs = true;
+ }
else
DECL_SECTION_NAME (decl) = TREE_VALUE (args);
}