"Rafael Espindola" <[EMAIL PROTECTED]> writes: > Interesting. The use of lto_codegen_add_must_preserve_symbol is kind > of the opposite of what I had understood. What do you do in this case: > > a.o: IL file that contains a reference to "f" > b.o: IL file that has a weak def of "f" > > There is no strong definition. Can you inline f into the use in a.o?
I don't know what LLVM does, but in principle, in ELF, you can do this inlining when linking an executable, but not when linking a shared library. Actually, when linking a shared library, what matters is not whether the definition of "f" is weak or not, but what the visibility of 'f" is (default, hidden, protected, or internal). And, of course, the visibility of "f" can be set by link-time options (e.g., -Bsymbolic). Ian