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

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 14:04:21 PDT 2019


steven_wu added a comment.

In D59709#1440033 <https://reviews.llvm.org/D59709#1440033>, @tejohnson wrote:

> 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.


Interesting, I made that change! But I somehow remembered I got pushed back because of ELF semantics and end up implementing that in ld64 instead. Let me dig up some context and get back to you.

>> 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.

I see, so if ELF linker doesn't have this autohide optimization, it should be fine in this specific case (but I thought there are some ELF linker actually does this).


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