+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>
* 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>
* gfortran.dg/pr67900.f90: New tests.
--- /dev/null
+/* { 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;
+}
--- /dev/null
+/* { 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;
+}
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
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);
}