aboutsummaryrefslogtreecommitdiff
path: root/gcc/asan.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-12-11 13:06:07 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-12-11 13:06:07 +0100
commita8a6fd74c4ed085c47a69842e77d55aa817a919a (patch)
tree491a5fed91156bbc060b9acbd315e3c8d7a79b70 /gcc/asan.c
parentc699deeb3ea44bbc646dc0ec3186160cd126386b (diff)
downloadgcc-a8a6fd74c4ed085c47a69842e77d55aa817a919a.zip
gcc-a8a6fd74c4ed085c47a69842e77d55aa817a919a.tar.gz
gcc-a8a6fd74c4ed085c47a69842e77d55aa817a919a.tar.bz2
varasm.c (get_variable_section): Don't return lcomm_section for asan_protect_global decls.
* varasm.c (get_variable_section): Don't return lcomm_section for asan_protect_global decls. * asan.c (asan_protect_global): Only avoid public common variables. Don't call get_variable_section here. From-SVN: r194393
Diffstat (limited to 'gcc/asan.c')
-rw-r--r--gcc/asan.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/asan.c b/gcc/asan.c
index 87d08d5..45b0dbd 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -447,7 +447,6 @@ bool
asan_protect_global (tree decl)
{
rtx rtl, symbol;
- section *sect;
if (TREE_CODE (decl) == STRING_CST)
{
@@ -471,7 +470,7 @@ asan_protect_global (tree decl)
padding or not. */
|| DECL_ONE_ONLY (decl)
/* Similarly for common vars. People can use -fno-common. */
- || DECL_COMMON (decl)
+ || (DECL_COMMON (decl) && TREE_PUBLIC (decl))
/* Don't protect if using user section, often vars placed
into user section from multiple TUs are then assumed
to be an array of such vars, putting padding in there
@@ -493,10 +492,6 @@ asan_protect_global (tree decl)
|| TREE_CONSTANT_POOL_ADDRESS_P (symbol))
return false;
- sect = get_variable_section (decl, false);
- if (sect->common.flags & SECTION_COMMON)
- return false;
-
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
return false;