Commit 16b340c2 by Szabolcs Nagy Committed by Szabolcs Nagy

Fix default_binds_local_p_2 for extern protected data

gcc:

	PR target/66912
	* varasm.c (default_binds_local_p_2): Turn on extern_protected_data.

gcc/testsuite:

	PR target/66912
	* gcc.target/aarch64/pr66912.c: New.
	* gcc.target/arm/pr66912.c: New.

From-SVN: r229024
parent 0d8ab59c
2015-10-20 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/66912
* varasm.c (default_binds_local_p_2): Turn on extern_protected_data.
2015-10-20 Arkadiusz Drabczyk <arkadiusz@drabczyk.org> 2015-10-20 Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
* doc/extend.texi: Update documentation WRT inline functions. * doc/extend.texi: Update documentation WRT inline functions.
2015-10-20 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/66912
* gcc.target/aarch64/pr66912.c: New.
* gcc.target/arm/pr66912.c: New.
2015-10-19 Steven G. Kargl <kargl@gcc.gnu.org> 2015-10-19 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/pr67900.f90: New tests. * gfortran.dg/pr67900.f90: New tests.
......
/* { dg-do compile { target *-*-linux* } } */
/* { dg-options "-O2 -fpic" } */
__attribute__((visibility("protected")))
int n_common;
__attribute__((weak, visibility("protected")))
int n_weak_common;
__attribute__((visibility("protected")))
int n_init = -1;
__attribute__((weak, visibility("protected")))
int n_weak_init = -1;
int
f1 ()
{
/* { dg-final { scan-assembler ":got(page_lo15)?:n_common" } } */
return n_common;
}
int
f2 ()
{
/* { dg-final { scan-assembler ":got(page_lo15)?:n_weak_common" } } */
return n_weak_common;
}
int
f3 ()
{
/* { dg-final { scan-assembler ":got(page_lo15)?:n_init" } } */
return n_init;
}
int
f4 ()
{
/* { dg-final { scan-assembler ":got(page_lo15)?:n_weak_init" } } */
return n_weak_init;
}
/* { dg-do compile { target *-*-linux* } } */
/* { dg-options "-O2 -fpic" } */
__attribute__((visibility("protected")))
int n_common;
__attribute__((weak, visibility("protected")))
int n_weak_common;
__attribute__((visibility("protected")))
int n_init = -1;
__attribute__((weak, visibility("protected")))
int n_weak_init = -1;
int
f1 ()
{
/* { dg-final { scan-assembler "\\.word\\tn_common\\(GOT\\)" } } */
return n_common;
}
int
f2 ()
{
/* { dg-final { scan-assembler "\\.word\\tn_weak_common\\(GOT\\)" } } */
return n_weak_common;
}
int
f3 ()
{
/* { dg-final { scan-assembler "\\.word\\tn_init\\(GOT\\)" } } */
return n_init;
}
int
f4 ()
{
/* { dg-final { scan-assembler "\\.word\\tn_weak_init\\(GOT\\)" } } */
return n_weak_init;
}
...@@ -6898,12 +6898,13 @@ default_binds_local_p (const_tree exp) ...@@ -6898,12 +6898,13 @@ default_binds_local_p (const_tree exp)
return default_binds_local_p_3 (exp, flag_shlib != 0, true, false, false); return default_binds_local_p_3 (exp, flag_shlib != 0, true, false, false);
} }
/* Similar to default_binds_local_p, but common symbol may be local. */ /* Similar to default_binds_local_p, but common symbol may be local and
extern protected data is non-local. */
bool bool
default_binds_local_p_2 (const_tree exp) default_binds_local_p_2 (const_tree exp)
{ {
return default_binds_local_p_3 (exp, flag_shlib != 0, true, false, return default_binds_local_p_3 (exp, flag_shlib != 0, true, true,
!flag_pic); !flag_pic);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment