[PATCH] D43361: [ThinLTO] Enable AutoHide on symbols with local_unnamed_addr

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 12:12:49 PST 2018


Steven Wu via Phabricator <reviews at reviews.llvm.org> writes:

> steven_wu added a comment.
>
> I am using local_unnamed_addr as an example. Maybe you are right but I think my point is still valid. That is, LTO optimization and code generation can modify the symbol table from the bitcode file. It is already the case that symbols can be internalized, removed, backend can also insert new symbols.. Unless there is a rule saying LTO passes cannot modify the linkage or visibility or any other attributes to the symbols, linker cannot trust whatever the bitcode symbol table says and firmly it will not be changed for some good reason.
>
> In this case, if the unnamed_addr attributes are not illegal to change, the linkage can be changed which effectively disable autohide on the symbol.

If LTO does change the IR in some way that would drop
local_unnamed_addr, it will not be present in the .o that is passed to
the linker.

So the linker can decide if it is valid to hide the symbol by looking at
all the input files, bitcode or not, including the ones produced by LTO.

Cheers,
Rafael


More information about the llvm-commits mailing list