[llvm] r196300 - Teach the internalize pass to skip dllexported symbols because they could be
Rafael EspĂndola
rafael.espindola at gmail.com
Tue Dec 3 20:15:43 PST 2013
>> Could you please add a quick note to the LangRef.html about this?
>
> Wait, now that I think of it, why can't the liker see that it is
> needed? If the linker in putting this in a symbol table, it should be
> telling internalize to keep this symbol already.
OK, I just read
http://msdn.microsoft.com/en-us/library/3y1sfaz2.aspx
http://msdn.microsoft.com/en-us/library/d91k01sh.aspx
and I again think this is correct. The rationale is:
On Mach-O and ELF linking normally all default visibility symbols are
exported. During LTO the linker must compute symbols it wants to
export and then ask LTO for all the symbols that
* Are used from a regular object file or
* Must be placed in the symbol table.
On COFF it is different. Symbols are not normally exported. To be
exported a symbol must be marked dllexported or put in a .def file.
Under this model the LTO interface can be simplified so that the
linker has to request only the symbols that
* Are used from regular object files (like ELF/COFF)
* Are listed in a .def file.
The LTO module itself can handle the dllexported ones.
But yes, we really should put a note on the LangRef about this :-)
Cheers,
Rafael
More information about the llvm-commits
mailing list