On Mon, Jun 25, 2007 at 10:15:55AM -0400, Mark Mitchell wrote: > Daniel Jacobowitz wrote: > > >> I think the DECL_EXTERNAL case should go before the visibility checks in > >> default_binds_local_p_1. A DECL_EXTERNAL entity never binds locally. > > > > That isn't the meaning that most callers of this function want, > > however. They want same shared object, which is what it currently > > returns; that's what I think of when you ask me if something binds > > "locally", too... > > I dunno about "most", but at least some want to know "can this > definition be replaced by another one". For example, DECL_REPLACEABLE_P > and cgraph_variable_initializer_availability (which quite probably > should be using DECL_REPLACEABLE_P).
For replacability the current definition is just fine. Weak functions must be assumed to be always replaceable and non-weak functions which are known to bind within the same executable resp. shared library are not replaceable - linker will issue error if two non-weak symbols with the same name are linked into the same executable resp. shared library and when linking a non-weak symbol and weak symbol the non-weak one will win. Jakub