I've been thinking a little more about this since making my comment
regarding weak symbols in
http://sourceware.org/bugzilla/show_bug.cgi?id=11175#c2 (late at night and I hadn't read the visibility section of the abi
properly..)
If you accept that visibility on a reference is useful then clearly
the linker must merge visibility on all references with visibility on
the defining symbol. It's not immediately clear that visibility on a
weak defining symbol must also be merged, but I think that follows
too.
Consider: a) If a compiler sees a declaration with visibility
attributes it may emit code using that declaration before seeing a
later definition. This means that definitions in an object file need
to be treated exactly the same as references regarding merging of
visibility. Treating them differently would require that the
assembler emit two symbols with the same name, one for references and
one for definitions. I suppose that would be possible, but isn't the
way current assemblers work.
b) If it is legal for the compiler to merge a declaration with a
visibility attribute with a later declaration with a weak attribute,
then weak and strong references must also be treated the same.
(a) and (b) combined lead to the requirement that visibility should be
merged from a weak definition to a strong definition.