[cfe-commits] r124089 - in /cfe/trunk: lib/CodeGen/CGRTTI.cpp lib/CodeGen/CodeGenModule.cpp test/CodeGenCXX/exceptions-no-rtti.cpp test/CodeGenCXX/key-function-vtable.cpp test/CodeGenCXX/mangle-subst-std.cpp test/CodeGenCXX/rtti-linkage.cpp test/Co...

John McCall rjmccall at apple.com
Mon Jan 24 15:24:39 PST 2011


On Jan 24, 2011, at 1:30 PM, Renato Golin wrote:
> On 24/01/11 17:33, Douglas Gregor wrote:
>> That depends on the linker. With the Mac OS 10.6 dynamic linker, for
>> example, a strong external symbol in one shared library will not get
>> merged with same-named weak symbols in another shared library.
> 
> Oh! I see...
> 
> So what do you do? Mangle them differently? Or just make sure that
> nothing in one object access the symbols in the other objects?

I believe the dynamic linker just assumes it never happens, and you get
undefined behavior if it does.  There really isn't much point in having a
strong external symbol if everyone involved gives it weak semantics
anyway.

John.



More information about the cfe-commits mailing list