<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 10, 2016 at 10:32 PM, John McCall via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">I mean, I’ve never really liked ELF’s stance on symbol interposition, but taking it as given, I’m not sure I agree that it’s reasonable to carve out virtual functions as a general exception.</div></blockquote><div><br></div><div>Given that LLVM does IPO (inlining, funcattrs) on symbols that can be interposed on ELF, we already don't support interposability very well:</div><div><a href="https://llvm.org/bugs/show_bug.cgi?id=23501">https://llvm.org/bugs/show_bug.cgi?id=23501</a><br></div><div><br></div><div>Adding another exception for virtual functions, especially under an off-by-default flag, doesn't seem like a big deal.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Isn’t there some global flag to make (non-weak?) definitions use protected visibility by default?  Wouldn’t using that be an overall performance win anyway?</div></div></blockquote><div><br></div><div>Joerg mentioned -Bsymbolic, but I'm surprised that I don't see people use -Bsymbolic-functions more often. C++ has the ODR, so we can say that all definitions of the same (C++!) function must be equivalent, and it doesn't matter which you call. Programs very rarely rely on function pointer identity across DSOs, and it already isn't preserved on a number of platforms (MSVC does ICF). Typically only global data needs to be coalesced across DSOs, so that things like static data members of templates and static locals in inline functions work.</div></div></div></div>