<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 28, 2017 at 9:47 AM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> writes:<br>
<br>
> tl;dr: it looks like we call SymbolBody::getVA about 5x more times than we<br>
> need to<br>
><br>
> Should we cache it  or something? (careful with threads).<br>
<br>
</span>Maybe. It might be the case that there are multiple relocations to the<br>
same symbol. It can also be the case that we look for it to find the<br>
value to put in a symbol table.<br>
<br>
The cost of the call is very different depending on what section the<br>
symbol is in. One thing I think we can do is move the symbols out in the<br>
section merge hierarchy.<br>
<br>
For example, a symbol initially points to a MergeInputSection, but we<br>
could then change it to point to a SyntheticSection or even an output<br>
section.<br></blockquote><div><br></div><div>You mean, redirect the symbol to point to the finalized string table? I kind of like that idea.</div><div>One issue with that though is the section symbol semantics. It's not possible to correctly handle that just by redirecting the symbol. (I really don't like the semantics of that)</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>