[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 Mar 15 16:01:58 PDT 2018


steven_wu added a comment.

So the original of this patch is thinLTO is promoting linkonce_odr to weak_odr. Think the following two situations:

1. linkonce_odr + local_unnamed_addr --> linkonce_odr

compiler is dropping unnamed_addr, it is not safe to hide.

2. linkonce_odr + local_unnamed_addr --> weak_odr + local_unnamed_addr

this is the linkage promotion by thinLTO, it is still 'safe' to hide.

For the linker point of view (at least ld64), both of them started with "weak auto-hide" in IR and turns into "weak" in object file. The only thing like can do safely is export the weak symbol.


Repository:
  rL LLVM

https://reviews.llvm.org/D43361





More information about the llvm-commits mailing list