summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2012-08-31 16:37:15 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2012-08-31 16:37:15 +0000
commit9cdfb5ecc2f5f951169e9107c1fc0d71139695c7 (patch)
treef20a69ffd28f2578f7ad8a5035b7795eda6b1fa6 /gnu
parentcddd383ba1a1488b3f8cb945f59c821821d57626 (diff)
Switch GCC to use __guard_local instead of __guard. This allows GCC
to emit -fstack-protector code that doesn't need GOT indirection for accessing __guard. Tested on amd64, i386, sparc64, hppa, loongson, and sgi (thanks lteo, djm, sthen, todd, naddy, kettenis, phessler, jasper, and anyone else that I'm missing who tested).
Diffstat (limited to 'gnu')
-rw-r--r--gnu/gcc/gcc/targhooks.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/gcc/gcc/targhooks.c b/gnu/gcc/gcc/targhooks.c
index 8e34127fa82..802df49b2cd 100644
--- a/gnu/gcc/gcc/targhooks.c
+++ b/gnu/gcc/gcc/targhooks.c
@@ -372,7 +372,7 @@ default_stack_protect_guard (void)
if (t == NULL)
{
- t = build_decl (VAR_DECL, get_identifier ("__guard"), ptr_type_node);
+ t = build_decl (VAR_DECL, get_identifier ("__guard_local"), ptr_type_node);
TREE_STATIC (t) = 1;
TREE_PUBLIC (t) = 1;
DECL_EXTERNAL (t) = 1;
@@ -380,6 +380,8 @@ default_stack_protect_guard (void)
TREE_THIS_VOLATILE (t) = 1;
DECL_ARTIFICIAL (t) = 1;
DECL_IGNORED_P (t) = 1;
+ DECL_VISIBILITY (t) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (t) = 1;
stack_chk_guard_decl = t;
}