------- Additional Comments From hjl at lucon dot org 2005-03-02 17:19 ------- default_binds_local_p_1 has
/* A variable is local if the user explicitly tells us so. */ else if (DECL_VISIBILITY_SPECIFIED (exp) && DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) local_p = true; /* Otherwise, variables defined outside this object may not be local. */ else if (DECL_EXTERNAL (exp)) local_p = false; /* Linkonce and weak data are never local. */ else if (DECL_ONE_ONLY (exp) || DECL_WEAK (exp)) local_p = false; /* If none of the above and visibility is not default, make local. */ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) local_p = true; If a symbol is undefined and its visibility isn't specified by the user, it won't be treated as local. So it is done on purpose. The document should be updated to reflect this. It can say something like "-fvisibility has no effect on undefined symbols." -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20274