[PATCH] D59709: [ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 13:42:21 PDT 2019


tejohnson added a comment.

In D59709#1440017 <https://reviews.llvm.org/D59709#1440017>, @steven_wu wrote:

> I am not quite sure what is the semantics for ELF linker. When thinLTO picks the linkonce_odr version and promote it to weak, it is not changing the visibility. It is a later linker optimization that auto hide the linkonce_odr symbol, correct?


It is in fact ThinLTO that is changing the visibility (D43130 <https://reviews.llvm.org/D43130>). See the change I made to FunctionImport.cpp.

> If that is the case, would it be a problem for non-LTO link as well? ld64 always prefers the symbol that is not autohide so I don't think it will run into this situation.

pcc@ looked at this and found that ELF semantics picks the most hidden visibility. However, without ThinLTO we aren't marking any of these as hidden, so it isn't an issue.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59709/new/

https://reviews.llvm.org/D59709





More information about the llvm-commits mailing list