On Jun 5, 2008, at 10:43 AM, Ian Lance Taylor wrote:
Chris Lattner <[EMAIL PROTECTED]> writes:
LLVM LTO handles this by marking symbols "internal" (aka static, aka
not TREE_PUBLIC, whatever) when the symbol is not visible outside the
LTO scope. This allows the optimizers to go crazy and hack away at
the symbols, but only when safe.
How does the linker do this? Are you saying that when generating a
shared library, the linker calls lto_codegen_add_must_preserve_symbol
for every externally visible symbol?
Yes.
How does the linker tell LTO that a symbol may be inlined, but must
also be externally visible?
The linker just tells LTO which symbols must remain. The LTO engine
is free to inline anything that would improve codegen, with the
exception
that any weak definition that must remain (preserved) cannot be inlined.
-Nick