[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 14:13:52 PDT 2019


tejohnson added a comment.

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

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


Are you thinking of https://reviews.llvm.org/D43361?

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

@pcc might have some info here. But I don't think so. We just can't mark hidden without the global visibility of all symbols, as we have here with ThinLTO (because of ELF picking the most hidden one).


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