2 +++ b/gcc/testsuite/gcc.dg/visibility-21.c
6 +/* { dg-require-visibility "" } */
7 +/* { dg-options "-fPIC" { target fpic } } */
9 +extern void f() __attribute__((weak,visibility("hidden")));
10 +extern int puts( char const* );
20 @@ -6677,6 +6677,10 @@ default_binds_local_p_1 (const_tree exp,
21 /* Static variables are always local. */
22 else if (! TREE_PUBLIC (exp))
24 + /* hidden weak can't be overridden by something non-local, all
25 + that is possible is that it is not defined at all. */
26 + else if (DECL_WEAK (exp))
28 /* A variable is local if the user has said explicitly that it will
30 else if ((DECL_VISIBILITY_SPECIFIED (exp)
31 @@ -6690,11 +6694,6 @@ default_binds_local_p_1 (const_tree exp,
33 else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
35 - /* Default visibility weak data can be overridden by a strong symbol
36 - in another module and so are not local. */
37 - else if (DECL_WEAK (exp)
38 - && !resolved_locally)
40 /* If PIC, then assume that any global name can be overridden by
41 symbols resolved from other modules. */