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

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 16:22:55 PST 2018


steven_wu added a comment.

In https://reviews.llvm.org/D43361#1009486, @pcc wrote:

> The last time this was attempted (https://reviews.llvm.org/D28978) we established that the linker can do this itself. I don't think the situation has changed since then.


I didn't know that we have discussed about this once. This issue comes up again because when thinLTO can promote linkonce_odr to weak_odr (in order to keep the symbol, not to disable auto hide), thus it lost auto hide before the object reaches the linker.

There is an alternative which is to teach linker to deduct auto hide property from the bitcode file and overwrite the linkage type afterwards. For C API, there is a new scope LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN can be used to do that but that will be forced the work onto all the linker which is probably not desirable but it solves the same problem.


Repository:
  rL LLVM

https://reviews.llvm.org/D43361





More information about the llvm-commits mailing list