<br /><br /><span>On 03/14/15, <b class="name">Shankar Easwaran </b> <shankarke@gmail.com> wrote:</span><blockquote cite="mid:CAE6n4ChmzzmbwDoE9fFigtwfcHaOn5P3baKP_WH_U7LTt+wcbg@mail.gmail.com" class="iwcQuote" style="border-left: 1px solid #00F; padding-left: 13px; margin-left: 0;" type="cite"><div class="mimepart text html"><div dir="ltr"><div class="gmail_extra"> <br /><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
><br />
> ================<br />
> Comment at: lib/ReaderWriter/ELF/SectionChunks.h:790<br />
> @@ -776,1 +789,3 @@<br />
> +  }<br />
> +  sym.setVisibility(visibility);<br />
>    sym.setBindingAndType(binding, type);<br />
> ----------------<br />
> This is very confusing, if you see line 771. We set binding for local symbols to be STB_LOCAL if scope is set to scopeTranslationUnit, so visibility would need to be set as STV_DEFAULT ? No ?<br />
><br />
<br />
</span>To me the whole notion of modeling visibility using 'Scope' is<br />
confusing. I don't see why we can't expose visibility as I did in my<br />
previous patch </blockquote><div><br /></div><div> If we want to a new attribute visibility to the Atom, I think we would need to cleanup and redefine scope IMO. This way it would be much cleaner than defining visibility attributes in multiple places .</div></div></div></div></div></blockquote><div><br /></div><div>ELF has some historic baggage in that it initially only had  STB_LOCAL and STB_GLOBAL.  Later when visibility hidden was invented (which is in-between LOCAL and GLOBAL),  it was wedged into the ELF format by adding some new bits to st_other field.  In lld, the Scope is a continuum from translation unit, to linkage unit, to global.  </div><div><br /></div><div>In ELF "protected" is a combination of two things: 1) the scope is global,  2) the symbol is not interposable.  So a visibility=protected symbol in ELF should map to an atom with:</div><div>  scope=global, interposable=no.</div><div>Whereas regular global symbols in ELF should have interposable=yes.</div><div><br /></div><div>-Nick</div><div><br /></div><blockquote cite="mid:CAE6n4ChmzzmbwDoE9fFigtwfcHaOn5P3baKP_WH_U7LTt+wcbg@mail.gmail.com" class="iwcQuote" style="border-left: 1px solid #00F; padding-left: 13px; margin-left: 0;" type="cite"><div class="mimepart text html"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div ><br/></div></div></div></div></div></blockquote>